Soil tillage layer moisture temperature prediction method based on deep learning
By introducing the W-MA-LSTNet model of wavelet noise reduction and time-step dimension mixed attention module in soil moisture temperature prediction, the problem of data preprocessing and feature extraction is solved, and high-precision soil moisture temperature prediction is achieved. Deploy locally and significantly improve predictive performance.
Patent Information
- Application Number
- CN202210517758.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-13
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2042-05-13
AI Technical Summary
The prior art has problems in the prediction of soil moisture temperature, difficulties in data pretreatment and feature extraction, limitations in sample quality and quantity, and lack of universality, making it difficult to achieve efficient prediction of soil tillage moisture temperature.
A deep learning-based soil tillage layer moisture temperature prediction model W-MA-LSTNet is designed. By introducing a wavelet noise reduction module and a time step and dimensional mixed attention module, combined with the LSTNet network, data preprocessing and feature extraction are optimized to improve Prediction accuracy and reduce system resource usage.
It realizes high-precision soil moisture temperature prediction, reduces RMSE, MAE, and MAPE indicators, improves R2 values, significantly improves the prediction performance of traditional models, and is suitable for local equipment deployment.
Smart Images

Figure CN115017798B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method for predicting the moisture temperature of a soil cultivation layer. Background Art
[0002] Agricultural soil is generally composed of the tillage layer, the plow bottom layer, the subsoil layer and the subsoil layer. The tillage layer refers to the topsoil layer that has been matured after long-term cultivation, with a depth of about 15-20cm. The tillage layer is easily affected by the surrounding environmental climatic conditions. This layer is often high in organic matter content, rich in nutrients, and loose in soil. The roots of crops are mainly distributed in the tillage layer. The plow bottom layer is located below the tillage layer, with a thickness of about 6-8cm. It is a densely structured layer formed by the heavy pressure of large agricultural machinery. The soil of the plow bottom layer is characterized by compactness, generally in the form of sheets, large blocks or layers. The total porosity of the plow bottom layer is small and the air permeability is poor, making it difficult for the roots of crops to penetrate. The subsoil layer usually refers to the soil layer from the plow bottom layer to a depth of 50cm, which is generally poor and has a low nutrient content. The subsoil layer is a layer of soil that is not affected by tillage and maintains the characteristics of the parent material. The subsoil layer is below the subsoil layer, generally located 50-60cm below the soil surface. This layer is rarely affected by the surface climate and is relatively dense, with slow material transformation, less effective nutrients and fewer root distribution. In agricultural planting, the roots of crops mainly rely on the soil environment of the tillage layer and are rarely distributed in other layers, so more attention needs to be paid to the soil tillage layer.
[0003] Among the many soil parameters, soil temperature and moisture play an important role. Soil moisture is the key to plant growth. Too low or too high soil moisture is not conducive to field farming measures and sowing quality. Maintaining appropriate soil moisture and good soil aeration is of great significance to high-quality crop cultivation. Too low soil moisture will cause soil drought; too high soil moisture will deteriorate soil aeration and affect the growth of field crops. Soil moisture has become a key research content in the fields of agricultural ecology, environmental climate, etc.
[0004] Soil temperature is one of the basic conditions for various chemical, physical and biological processes in the soil and plant growth. The temperature of the cultivated layer soil has an important impact on the growth and development of crops. Soil temperature is the most important variable affecting agricultural activities, irrigation plans and soil drainage. The cultivated layer is rich in nutrients, and the roots of crops are mainly distributed in this layer. Paying attention to protecting and fertilizing the cultivated layer is a prerequisite for obtaining high crop yields. Therefore, high-quality time series prediction of soil moisture and temperature in the cultivated layer is of great significance to scientific research and agricultural production.
[0005] At present, soil temperature, moisture and other parameters are mainly obtained through satellite remote sensing and field sensor measurement. Compared with satellite remote sensing, collecting soil parameters through field sensors has the characteristics of stronger real-time performance and simplicity and convenience. With the rapid development of wireless communication and Internet of Things technology, on-site soil parameter collection is suitable for agricultural planting areas with relatively scattered layouts, and is helpful for real-time soil irrigation on site. In order to enhance agricultural planting capacity, it is necessary to further predict future soil moisture and temperature parameters. For the prediction of soil tillage layer moisture temperature time series data, researchers have proposed different prediction methods including physical methods, statistical methods and artificial intelligence methods, which are applicable to different soil environments.
[0006] In recent years, with the improvement of computer computing power, many scholars at home and abroad have begun to use machine learning methods to study soil moisture and temperature prediction. Xue Xiaoping et al. used the support vector machine method to establish a soil moisture prediction model. The constructed model has high prediction accuracy, but the data predicted by the traditional method has lag and it is difficult to find the optimal parameters (reference: Xue Xiaoping, Wang Xin, Zhang Lijuan, et al. Discussion on the establishment of soil moisture prediction model based on support vector machine method [J]. Soil Bulletin, 2007, 38 (3): 427-433.). Nie Hongmei et al. proposed a support vector machine model based on principal component analysis, selecting input variables with greater influence on soil moisture to achieve soil moisture prediction for different depths of soil layers (reference: Nie Hongmei, Yang Lian'an, Li Xinyao, et al. Prediction of winter wheat soil moisture based on PCA-SVR [J]. Soils, 2018, 50 (4): 812-818.). This method uses principal component analysis to reduce the number of variables used to predict soil moisture, which improves the prediction accuracy to a certain extent, but the improvement is limited. Wu et al. used artificial neural network (ANN) to accurately estimate the monthly average soil temperature data at a depth of 10 cm (reference:
[41] Wu W, Tang XP, Guo NJ, et al. Spatiotemporal modeling of monthly soil temperature using artificial neural networks [J]. Theoretical and applied climatology, 2013, 113 (3): 481-494.), but this method can only predict the soil temperature in the monthly dimension and is difficult to apply to daily agricultural production.
[0007] Deep learning technology is currently in a rapid development stage. Among them, the recurrent neural network (RNN) is a special neural network that can meaningfully retain data about events in previous time steps. The time series prediction model based on the long short-term memory (LSTM) network has been widely used in various fields. Dae-Hyun Jung et al. tested three neural network models based on deep learning to predict environmental changes in temperature, humidity and CO2 in greenhouses, namely ANN, nonlinear autoregressive network with exogenous inputs (NARX) and LSTM. The experiment found that LSTM had the highest overall accuracy (reference: Jung DH, Kim HS, Jhin C, et al. Time-serial analysis of deep neural network models for prediction of climatic conditions inside a greenhouse [J]. Computers and Electronics in Agriculture, 2020, 173: 105402.).
[0008] However, traditional deep learning models usually have more restrictions on the quality and quantity of samples, so more efforts are needed in data preprocessing and feature extraction. In addition, since the soils in different regions vary greatly, more universal soil prediction methods are also needed. Summary of the invention
[0009] The purpose of the present invention is to design a soil moisture and temperature prediction model, which has good prediction performance while occupying less system resources and can be deployed on local devices to overcome the shortcomings of traditional machine learning models in predicting soil moisture and temperature.
[0010] In order to achieve the above object, the technical solution of the present invention is to provide a soil tillage layer moisture temperature prediction method based on deep learning, which is characterized by comprising the following steps:
[0011] Step 1: Establish an NB-IoT Internet of Things data acquisition system for equally spaced time series data acquisition to obtain equally spaced time series observation data of air temperature, air humidity, soil temperature and soil moisture data at the reference point;
[0012] Step 2: Establish a W-MA-LSTNet soil moisture and temperature prediction model based on the LSTNet network, deploy the W-MA-LSTNet soil moisture and temperature prediction model in the local device, and use the W-MA-LSTNet soil moisture and temperature prediction model to provide prediction services after the local device obtains the equally spaced time observation value sequence data. The W-MA-LSTNet soil moisture and temperature prediction model provides prediction services using the equally spaced time observation value sequence data, which further includes the following steps:
[0013] Step 201: The original equally spaced time observation value sequence data obtained by the NB-IoT Internet of Things data collection system is sent to the wavelet denoising module, and the wavelet denoising module performs denoising on the collected data set, and removes redundant noise data in the data set by the denoising method to obtain a denoised multi-dimensional multi-step time series;
[0014] Step 202: The multi-dimensional multi-step time series output by the wavelet denoising module are respectively input into the AR autoregressive module and the convolutional layer, wherein: the convolutional layer is used to extract the short-term local information features of the input; and the linear component is introduced through the AR autoregressive model;
[0015] Step 203: The short-term local information features output by the convolutional layer are input into the time step and dimension hybrid attention module; in the time step and dimension hybrid attention module, two parallel Dense fully connected layers are used to calculate the time step attention weight matrix W T With dimension attention weight matrix W D ;
[0016] Assume that the time step length of the input time step and dimension mixed attention module is m, and the dimension length is n, then calculate W T The number of neurons in the Dense fully connected layer is m, and W is calculated. D The number of neurons in the Dense fully connected layer is n, and the activation function uses the Sigmoid function;
[0017] The input x of the time step and dimension mixed attention module is expressed as follows:
[0018]
[0019] In the formula, 1≤i≤m,1≤j≤n, represents the jth input dimension of the i-th time step;
[0020] Time step attention weight matrix W T Sub-elements in 1≤i≤m is calculated as follows:
[0021]
[0022] In the formula, w i is the weight coefficient, b is the bias coefficient;
[0023] Dimensional attention weight matrix W D Sub-elements in The calculation of 1≤i≤n is as follows:
[0024]
[0025] Where w′ i is the weight coefficient, b′ is the bias coefficient;
[0026] The attention weight matrix W for the time step T With dimension attention weight matrix W D Filling results in two matrices with m rows and n columns as shown below:
[0027]
[0028]
[0029] The output of the time step and dimension mixed attention module is calculated by the following formula
[0030]
[0031] In the formula, represents the Hadamard product;
[0032] Step 204: Output of the time step and dimension mixed attention module The recurrent layer and skip-RNN are input respectively, where: the recurrent layer adopts the GRU unit structure and uses ReLU as the activation function, and its output is the hidden state of each time step; skip-RNN is an RNN with skip steps, which uses the fixed cycle of real time series to obtain the repetitive cycle pattern in the time series;
[0033] Step 205, the outputs of the recurrent layer and the skip-RNN are combined through the output Dense layer;
[0034] Step 206: Fusing the output of the output Dense layer with the output of the AR autoregressive model to obtain a prediction result, wherein the AR autoregressive model is used to add linear components to the final prediction result of the model.
[0035] Preferably, the NB-IoT Internet of Things data acquisition system consists of an on-site terminal node and a cloud data management platform. The on-site terminal node obtains a sequence of observation values of each monitoring parameter at equal intervals and sends it to the cloud data management platform through the NB-IoT data channel.
[0036] Preferably, the field terminal node includes an MCU, a soil moisture temperature sensor, and an air temperature and humidity sensor. The data acquisition interval of the air temperature and humidity sensor and the soil sensor is accurately set to 5 minutes through the timer in the MCU. After reaching the corresponding time reference point, the MCU reads the observation values from the air temperature and humidity sensor and the soil sensor. After obtaining the data, the MCU performs a CRC check, and then encapsulates the data into a frame after adding the corresponding time mark and sends it through the NB-IoT data channel.
[0037] Preferably, in step 201, assuming that the original equally spaced accurate observation value time series data is a discrete time series x(kΔt), the processing of the discrete time series x(kΔt) by the wavelet denoising module specifically includes the following steps:
[0038] Step 211, using the Mallat algorithm to perform multi-scale signal decomposition on the discrete time series x(kΔt);
[0039] Step 212: Use the wavelet coefficient threshold processing method to process the high-frequency wavelet coefficients d J,k Processing is performed to remove the high-frequency wavelet coefficients of the noise;
[0040] Step 2013: Perform inverse discrete wavelet transform on the signal processed by the wavelet coefficient threshold processing method to obtain a multi-dimensional multi-step time series after noise reduction.
[0041] Preferably, in step 2012, the wavelet coefficient threshold processing method is a hard threshold method or a soft threshold method, wherein:
[0042] The hard threshold method converts d J,k The part less than the threshold th is set to zero, and the rest is retained, as shown in the following formula:
[0043]
[0044] In the formula, Represents the high-frequency wavelet coefficients after hard thresholding;
[0045] The soft threshold method converts d J,k The part less than the threshold th is set to zero, and d J,k The part greater than the threshold th is shifted toward zero by th units, as shown in the following formula:
[0046]
[0047] In the formula, sgn(d J,k ) is a symbolic function, and:
[0048] Compared with the prior art, the advantages of the present invention are as follows: the present invention proposes a model W-MA-LSTNet (Wavelet-Mixed Attention-LSTNet) based on the improved LSTNet network. The negative effect of noise in the data set on model training is reduced by introducing a wavelet denoising module, thereby improving the accuracy of prediction. At the same time, the present invention constructs a time step and dimension mixed attention module to extract the implicit information of the prediction results and different dimensions at different time steps, further improving the prediction accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a system block diagram of the NB-IoT Internet of Things data acquisition system in this embodiment;
[0050] Figure 2 It is a structural diagram of the W-MA-LSTNet soil moisture and temperature prediction model in this embodiment;
[0051] Figure 3 This is the flow chart of wavelet denoising;
[0052] Figure 4A The hard thresholding function is shown;
[0053] Figure 4B The soft thresholding function is shown;
[0054] Figure 5 The wavelet denoising results of soil temperature time series are shown. DETAILED DESCRIPTION
[0055] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the appended claims of the application equally.
[0056] The present invention designs an NB-IoT Internet of Things data acquisition system for equally spaced time series data acquisition, which is used to obtain equally spaced time series observation values of air temperature, air humidity, soil temperature and soil moisture data at a reference point position, and can realize the reliable acquisition and centralized management of ambient air temperature and humidity data and cultivated layer soil moisture temperature data.
[0057] like Figure 1As shown, in this embodiment, the NB-IoT Internet of Things data acquisition system consists of a field terminal node and a cloud data management platform. The field terminal node obtains the observation value of each monitoring parameter and sends it to the cloud data management platform through the NB-IoT data channel. The field terminal node can stably obtain an accurate observation value sequence at equal intervals and upload it to the cloud management platform. The cloud data management platform combines the server MySQL database to realize the management functions of NB-IoT data interface, data storage, data interaction, etc.
[0058] The field terminal node consists of an STM32 microcontroller (MCU), a soil moisture temperature sensor, an air temperature and humidity sensor, an isolated bus interface module, an NB-IoT low-power wide area network communication module, and a node power supply. Among them, the soil moisture temperature sensing module uses the SM3002B sensor, the soil temperature sensing range is -30℃~80℃, the error is between ±0.5℃, the moisture measurement range is 0~24%, and the error is between ±3%. The air temperature and humidity sensing module uses the AM2306 sensor, which is connected to the STM32 microcontroller through a single bus. The temperature measurement range is -40~125℃, the error is between ±0.3℃, and the humidity measurement range is 0~99.9%, and the error is between ±2%. In order to prevent external electromagnetic interference from affecting the operation of the node through the bus, the RSM3485 transceiver module with an isolation withstand voltage of up to 2500VDC is used to isolate the electromagnetic interference on the bus.
[0059] The WH-NB75-B5 NB-IoT wireless communication module is used for node communication. The observation data obtained by the field terminal node is sent by the WH-NB75-B5 module to the third-party NB-IoT server built on the telecom operator service platform based on the MQTT protocol, and is obtained by the cloud data management platform through the corresponding NB-IoT data interface. Give full play to the advantages of NB-IoT long-distance data transmission, such as reliable and low consumption, no need for additional networking operations, facilitating the deployment of nodes in a larger spatial range, and supporting a larger number of nodes. In the power supply part, the UGREEN-20379 is connected to the node through an interface that complies with the USB power supply protocol based on the 5.0V power supply generated by the mains power supply, as the main power supply of the node. The LM1117 linear regulator provides the node with a highly stable 3.3V operating voltage based on this power supply. The USB power supply interface on the node is also compatible with auxiliary emergency power supply solutions such as power banks. In addition, the system also provides a 12V operating voltage for the soil sensor via the YWSMPS D-30A.
[0060] In order to accurately obtain the time series data of equally spaced and accurate observation values of various environmental and soil parameters, the field terminal node adopts the acquisition logic based on its internal timing. Compared with the polling scheme based on the remote cloud, the internal timing avoids the time base error caused by the information delay of the NB-IoT data channel and the cloud platform. The operating frequency of the STM32 microcontroller refers to the 8M high-precision crystal oscillator on it, and the data acquisition interval of the air temperature and humidity sensor and the soil sensor is accurately set to 5min through the STM32 intermediate and advanced timer (TIM1). After reaching the corresponding time reference point, the STM32 microcontroller reads the observation value from the air temperature and humidity sensor and the soil sensor. After obtaining the data, the STM32 microcontroller performs CRC check, and then encapsulates the data into a frame after adding the corresponding time mark and sends it through the NB-IoT data channel. The field terminal node and the cloud data management platform confirm whether the data transmission is successful by returning the confirmation information to ensure that the cloud data management platform receives the correct data at least once. The STM32 microcontroller caches the observation data in its data space until it receives the confirmation information sent by the cloud data management platform.
[0061] The cloud data management platform consists of cloud platform, front-end management, data management, and NB-IoT data interface. The cloud platform is implemented using the Java-based Spring Boot, Spring MVC, and MyBatis frameworks, where Spring Boot is responsible for the rapid integration of various functional components, Spring MVC is responsible for the requests and responses between the cloud platform and the front-end management application, and MyBatis is used to support data management operations between the cloud platform and the database. Front-end management is implemented using the JavaScript-based VUE framework, which provides convenient data management operations in the form of web pages and implements data interaction with the cloud server through the HTTP protocol. Data management is implemented using the MySQL relational database, which stores field terminal node information and the environmental soil parameters collected by the table.
[0062] In order to improve the query efficiency of environmental data and avoid slow query, the cloud data management platform stores the environmental data collected by the field terminal nodes in monthly partitions. Each piece of environmental data stored in the database table includes information such as the primary key ID, terminal node ID, data collection time, air temperature, air humidity, soil temperature, soil moisture, and partition key. The primary key ID and partition key are stored in int type, the terminal node ID is stored in varchar type, the data collection time is stored in timestamp type, and the environmental soil parameter data is stored in float type. The NB-IoT data interface is implemented using the MQTT client based on Java language, and the cloud platform monitors the NB-IoT data channel provided by the third-party service provider. A complete data packet includes information such as the header, data packet length, terminal node ID, environmental soil parameters, and packet tail. When the cloud platform receives a complete data packet, a polynomial calculation is performed on each byte in the data packet to obtain a CRC check code. If the check code is consistent with the cyclic redundancy check code verification in the received data packet, the server program will store the data in the received data packet in the MySQL database in the server through the MyBatis data interface. When the server verifies the integrity and correctness of the data packet, the cloud platform will send a response signal to the terminal node indicating that the transmission is correct. Otherwise, it will request the terminal node to resend the data packet. The data collected by the terminal node will be stored in the MySQL database in the cloud server. Therefore, after the data is stored, the data collected by the node can be batch queried through SQL commands. After processing the queried data, a data set that can be used for machine learning can be obtained.
[0063] The present invention establishes a W-MA-LSTNet soil moisture and temperature prediction model deployed in a local device for providing prediction services. The soil moisture and temperature data collected by the on-site terminal node will be affected by soil characteristics to a certain extent, resulting in the collected data being interfered by noise, thereby affecting the prediction effect. Therefore, the W-MA-LSTNet soil moisture and temperature prediction model provided by the present invention introduces wavelet analysis to remove redundant noise data in the data set by denoising. The prediction input of soil moisture and temperature is a multi-time step and multi-dimensional time series, and different time steps and different dimensions have different effects on the prediction results. The W-MA-LSTNet soil moisture and temperature prediction model extracts implicit information between multi-time steps and multi-dimensional variables and prediction results by introducing a time step and dimension mixed attention mechanism, and further optimizes the prediction results. Therefore, the W-MA-LSTNet model provided by the present invention combines a wavelet denoising module, a time step and dimension mixed attention module, and an LSTNet network to better predict soil moisture and temperature.
[0064] Specifically, if Figure 2As shown, the W-MA-LSTNet soil moisture temperature prediction model provided by the present invention is implemented based on the LSTNet network.
[0065] In the W-MA-LSTNet soil moisture and temperature prediction model, the original equally spaced accurate observation time series data obtained through the NB-IoT Internet of Things data acquisition system is sent to the wavelet denoising module, which performs denoising on the collected data set and removes redundant noise data in the data set through the denoising method. Assume that the original equally spaced accurate observation time series data is a discrete time series x(kΔt), then Figure 3 As shown, the processing of the discrete time series x(kΔt) by the wavelet denoising module specifically includes the following steps:
[0066] Step 101: Use the Mallat algorithm to perform multi-scale signal decomposition on the discrete time series x(kΔt), wherein ψ(t) represents the mother wavelet in the Mallat algorithm, and the mother wavelet ψ(t) of the Jth decomposition layer is expressed as ψ j,k , then after the discrete time series x(kΔt) completes the multi-scale decomposition of the signal, the high-frequency wavelet coefficients of its effective signal f(t) and noise e(t) are and Respectively expressed as:
[0067]
[0068]
[0069] Step 102: Since the effective signal f(t) is generally a low-frequency continuous signal with a large amplitude, and the noise e(t) is generally a high-frequency discrete signal with a small amplitude, the wavelet coefficients of the noise e(t) after decomposition will also be smaller than the wavelet coefficients of f(t) after decomposition, and mainly exist in the high-frequency part. Therefore, the high-frequency wavelet coefficients d of the decomposed signal obtained in step 101 are decomposed using the hard threshold method or the soft threshold method. J,k to be processed.
[0070] like Figure 4A As shown, the hard threshold method will J,k The part less than the threshold th is set to zero, and the rest is retained, as shown in the following formula:
[0071]
[0072] In the formula, Represents the high-frequency wavelet coefficients after hard thresholding.
[0073] like Figure 4B As shown, the soft threshold method converts d J,k The part less than the threshold th is set to zero, and d J,kThe part greater than the threshold th is shifted toward zero by th units, as shown in the following formula:
[0074]
[0075] In the formula, sgn(d J,k ) is a symbolic function, which is defined as follows:
[0076]
[0077] Step 103: Perform inverse discrete wavelet transform on the signal processed by the hard threshold method or the soft threshold method to obtain a multi-dimensional multi-step time series after noise reduction.
[0078] In this embodiment, the wavelet basis function used in the signal multi-scale decomposition and inverse discrete wavelet transform is coif5, and the soft threshold method is used to perform wavelet coefficient threshold processing. The obtained wavelet denoising result is as follows: Figure 5 Comparing the original data curve and the denoised curve, it can be found that the denoised sequence can better reflect its trend characteristics.
[0079] The multi-dimensional and multi-step time series output by the wavelet denoising module are input into the AR autoregressive module and the convolutional layer respectively. The AR autoregressive model and convolutional layer are adopted from the LSTNet network, where: the convolutional layer is used to extract the short-term local information features of the input; the linear component is introduced through the AR autoregressive model, and the problem of neural network scale insensitivity is solved.
[0080] The short-term local information features output by the convolutional layer are input into the time step and dimension mixed attention module. In the time series prediction task, the input variables usually include not only the multi-time step sequence of the previous moment, but also other related variables in addition to the predicted quantity. For example, in the soil moisture temperature time series prediction task in this article, the soil temperature at the current moment has a strong correlation with the soil temperature at the previous moment, and also has a certain relationship with the changing trend of air temperature and soil moisture. Therefore, the present invention introduces a time step and dimension mixed attention mechanism to extract the implicit information of the predicted quantity and different time steps and multiple input variables.
[0081] In the time step and dimension mixed attention module, two parallel Dense fully connected layers are used to calculate the time step attention weight matrix and the dimension attention weight matrix respectively. Let the time step attention weight matrix be W T , the dimension attention weight matrix is W D Assume that the time step of the input time step and the time step of the dimension mixed attention module is m, and the dimension length is n, then calculate W T The number of neurons in the Dense fully connected layer is m, and W is calculated. DThe number of neurons in the Dense fully connected layer is n, and the activation function uses the Sigmoid function.
[0082] The input x of the time step and dimension mixed attention module is expressed as follows:
[0083]
[0084] In the formula, 1≤i≤m,1≤j≤n, represents the j-th input dimension of the i-th time step.
[0085] Time step attention weight matrix W T Sub-elements in 1≤i≤m is calculated as follows:
[0086]
[0087] In the formula, w i is the weight coefficient, and b is the bias coefficient.
[0088] Dimensional attention weight matrix W D Sub-elements in The calculation of 1≤i≤n is as follows:
[0089]
[0090] Where w′ i is the weight coefficient, and b′ is the bias coefficient.
[0091] The attention weight matrix W for the time step T With dimension attention weight matrix W D Filling results in two matrices with m rows and n columns as shown below:
[0092]
[0093]
[0094] Finally, the output of the time step and dimension mixed attention module is calculated by the following formula:
[0095]
[0096] In the formula, Represents the Hadamard product.
[0097] Output of the time step and dimension mixed attention module Input the recurrent layer and skip-RNN respectively. The recurrent layer and skip-RNN are inherited from the LSTNet network, where: the recurrent layer adopts the GRU unit structure, uses ReLU as the activation function, and its output is the hidden state of each time step; skip-RNN is an RNN with skip steps, which uses the fixed cycle of real time series to obtain the repetitive cycle pattern in the time series.
[0098] The W-MA-LSTNet soil moisture and temperature prediction model uses an output Dense layer after the loop layer and Skip-RNN to combine the outputs of the two networks.
[0099] The output prediction results of the W-MA-LSTNet soil moisture and temperature prediction model are obtained by fusing the output of the output Dense layer with the output of the AR autoregressive model. The AR autoregressive model is used to add linear components to the final prediction results of the model.
[0100] (I) Analysis of prediction results of soil temperature in the cultivated layer
[0101] The W-MA-LSTNet model is compared with the LSTM, GRU, Bi-LSTM and LSTNet models. The comparison results of the evaluation indicators RMSE, MAE, MAPE and R2 are shown in Table 1. LSTNet has been greatly improved compared with the currently widely used LSTM, GRU and Bi-LSTM models. In the prediction results of soil temperature in the cultivated layer of soil type 1, W-MA-LSTNet reduced RMSE by 2.8%, MAE by 5.7%, MAPE by 5.9%, and R2 by 0.4% compared with the LSTNet model, and all evaluation indicators are better. In the prediction results of soil temperature in the cultivated layer of soil type 2, W-MA-LSTNet reduced RMSE by 4.8%, MAE by 4.3%, MAPE by 5.3%, and R2 by 1% compared with the unimproved LSTNet model, and all evaluation indicators are better.
[0102] Table 1 Comparison of experimental results of various models for soil tillage layer temperature
[0103]
[0104] (II) Analysis of prediction results of soil moisture in the cultivated layer
[0105] The trained W-MA-LSTNet model is compared with the classic LSTM, GRU, Bi-LSTM and unimproved LSTNet models. The comparison results of the evaluation indicators RMSE, MAE, MAPE and R2 are shown in Table 2 below. LSTNet has been improved compared with the LSTM, GRU and Bi-LSTM models. In the prediction results of soil moisture in the cultivated layer of soil type 1, W-MA-LSTNet reduced RMSE by 7.2%, MAE by 11.2%, and MAPE by 19.8% compared with the unimproved LSTNet model, with obvious improvement except R2. In the prediction results of soil moisture in the cultivated layer of soil type 2, W-MA-LSTNet reduced RMSE by 3.6%, MAE by 5.8%, and MAPE by 14.6% compared with the unimproved LSTNet model. All evaluation indicators except R2 are better.
[0106] Table 2 Comparison of experimental results of various models for soil tillage layer moisture prediction
[0107]
[0108]
Claims
1. A soil tillage layer moisture temperature prediction method based on deep learning, characterized in that: The following steps are involved: Step 1: Establish an NB-IoT Internet of Things data acquisition system for equally spaced time series data acquisition to obtain equally spaced time series observation data of air temperature, air humidity, soil temperature and soil moisture data at the reference point; Step 2: Establish a W-MA-LSTNet soil moisture and temperature prediction model based on the LSTNet network, deploy the W-MA-LSTNet soil moisture and temperature prediction model in the local device, and use the W-MA-LSTNet soil moisture and temperature prediction model to provide prediction services after the local device obtains the equally spaced time observation value sequence data. The W-MA-LSTNet soil moisture and temperature prediction model provides prediction services using the equally spaced time observation value sequence data, which further includes the following steps: Step 201: The original equally spaced time observation value sequence data obtained by the NB-IoT Internet of Things data collection system is sent to the wavelet denoising module, and the wavelet denoising module performs denoising on the collected data set, and removes redundant noise data in the data set by the denoising method to obtain a denoised multi-dimensional multi-step time series; Step 202: The multi-dimensional multi-step time series output by the wavelet denoising module are respectively input into the AR autoregressive module and the convolutional layer, wherein: the convolutional layer is used to extract the short-term local information features of the input; and the linear component is introduced through the AR autoregressive model; Step 203: The short-term local information features output by the convolutional layer are input into the time step and dimension hybrid attention module; in the time step and dimension hybrid attention module, two parallel Dense fully connected layers are used to calculate the time step attention weight matrix W T With dimension attention weight matrix W D ; Assume that the time step length of the input time step and dimension mixed attention module is m, and the dimension length is n, then calculate W T The number of neurons in the Dense fully connected layer is m, and W is calculated. D The number of neurons in the Dense fully connected layer is n, and the activation function uses the Sigmoid function; The input x of the time step and dimension mixed attention module is expressed as follows: In the formula, represents the jth input dimension of the i-th time step; Time step attention weight matrix W T Sub-elements in The calculation is as follows: In the formula, w i is the weight coefficient, b is the bias coefficient; Dimensional attention weight matrix W D Sub-elements in The calculation of is as follows: Where w′ i is the weight coefficient, b′ is the bias coefficient; The attention weight matrix W for the time step T With dimension attention weight matrix W D Filling results in two matrices with m rows and n columns as shown below: The output of the time step and dimension mixed attention module is calculated by the following formula In the formula, represents the Hadamard product; Step 204: Output of the time step and dimension mixed attention module The recurrent layer and skip-RNN are input respectively, where: the recurrent layer adopts the GRU unit structure and uses ReLU as the activation function, and its output is the hidden state of each time step; skip-RNN is an RNN with skip steps, which uses the fixed cycle of real time series to obtain the repetitive cycle pattern in the time series; Step 205, the outputs of the recurrent layer and the skip-RNN are combined through the output Dense layer; Step 206: Fusing the output of the output Dense layer with the output of the AR autoregressive model to obtain a prediction result, wherein the AR autoregressive model is used to add linear components to the final prediction result of the model.
2. The method for predicting soil plough layer moisture temperature based on deep learning according to claim 1, characterized in that: The NB-IoT Internet of Things data acquisition system consists of an on-site terminal node and a cloud data management platform. The on-site terminal node obtains the equally spaced time observation value sequence data of various monitoring parameters and sends it to the cloud data management platform through the NB-IoT data channel.
3. The method for predicting soil plough layer moisture temperature based on deep learning as claimed in claim 2, characterized in that: The field terminal node includes an MCU, a soil moisture temperature sensor, and an air temperature and humidity sensor. The data acquisition interval of the air temperature and humidity sensor and the soil sensor is accurately set to 5 minutes through the timer in the MCU. After reaching the corresponding time reference point, the MCU reads the observation values from the air temperature and humidity sensor and the soil sensor. After obtaining the data, the MCU performs a CRC check, and then encapsulates the data into a frame after adding the corresponding time mark and sends it through the NB-IoT data channel.
4. The method for predicting soil plough layer moisture temperature based on deep learning according to claim 1, characterized in that: In step 201, assuming that the original equally spaced accurate observation value time series data is a discrete time series x(kΔt), the processing of the discrete time series x(kΔt) by the wavelet denoising module specifically includes the following steps: Step 211, using the Mallat algorithm to perform multi-scale signal decomposition on the discrete time series x(kΔt); Step 212: Use the wavelet coefficient threshold processing method to process the high-frequency wavelet coefficients d J,k Processing is performed to remove the high-frequency wavelet coefficients of the noise; Step 2013: Perform inverse discrete wavelet transform on the signal processed by the wavelet coefficient threshold processing method to obtain a multi-dimensional multi-step time series after noise reduction.
5. The method for predicting soil plough layer moisture temperature based on deep learning according to claim 4, characterized in that: In step 2012, the wavelet coefficient threshold processing method is a hard threshold method or a soft threshold method, wherein: The hard threshold method converts d J,k The part less than the threshold th is set to zero, and the rest is retained, as shown in the following formula: In the formula, Represents the high-frequency wavelet coefficients after hard thresholding; The soft threshold method converts d J,k The part less than the threshold th is set to zero, and d J,k The part greater than the threshold th is shifted toward zero by th units, as shown in the following formula: In the formula, sgn(d J,k ) is a symbolic function, and: