CN117688835A - Soil nutrient inversion method, electronic equipment and storage medium - Google Patents
Soil nutrient inversion method, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117688835A CN117688835A CN202311691300.4A CN202311691300A CN117688835A CN 117688835 A CN117688835 A CN 117688835A CN 202311691300 A CN202311691300 A CN 202311691300A CN 117688835 A CN117688835 A CN 117688835A
- Authority
- CN
- China
- Prior art keywords
- soil nutrient
- dimension reduction
- model
- soil
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
- G06F30/27—Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/213—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/10—Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Geometry (AREA)
- Image Processing (AREA)
Abstract
A soil nutrient inversion method, electronic equipment and a storage medium belong to the technical field of soil nutrient inversion. In order to improve the soil nutrient inversion efficiency and precision, the soil nutrient content assay is carried out on the field collected soil samples to obtain soil nutrient sample data which is used as a target data set of a soil nutrient inversion model; collecting and sorting the target data set and the spectrum information of the hyperspectral image by using geographic information software to obtain a hyperspectral data dimension-reduction sample data set; obtaining hyperspectral image data channel information with reduced dimension by using data dimension reduction processing; constructing a multi-attention-enhanced expansion feature extraction model; constructing a unilateral inhibition gate control cyclic neural network model; constructing a soil nutrient inversion model; inputting a target data set and an input data set of the model into a soil nutrient inversion model for training to obtain an optimal soil nutrient inversion model; and predicting the soil nutrients of the target area by using the optimal soil nutrient inversion model. The invention predicts accurately.
Description
Technical Field
The invention belongs to the technical field of soil nutrient inversion, and particularly relates to a soil nutrient inversion method, electronic equipment and a storage medium.
Background
At present, the black soil cultivated land has relatively low area occupation for comprehensive treatment, the problems of water and soil loss, shallow cultivated layer, erosion and the like of the slope cultivated land are serious, the organic matter content of the soil is still continuously reduced, the problems of soil acidification and salinization in partial areas are not improved, and the degradation trend of the black soil is still aggravated. In order to ensure the grain supply capability and recover the cultivated land force level, the important point is to promote the sustainable utilization of black land resources, the aim of treating the problems of thinning, thinning and hardening of black land is to be achieved, the main attack direction is to promote the black land force level and the quality level, the important point is to prevent and treat the water and soil loss and the cultivated land erosion of the cultivated land, and the important point is to protect the thickness of an effective cultivated layer and strengthen the quality monitoring. How to efficiently, accurately, stably and widely monitor the content of available nutrients in soil is a great problem at present.
The national satellite center is oriented to the important strategic demands of national grain safety, black land protection is taken as an entry point, and the hyperspectral soil parameter inversion technology and products are continuously explored and developed from 2019, so that key technologies such as automatic bare soil target identification, satellite-borne hyperspectral data sensitive spectral index construction, environment parameter and target spectrum collaborative modeling inversion and the like of cultivated land are broken through, and four hyperspectral soil index products and parameter inversion products of soil organic matters, sand grains, particles and cosmids are shaped in sequence according to a business and large-scale thought. The hyperspectral load collaborative observation of four allied areas of Heilongjiang, jilin, liaoning and inner Mongolian is carried out by comprehensively utilizing 5 m optical service satellites and high-resolution No. five satellites, the hyperspectral image 3488 of the satellite in 2019-2021 year is obtained and processed, and a soil organic matter, sand grain, powder particle and cosmid inversion thematic map is compiled, so that the full coverage of the cultivated areas of the black lands of China is realized. The root mean square error of soil organic matters is 5.16g/kg through the comparison and analysis of the sample independent verification with the ground, and the root mean square error of three parameters of sand grains, powder grains and cosmids is less than 8 percent; the decision coefficients of the four parameters are all higher than 0.75, and the inversion result has good consistency with the ground sample test result.
However, in most of the existing soil available nutrient inversion models, hyperspectral image data are utilized, so that the hyperspectral image data are large in spectral information redundancy, insufficient in feature extraction, less in receptive field during feature extraction, vanishing in important information memory and interference of non-important information redundancy in a multi-temporal image fusion process, too narrow in excitation boundary and too low in noise robustness, and therefore the soil nutrient inversion model is low in soil nutrient inversion efficiency, stability and accuracy, and is difficult to apply to the precise agricultural field in a large area.
Disclosure of Invention
The invention aims to solve the problems of improving soil nutrient inversion efficiency and improving soil nutrient inversion precision, and provides a soil nutrient inversion method, electronic equipment and a storage medium.
In order to achieve the above purpose, the present invention is realized by the following technical scheme:
a soil nutrient inversion method comprising the steps of:
s1, carrying out soil nutrient content assay on a field collected soil sample to obtain soil nutrient sample data which is used as a target data set of a soil nutrient inversion model;
s2, collecting corresponding hyperspectral image spectrum information from the soil nutrient sample data collected in the step S1 by using geographic information software, and performing data arrangement to obtain a hyperspectral data dimension reduction sample data set;
S3, performing data dimension reduction processing on the hyperspectral data dimension reduction sample data set obtained in the step S2 to obtain dimension reduction hyperspectral image data channel information;
s4, carrying out data dimension increasing processing on the dimension-reduced hyperspectral image data channel information, the elevation, the gradient, the slope direction, the soil type and the meteorological information obtained in the step S3 to obtain an input data set for a soil nutrient inversion model;
s5, constructing a multi-attention-enhanced expansion feature extraction model At_E_EFEM;
s6, constructing a single-side inhibition gate control cyclic neural network model S_E_GRU;
s7, constructing a soil nutrient inversion model based on the multi-attention enhanced expansion characteristic extraction model constructed in the step S5 and a unilateral inhibition gate control cyclic neural network model constructed in the ratio S6;
s8, inputting the model target data set obtained in the step S1 and the model input data set obtained in the step S4 into the soil nutrient inversion model constructed in the step S7 for model training to obtain an optimal soil nutrient inversion model;
s9, predicting the soil nutrients of the target area by using the optimal soil nutrient inversion model obtained in the step S8.
Further, in the step S1, target parameters for the soil nutrient inversion model are set, wherein the target parameters comprise alkaline hydrolysis nitrogen content, available phosphorus content, available potassium content and organic matter content of the soil.
Further, the specific implementation method of the step S2 includes the following steps:
s2.1, performing point spreading on the collected soil nutrient sample data by utilizing the point spreading function of ArcGIS10.1 to obtain soil nutrient sample point position data;
s2.2, performing radiation calibration, atmospheric correction, RPC orthographic correction and geometric fine correction pretreatment on the obtained hyperspectral image data by using ENVI5.6.3, combining point location data of soil nutrient samples, and integrating the preprocessed hyperspectral image data with the soil nutrient sample data by using the function of multi-value extraction to points in ArcGIS10.1 to obtain a tidied sample data set;
s2.3, sorting the tidied data set according to the collected soil nutrient content values from small to large, equally dividing 10 grades according to the maximum value and the minimum value of the collected soil nutrient content values, and respectively marking the grades as 0 to 9 to obtain a hyperspectral data dimension-reduction sample data set.
Further, the specific implementation method of the step S3 includes the following steps:
s3.1, performing dimension reduction analysis on the hyperspectral data dimension reduction sample data set of the soil sample obtained in the step S2 by using a principal component analysis method;
s3.1.1, performing decentralization treatment on the hyperspectral data dimension reduction sample data set obtained in the step S2;
S3.1.2, calculating the cross correlation C of the hyperspectral data dimension reduction sample data set X processed in the step S3.1.1, wherein the calculation is expressed as:
wherein M is the number of samples in the hyperspectral data dimension reduction sample dataset;
s3.1.3, carrying out eigenvalue decomposition on the C obtained in the step S3.1.2 by utilizing a Lagrangian calculation formula, selecting K eigenvalues from large to small, and forming a dimension reduction matrix V by corresponding eigenvectors, wherein the dimension of V is KxN, N is the characteristic dimension, and the calculation expression is as follows:
F(V)=VCV T +K(1-V T V)
wherein F (V) is a characteristic value decomposition result, and T is a transposition;
the calculation expression obtained after derivation is as follows:
CV T =KV T ;
s3.1.4, performing dimension reduction calculation on the hyperspectral data dimension reduction sample data set by using the dimension reduction matrix obtained in the step S3.1.3 to obtain a hyperspectral image data set Y subjected to dimension reduction processing by a principal component analysis method, wherein the calculation expression is as follows:
Y=XV T ;
s3.2, performing dimension reduction processing on the hyperspectral image dataset obtained in the step S3.1 and subjected to dimension reduction processing by using a t-distribution random neighbor embedding method;
s3.2.1. constructing conditional probability distribution result P in high-dimensional space j|i Calculating a joint probability distribution P using conditional probability distribution results ij The computational expression is:
P ij =P j|i +P i|j
fitting the relative position relation of the high-dimensional sample space by using the conditional probability distribution result, wherein the calculation expression is as follows:
Wherein x is i Is the hyperspectral image dataset, x after dimension reduction treatment by the ith principal component analysis method j The data set x of the hyperspectral image after the dimension reduction treatment of the jth principal component analysis method k Is the hyperspectral image dataset and sigma after the dimension reduction treatment of the kth principal component analysis method i The variance of the hyperspectral image data set after the dimension reduction treatment by the principal component analysis method;
setting a desired distribution entropy Per, making log (Per) = Σp j|i log(P j|i ) Searching the optimal entropy Per by a binary search method beta Order-making
P pair P ij Normalization processing is carried out, and the calculation expression is as follows:
s3.2.2. constructing probability distribution Q in low-dimensional space using student-t distribution ij The method is used for fitting the position relation among the low-order sample points, and the calculation expression is as follows:
wherein y is i Is hyperspectral image data, y after dimension reduction treatment by the ith principal component analysis method j Is hyperspectral image data, y after dimension reduction treatment by the j-th principal component analysis method k Hyperspectral image data subjected to dimension reduction processing by kth principal component analysis method,y l The hyperspectral image data after the dimension reduction treatment of the first principal component analysis method;
s3.2.3, learning and adjusting low-dimensional data through an impulse gradient descent method to enable high-dimensional and low-dimensional distribution to be close, namely enabling S to be minimum, wherein a calculation expression is as follows:
Wherein S is a loss value;
the impulse gradient descent method has the following calculation expression:
correction of y by iterative calculation i 、y j Obtaining the hyperspectral image data channel information with reduced dimension.
Further, the specific implementation method of the step S5 includes the following steps:
s5.1, constructing a multiscale space attention mechanism layer A_M_SAM;
s5.1.1, carrying out average pooling and maximum pooling on the input characteristic data in the channel direction to obtain an average pooling characteristic A (c) and a maximum pooling characteristic M (c);
s5.1.2, connecting the A (c) and the M (c) obtained in the step S5.1.1 in the channel direction to obtain a connection characteristic Y (c), wherein the calculation expression is as follows:
Y(c)=Cat(A(c),M(c))
wherein Cat represents a join operation;
s5.1.3, performing 7×7 convolution kernel convolution operation, BN batch normalization calculation and Relu6 activation function calculation on the Y (c) to obtain a convolution characteristic Y (F), wherein the calculation expression is as follows:
Y(F)=Relu6(BN(∫ 7×7 (Y(c))))
wherein ≡ 7×7 A convolution operation representing a 7 x 7 convolution kernel;
s5.1.4. performing sigmoid activation function on Y (F) to obtain attention vector, and distributing the attention vectorTo input characteristic data, output Y A_M_SAM The computational expression is:
Y A_M_SAM =sigmoid(Y(F))×input x
wherein sigmoid represents an activation function operation, input x Representing input feature data;
s5.2, constructing a multi-scale channel attention mechanism layer A_M_SE;
S5.2.1, carrying out global average pooling and global maximum pooling on the input characteristic data to obtain global average pooling characteristic A c (H, W), global max pooling feature M c (H,W);
S5.2.2. A obtained in step S5.2.1 c (H,W)、M c (H, W) respectively performing BN batch normalization calculation and Relu6 activation function calculation, and respectively obtaining calculation expressions as follows:
A c1 =Relu6(BN(A c (H,W)))
M c1 =Relu6(BN(M c (H,W)));
wherein A is c1 For global average pooling feature calculated by BN batch normalization calculation, relu6 activation function calculation, M c1 Global max pooling features calculated for BN batch normalization calculation, relu6 activation functions;
s5.2.3. A obtained in step S5.2.2 c1 、M c1 Performing sigmoid operation of an activation function to obtain attention vectors of addition operation features, distributing the attention vectors of the addition operation features to input feature data, and completing distribution of a multiscale channel attention mechanism layer A_M_SE to obtain a multiscale channel attention mechanism layer feature Y A_M_SE The computational expression is:
Y A_M_SE =sigmoid(A C1 ,M C1 )×input x ;
s5.3, constructing a multi-attention-enhanced expansion feature extraction model At_E_EFEM, wherein the multi-attention-enhanced expansion feature extraction model is composed of a convolution kernel size of 3×3, a multi-scale space attention mechanism layer A_M_SAM branch, 3 cavity convolution branches with expansion rates of 2, 4 and 6 respectively, a multi-scale channel attention mechanism layer A_M_SE branch and two 1×1 convolutions, and the calculation expression of the multi-attention-enhanced expansion feature extraction model is as follows:
X 1 =∫ 1×1 (input x )
Z 1 =A_M_SAM(∫ 3×3 (X 1 ))
X 2 =∫ 1×1 (Cat(Z 1 ,Z 2 ))
Y At_E_EFEM =X 1 +X 2
Wherein ≡ 1×1 For convolution operation with convolution kernel size of 1×1, the method is as follows 3×3 For convolution operations with a convolution kernel size of 3 x 3, a _ M _ SAM is a multiscale spatial attention mechanism operation, a _ M _ SE is a multiscale channel attention mechanism operation, the convolution kernel is convolution with the size of 3 multiplied by 3 and cavity convolution operations of 2, 4 and 6 respectively, and Cat is a splicing operation.
Further, the unilateral inhibition gate control cyclic neural network model in the step S6 consists of a reset gate and an update gate;
the reset gate combines the newly input characteristic information with the previous memory, i.e. using the weight matrix w r Respectively with the previous characteristic information h t-1 New input of characteristic information x t Multiplication with offset matrix b r Adding, and activating by using softplus function to obtain reset gate processing result r t Based on the weight matrix w h Offset matrix b h Calculating hidden states of reset gates using ELU functions
The update gate controls the formerThe state information of the moment is brought to the extent of the current state, i.e. by means of a weight matrix w z Respectively with the previous characteristic information h t-1 And the new input characteristic information is multiplied, and the result is multiplied by an offset matrix b z Adding, and activating by using softplus function to obtain updated gate processing result z t Updating in the hidden state to obtain h t The computational expression is:
r t =softplus(w r (h t-1 ,x t )+b r )
z t =softplus(w z (h t-1 ,x t )+b z )
wherein w is r 、w h 、w z Weight matrix of reset gate, reset gate hidden state, update gate, b r 、b h 、b z Offset matrix, x, of reset gate, reset gate hidden state, update gate, respectively t H is the newly input characteristic information t-1 Is the previous characteristic information.
Further, the specific implementation method of the step S7 includes the following steps:
s7.1, respectively carrying out feature extraction and 4 maximum pooling downsampling operations on the hyperspectral image data subjected to the dimension reduction treatment in the unfrozen period through 5 multi-attention enhanced expansion feature extraction models At_E_EFEM, and inputting the feature extraction results into a single-side inhibition gate control cyclic neural network model S_E_GRU for further feature reset and update;
s7.2, extracting features of a primary freezing period, a freezing period and an open period according to the method of the step S7.1;
s7.3, inputting the result of the S_E_GRU processing in the unfrozen period into the S_E_GRU processing in the primary freezing period, inputting the result of the S_E_GRU processing in the primary freezing period into the S_E_GRU processing in the freezing period, inputting the result of the S_E_GRU processing in the freezing period into the S_E_GRU processing in the open period, and finally outputting the soil nutrient result.
Further, step S8 is to input the model target data set obtained in step S1 and the model input data set obtained in step S4 into the soil nutrient inversion model constructed in step S7 for model training, and to use the determination coefficient R 2 Correction of root mean square errorThe model training precision is evaluated by pearson correlation coefficient r and average absolute error percentage MAPE, wherein RMSE is root mean square error, < >>The soil nutrient content average value is collected.
An electronic device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of a soil nutrient inversion method when executing the computer program.
A computer readable storage medium having stored thereon a computer program which when executed by a processor implements the soil nutrient inversion method.
The invention has the beneficial effects that:
according to the soil nutrient inversion method, a dimension reduction method based on PCA and t-SNE data is designed, dimension reduction of hyperspectral data is achieved, and important spectral information and important information parameters are reserved more effectively; the attention mechanisms of A_M_SAM and A_M_SE are designed, and the attention vector extraction of the space and the position of the feature is respectively carried out, so that the context information of the input parameters can be effectively extracted; an At_E_EFEM feature extraction model algorithm is designed, so that enhancement type perception-enlarging depth-layer feature extraction is realized, and effective information is captured more effectively; the S_E_GRU model algorithm is designed, so that the memory of important multi-phase information and the forgetting of non-important information are realized, and the accuracy and the efficiency of the information acquisition of the algorithm are improved. The method can efficiently and accurately invert the alkaline hydrolysis nitrogen, the effective phosphorus, the quick-acting potassium and the organic matter content of the soil from the hyperspectral and multi-temporal satellite remote sensing image, and provides a certain technical support for the fields of black land protection, grain safety, ecological environmental protection, farm human living environment management and the like.
Drawings
FIG. 1 is a flow chart of a soil nutrient inversion method according to the invention;
FIG. 2 is a schematic diagram of a soil nutrient inversion model according to the present invention;
FIG. 3 is a diagram of a multi-attention enhanced expansion feature extraction model At_E_EFEM architecture in accordance with the present invention;
FIG. 4 is a schematic diagram of a single-sided suppression gate control loop neural network model S_E_GRU according to the present invention;
FIG. 5 is a diagram of a multiscale spatial attention mechanism layer A_M_SAM architecture according to the present invention;
FIG. 6 is a schematic diagram of a scale channel attention mechanism layer A_M_SE according to the present invention;
FIG. 7 is an evaluation chart of the precision of an optimal soil nutrient model, wherein (a) is an alkaline hydrolysis nitrogen evaluation chart, (b) is a quick-acting potassium evaluation chart, (c) is an available phosphorus evaluation chart, and (d) is an organic matter evaluation chart;
fig. 8 shows the optimal soil nutrient inversion result diagram, (a) shows the alkaline hydrolysis nitrogen result diagram, (b) shows the quick-acting potassium result diagram, (c) shows the available phosphorus result diagram, and (d) shows the organic result diagram.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings and detailed description. It should be understood that the embodiments described herein are for purposes of illustration only and are not intended to limit the invention, i.e., the embodiments described are merely some, but not all, of the embodiments of the invention. The components of the embodiments of the present invention generally described and illustrated in the figures herein can be arranged and designed in a wide variety of different configurations, and the present invention can have other embodiments as well.
Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, are intended to fall within the scope of the present invention.
For further understanding of the invention, the following detailed description is to be taken in conjunction with fig. 1-8, in which the following detailed description is given, of the invention:
the first embodiment is as follows:
a soil nutrient inversion method comprising the steps of:
s1, carrying out soil nutrient content assay on a field collected soil sample to obtain soil nutrient sample data which is used as a target data set of a soil nutrient inversion model;
further, in the step S1, target parameters for the soil nutrient inversion model are set, wherein the target parameters comprise alkaline hydrolysis nitrogen content, available phosphorus content, available potassium content and organic matter content of the soil;
furthermore, 863 soil nutrient sample points are distributed according to the soil type and the crop type of a certain farm in northeast, and the sample collection time is 2022, 10 months and 2 days. According to the specification of the third national soil general investigation field investigation and sampling technical regulations, an S-shaped or quincuncial 5-point sampling method is adopted for sampling depth of 0-25cm, a quartering method is adopted for removing redundant soil after the samples are uniformly mixed, 1kg of samples are reserved, the center position of each sampling point is positioned by GNSS to obtain accurate longitude, latitude and elevation information, and the accurate longitude, latitude and elevation information is sent to a professional soil monitoring mechanism to obtain soil alkaline hydrolysis nitrogen, effective phosphorus, quick-acting potassium and organic matter content actual measurement sample data according to the standards of the soil organic matter measurement-NY/T1121.6-2006, the soil effective phosphorus measurement-NY/T1121.7-2014, the soil quick-acting potassium and potassium relief content measurement-NY/T889-2004 and the forest soil nitrogen measurement-LY/T1228-2015, and the soil alkaline hydrolysis nitrogen, effective phosphorus, quick-acting potassium and organic matter content actual measurement sample data are used as target parameters for model construction;
S2, collecting corresponding hyperspectral image spectrum information from the soil nutrient sample data collected in the step S1 by using geographic information software, and performing data arrangement to obtain a hyperspectral data dimension reduction sample data set;
further, the specific implementation method of the step S2 includes the following steps:
s2.1, performing point spreading on the collected soil nutrient sample data by utilizing the point spreading function of ArcGIS10.1 to obtain soil nutrient sample point position data;
further, obtaining 2022, 10 and 2 day non-frozen period, 2022, 10 and 30 day initial frozen period, 2022, 11 and 20 day frozen period and 2023, 4 and 10 day open chemical 4 stage ZY1E/ZY1F hyperspectral image data respectively, wherein the image covers 180 channel information;
s2.2, performing radiation calibration, atmospheric correction, RPC orthographic correction and geometric fine correction pretreatment on the obtained hyperspectral image data by using ENVI5.6.3, combining point location data of soil nutrient samples, and integrating the preprocessed hyperspectral image data with the soil nutrient sample data by using the function of multi-value extraction to points in ArcGIS10.1 to obtain a tidied sample data set;
s2.3, sorting the tidied data set according to the collected soil nutrient content values from small to large, equally dividing 10 grades according to the maximum value and the minimum value of the collected soil nutrient content values, and respectively marking the grades as 0 to 9 to obtain a hyperspectral data dimension-reduction sample data set;
S3, performing data dimension reduction processing on the hyperspectral data dimension reduction sample data set obtained in the step S2 to obtain hyperspectral image data channel information;
further, the specific implementation method of the step S3 includes the following steps:
s3.1, performing dimension reduction analysis on the hyperspectral data dimension reduction sample data set obtained in the step S2 by using a principal component analysis method;
s3.1.1, performing decentralization treatment on the hyperspectral image dataset of the soil sample obtained in the step S2;
further, the input hyperspectral data dimension reduction sample data is subjected to decentration treatment, namely the matrix mean value (1×180) is subtracted from the input X (863×180) data set;
s3.1.2, calculating the cross correlation C of the hyperspectral data dimension reduction sample data set X processed in the step S3.1.1, wherein the calculation is expressed as:
wherein M is the number of samples in the hyperspectral image dataset of the soil sample;
s3.1.3, carrying out eigenvalue decomposition on the C obtained in the step S3.1.2 by utilizing a Lagrangian calculation formula, selecting K eigenvalues from large to small, and forming a dimension reduction matrix V by corresponding eigenvectors, wherein the dimension of V is KxN, N is the characteristic dimension, and the calculation expression is as follows:
F(V)=VCV T +K(1-V T V)
wherein F (V) is a characteristic value decomposition result, and T is a transposition;
The calculation expression obtained after derivation is as follows:
CV T =KV T ;
s3.1.4, performing dimension reduction calculation on the hyperspectral data dimension reduction sample data set by using the dimension reduction matrix obtained in the step S3.1.3 to obtain a hyperspectral image data set Y subjected to dimension reduction processing by a principal component analysis method, wherein the calculation expression is as follows:
Y=XV T ;
s3.2, performing dimension reduction processing on the hyperspectral image dataset obtained in the step S3.1 and subjected to dimension reduction processing by using a t-distribution random neighbor embedding method;
s3.2.1. constructing conditional probability distribution result P in high-dimensional space j|i Calculating a joint probability distribution P using conditional probability distribution results ij The computational expression is:
P ij =P j|i +P i|j
fitting the relative position relation of the high-dimensional sample space by using the conditional probability distribution result, wherein the calculation expression is as follows:
wherein x is i Is the hyperspectral image dataset, x after dimension reduction treatment by the ith principal component analysis method j The data set x of the hyperspectral image after the dimension reduction treatment of the jth principal component analysis method k Is the hyperspectral image dataset and sigma after the dimension reduction treatment of the kth principal component analysis method i The variance of the hyperspectral image data set after the dimension reduction treatment by the principal component analysis method;
setting a desired distribution entropy Per, making log (Per) = Σp j|i log(P j|i ) Searching the optimal entropy Per by a binary search method beta Order-making
P pair P ij Normalization processing is carried out, and the calculation expression is as follows:
s3.2.2. constructing probability distribution Q in low-dimensional space using student-t distribution ij The method is used for fitting the position relation among the low-order sample points, and the calculation expression is as follows:
wherein y is i Is hyperspectral image data, y after dimension reduction treatment by the ith principal component analysis method j Is hyperspectral image data, y after dimension reduction treatment by the j-th principal component analysis method k Is hyperspectral image data, y after dimension reduction treatment by kth principal component analysis method l The hyperspectral image data after the dimension reduction treatment of the first principal component analysis method;
s3.2.3, learning and adjusting low-dimensional data through an impulse gradient descent method to enable high-dimensional and low-dimensional distribution to be close, namely enabling S to be minimum, wherein a calculation expression is as follows:
wherein S is a loss value;
the impulse gradient descent method has the following calculation expression:
correction of y by iterative calculation i 、y j Obtaining the hyperspectral image data channel information of the dimension reduction;
further, the number of the final dimension-reduced channels is 32;
s4, carrying out data dimension increasing processing on the dimension-reduced hyperspectral image data channel information, the elevation, the gradient, the slope direction, the soil type and the meteorological information obtained in the step S3 to obtain an input data set for a soil nutrient inversion model;
Further, using 32 channels of information after the hyperspectral image is subjected to dimension reduction, taking each channel as a column of a two-dimensional matrix, and finishing to finally form a 32×32 two-dimensional matrix; respectively arranging the elevation, gradient, slope direction, soil type and meteorological information of a sample into a 32×32 two-dimensional matrix, and generating a four-dimensional data model input parameter data set (1×32×32×6) by using a dimension lifting technology:
s5, constructing a multi-attention-enhanced expansion feature extraction model At_E_EFEM;
further, the specific implementation method of the step S5 includes the following steps:
s5.1, constructing a multiscale space attention mechanism layer A_M_SAM;
s5.1.1, carrying out average pooling and maximum pooling on the input characteristic data in the channel direction to obtain an average pooling characteristic A (c) and a maximum pooling characteristic M (c);
s5.1.2, connecting the A (c) and the M (c) obtained in the step S5.1.1 in the channel direction to obtain a connection characteristic Y (c), wherein the calculation expression is as follows:
Y(c)=Cat(A(c),M(c))
wherein Cat represents a join operation;
s5.1.3, performing convolution operation of 7×7 convolution kernels on the Y (c), performing BN batch normalization calculation, and performing Relu6 activation function calculation to obtain a convolution characteristic Y (F), wherein the calculation expression is as follows:
Y(F)=Relu6(BN(∫ 7×7 (Y(C))))
wherein ≡ 7×7 A convolution operation representing a 7 x 7 convolution kernel;
s5.1.4. performing sigmoid activation function on Y (F) to obtain attention vector, distributing the attention vector to input characteristic data, and outputting Y A_M_SAM The computational expression is:
Y A_M_SAM =sigmoid(Y(F))×input x
wherein sigmoid represents an activation function operation, input x Representing input feature data;
s5.2, constructing a multi-scale channel attention mechanism layer A_M_SE;
s5.2.1, carrying out global average pooling and global maximum pooling on the input characteristic data to obtain global average pooling characteristic A c (H, W), global max pooling feature M c (H,W);
S5.2.2. A obtained in step S5.2.1 c (H,W)、M c (H, W) respectively performing BN batch normalization calculation and Relu6 activation function calculation, and respectively obtaining calculation expressions as follows:
A c1 =Relu6(BN(A c (H,W)))
M c1 =Relu6(BN(M c (H,W)));
wherein A is c1 For global average pooling feature calculated by BN batch normalization calculation, relu6 activation function calculation, M c1 Global max pooling features calculated for BN batch normalization calculation, relu6 activation functions;
s5.2.3. A obtained in step S5.2.2 c1 、M c1 Performing sigmoid operation of the activation function to obtain attention vectors of addition operation features, distributing the attention vectors of the addition operation features to input feature data, and completing distribution of a multi-scale channel attention mechanism layer A_M_SE to obtain a multi-scale channelAttention mechanism layer feature Y A_M_SE The computational expression is:
Y A_M_SE =sigmoid(A C1 ,M C1 )×input x ;
s5.3, constructing a multi-attention-enhanced expansion feature extraction model At_E_EFEM, wherein the multi-attention-enhanced expansion feature extraction model is composed of a convolution kernel size of 3×3, a multi-scale space attention mechanism layer A_M_SAM branch, 3 cavity convolution branches with expansion rates of 2, 4 and 6 respectively, a multi-scale channel attention mechanism layer A_M_SE branch and two 1×1 convolutions, and the calculation expression of the multi-attention-enhanced expansion feature extraction model is as follows:
X 1 =∫ 1×1 (input x )
Z 1 =A_M_SAM(∫ 3×3 (X 1 ))
X 2 =∫ 1×1 (Cat(Z 1 ,Z 2 ))
Y At_E_EFEM =X 1 +X 2
Wherein ≡ 1×1 For convolution operation with convolution kernel size of 1×1, the method is as follows 3×3 For convolution operations with a convolution kernel size of 3 x 3, a _ M _ SAM is a multiscale spatial attention mechanism operation, a _ M _ SE is a multiscale channel attention mechanism operation, the convolution kernel is convolution with the size of 3 multiplied by 3 and cavity convolution operations of 2, 4 and 6, and Cat is splicing operation;
further, the at_e_efem performs channel information integration on the input feature map by using a 1×1 convolution, and then performs multi-scale feature extraction by connecting the multi-scale spatial attention mechanism layer a_m_sam, the multi-scale channel attention mechanism layer a_m_se and hole convolutions with expansion rates of 2, 4 and 6 by using 3×3 convolutions, respectively. In consideration of different importance of feature weights extracted by different branches, the method designs a multi-scale feature obtained by sharing weight information extracted by the multi-scale channel attention mechanism layer A_M_SE, namely multiplying the weight information by multi-scale features extracted by cavity convolution, and obtaining the multi-scale feature of the multi-scale channel attention mechanism layer A_M_SE after enhancement. And then, splicing the characteristics extracted by the branches of the convolution kernel with the size of 3 multiplied by 3 and the multiscale space attention mechanism layer A_M_SAM with the enhanced multiscale characteristics, and carrying out characteristic fusion on the spliced result by using 1 multiplied by 1 convolution. Finally, the output of the former 1 x 1 convolution is summed with the output of the latter 1 x 1 convolution as an identity map to improve network training and network characterization capability.
S6, constructing a single-side inhibition gate control cyclic neural network model S_E_GRU;
further, the unilateral inhibition gate control cyclic neural network model in the step S6 consists of a reset gate and an update gate;
the reset gate combines the newly input characteristic information with the previous memory, i.e. using the weight matrix w r Respectively with the previous characteristic information h t-1 New input of characteristic information x t Multiplication with offset matrix b r Adding, and activating by using softplus function to obtain reset gate processing result r t Based on the weight matrix w h Offset matrix b h Calculating hidden states of reset gates using ELU functions
The update gate controls the degree to which the state information of the previous time is brought to the current state, i.e. by using the weight matrix w z Respectively with the previous characteristic information h t-1 And the new input characteristic information is multiplied, and the result is multiplied by an offset matrix b z Adding, and activating by using softplus function to obtain updated gate processing result z t Updating in the hidden state to obtain h t The computational expression is:
r t =softplus(w r (h t-1 ,x t )+b r )
z t =softplus(w z (h t-1 ,x t )+b z )
wherein w is r 、w h 、w z Weight matrix of reset gate, reset gate hidden state, update gate, b r 、b h 、b z Offset matrix, x, of reset gate, reset gate hidden state, update gate, respectively t H is the newly input characteristic information t-1 Is the former characteristic information;
s7, constructing a soil nutrient inversion model based on the multi-attention enhanced expansion characteristic extraction model constructed in the step S5 and the unilateral inhibition gate control cyclic neural network model constructed in the step S6;
further, the specific implementation method of the step S7 includes the following steps:
s7.1, respectively carrying out feature extraction and 4 maximum pooling downsampling operations on the hyperspectral image data subjected to the dimension reduction treatment in the unfrozen period through 5 multi-attention enhanced expansion feature extraction models At_E_EFEM, and inputting the feature extraction results into a single-side inhibition gate control cyclic neural network model S_E_GRU for further feature reset and update;
s7.2, extracting features of a primary freezing period, a freezing period and an open period according to the method of the step S7.1;
s7.3, inputting the result of S_E_GRU processing in the unfrozen period into S_E_GRU processing in the primary freezing period, inputting the result of S_E_GRU processing in the primary freezing period into S_E_GRU processing in the freezing period, inputting the result of S_E_GRU processing in the freezing period into S_E_GRU processing in the open period, and finally outputting soil nutrient results;
s8, inputting the model target data set obtained in the step S1 and the model input data set obtained in the step S4 into a soil nutrient inversion model constructed in the step S7 for model training, and optimizing the soil nutrient inversion model;
Further, step S8 is to input the model target data set obtained in step S1 and the model input data set obtained in step S4 into the soil nutrient inversion model constructed in step S7 for model training, and to use the determination coefficient R 2 Correction of root mean square errorThe model training precision is evaluated by pearson correlation coefficient r and average absolute error percentage MAPE, wherein RMSE is root mean square error, < >>The method comprises the steps of collecting an average value of soil nutrient content;
further, the specific implementation method of step S8 is as follows:
for efficient and accurate evaluation of the generalization performance of the Mt_DGURNet model, a decision coefficient (R 2 ) Evaluating model fitting goodness, R 2 The closer to 1, the better the fitting degree of the model predicted value and the true value is; selecting correction root mean square errorWherein RMSE is root mean square error, </u >>To collect the average value of the nutrient content of the soil) to measure the deviation between the predicted value and the true value,/for the soil>The smaller the instruction prediction is, the closer the prediction is to the true value; the pearson correlation coefficient (r) is selected to evaluate the correlation between the predicted result and the true value, and the larger the r value is, the more accurate the predicted value is; the average absolute error percentage (MAPE) is selected to measure the prediction accuracy of the model, and the lower the MAPE is, the more accurate the prediction accuracy is, and the calculation expression is:
Wherein: i is the ith sample data, y i For the ith measured sample data, f (x i ) For the i-th prediction data,for the average value of the measured sample data, m is the total number of samples, < >>Standard deviation of measured sample data, +.>Standard deviation of the predicted data;
s9, predicting the soil nutrients of the target area by using the soil nutrient inversion model optimized in the step S8.
For the convenience of understanding the technical effects of the present invention, the comparison effects of the method and the prior art using the embodiments of the present invention are as follows:
table 1 technical effect comparison table
As can be seen from Table 1, compared with other disclosed methods, the method provided by the invention has improved model accuracy, wherein the determination coefficient (R 2 ) Up to 0.97, correct root mean square errorThe pearson correlation coefficient (r) reaches 0.98, and the maximum value of the average absolute error percentage (MAPE) only reaches 12.96%; determining coefficient (R) 2 ) Up to 0.96 and correct root mean square errorThe pearson correlation coefficient (r) reaches 0.97, and the maximum value of the average absolute error percentage (MAPE) reaches only 6.02%; determination coefficient (R) of evaluation index of alkaline hydrolysis nitrogen 2 ) Up to 0.97, correct root mean square errorThe pearson correlation coefficient (r) reaches 0.97, and the maximum value of the average absolute error percentage (MAPE) only reaches 7.06%; determination coefficient (R) of effective phosphorus evaluation index 2 ) Reaching 0.92, corrected root mean square error +.>The pearson correlation coefficient (r) reaches 0.07, and the maximum value of the mean absolute error percentage (MAPE) reaches only 37.72%.
To sum up: the invention fully utilizes PCA and t-SNE to carry out dimension reduction on hyperspectral data, and more effectively reserves important spectral information and important information parameters; the position extraction in the space and position directions is effectively performed by utilizing the attention mechanisms of A_M_SAM and A_M_SE; the At_E_EFEM is utilized to expand the feature extraction of the depth layer of the perceived visual field, so that effective information is captured more effectively; and the SE_GRU is utilized to obtain the memory of important multi-time information, so that non-important information is sufficiently ignored, and the accuracy and efficiency of information acquisition of an algorithm are improved. The problems that hyperspectral image data is large in spectral information redundancy, insufficient in feature extraction, less in receptive field during feature extraction, important information memory disappears and non-important information redundancy interferes in a multi-temporal image fusion process, excitation boundaries are too narrow, noise robustness is too low, soil nutrient inversion efficiency, stability and precision are low, and large-area application is difficult in the field of precise agriculture are solved.
The second embodiment is as follows:
an electronic device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of the soil nutrient inversion method of embodiment one when executing the computer program.
The computer device of the present invention may be a device including a processor and a memory, such as a single chip microcomputer including a central processing unit. And the processor is used for executing the computer program stored in the memory to realize the steps of the soil nutrient inversion method.
The processor may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
And a third specific embodiment:
a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the soil nutrient inversion method.
The computer readable storage medium of the present invention may be any form of storage medium readable by a processor of a computer device, including but not limited to, nonvolatile memory, volatile memory, ferroelectric memory, etc., having a computer program stored thereon, which when read and executed by the processor of the computer device, implements the steps of a soil nutrient inversion method as described above.
The computer program comprises computer program code which may be in source code form, object code form, executable file or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
It is noted that relational terms such as "first" and "second", and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Although the present application has been described hereinabove with reference to specific embodiments, various modifications thereof may be made and equivalents may be substituted for elements thereof without departing from the scope of the application. In particular, the features of the embodiments disclosed in this application may be combined with each other in any way as long as there is no structural conflict, and the exhaustive description of these combinations is not given in this specification merely for the sake of omitting the sake of brevity and saving resources. Therefore, it is intended that the present application not be limited to the particular embodiments disclosed, but that the present application include all embodiments falling within the scope of the appended claims.
Claims (10)
1. The soil nutrient inversion method is characterized by comprising the following steps of:
s1, carrying out soil nutrient content assay on a field collected soil sample to obtain soil nutrient sample data which is used as a target data set of a soil nutrient inversion model;
s2, collecting corresponding hyperspectral image spectrum information from the soil nutrient sample data collected in the step S1 by using geographic information software, and performing data arrangement to obtain a hyperspectral data dimension reduction sample data set;
s3, performing data dimension reduction processing on the hyperspectral data dimension reduction sample data set obtained in the step S2 to obtain dimension reduction hyperspectral image data channel information;
s4, carrying out data dimension increasing processing on the dimension-reduced hyperspectral image data channel information, the elevation, the gradient, the slope direction, the soil type and the meteorological information obtained in the step S3 to obtain an input data set for a soil nutrient inversion model;
s5, constructing a multi-attention-enhanced expansion feature extraction model At_E_EFEM;
s6, constructing a single-side inhibition gate control cyclic neural network model S_E_GRU;
s7, constructing a soil nutrient inversion model based on the multi-attention enhanced expansion characteristic extraction model constructed in the step S5 and the unilateral inhibition gate control cyclic neural network model constructed in the step S6;
S8, inputting the model target data set obtained in the step S1 and the model input data set obtained in the step S4 into the soil nutrient inversion model constructed in the step S7 for model training to obtain an optimal soil nutrient inversion model;
s9, predicting the soil nutrients of the target area by using the optimal soil nutrient inversion model obtained in the step S8.
2. The soil nutrient inversion method according to claim 1, wherein the target data set for the soil nutrient inversion model set in step S1 includes alkaline hydrolysis nitrogen content, available phosphorus content, available potassium content, organic matter content of the soil.
3. The soil nutrient inversion method according to claim 2, wherein the specific implementation method of step S2 comprises the following steps:
s2.1, performing point spreading on the collected soil nutrient sample data by utilizing the point spreading function of ArcGIS10.1 to obtain soil nutrient sample point position data;
s2.2, performing radiation calibration, atmospheric correction, RPC orthographic correction and geometric fine correction pretreatment on the obtained hyperspectral image data by using ENVI5.6.3, combining point location data of soil nutrient samples, and integrating the preprocessed hyperspectral image data with the soil nutrient sample data by using the function of multi-value extraction to points in ArcGIS10.1 to obtain a tidied sample data set;
S2.3, sorting the tidied data set according to the collected soil nutrient content values from small to large, equally dividing 10 grades according to the maximum value and the minimum value of the collected soil nutrient content values, and respectively marking the grades as 0 to 9 to obtain a hyperspectral data dimension-reduction sample data set.
4. A soil nutrient inversion method as claimed in claim 3, wherein the specific implementation method of step S3 comprises the steps of:
s3.1, performing dimension reduction analysis on the hyperspectral data dimension reduction sample data set of the soil sample obtained in the step S2 by using a principal component analysis method;
s3.1.1, performing decentralization treatment on the hyperspectral data dimension reduction sample data set obtained in the step S2;
s3.1.2, calculating the cross correlation C of the hyperspectral data dimension reduction sample data set X processed in the step S3.1.1, wherein the calculation is expressed as:
wherein M is the number of samples in the hyperspectral data dimension reduction sample dataset;
s3.1.3, carrying out eigenvalue decomposition on the C obtained in the step S3.1.2 by utilizing a Lagrangian calculation formula, selecting K eigenvalues from large to small, and forming a dimension reduction matrix V by corresponding eigenvectors, wherein the dimension of V is KxN, N is the characteristic dimension, and the calculation expression is as follows:
F(V)=VCV T +K(1-V T V)
wherein F (V) is a characteristic value decomposition result, and T is a transposition;
The calculation expression obtained after derivation is as follows:
CV T =KV T ;
s3.1.4, performing dimension reduction calculation on the hyperspectral data dimension reduction sample data set by using the dimension reduction matrix obtained in the step S3.1.3 to obtain a hyperspectral image data set Y subjected to dimension reduction processing by a principal component analysis method, wherein the calculation expression is as follows:
Y=XV T ;
s3.2, performing dimension reduction processing on the hyperspectral image dataset obtained in the step S3.1 and subjected to dimension reduction processing by using a t-distribution random neighbor embedding method;
s3.2.1. constructing conditional probability distribution result P in high-dimensional space j|i Calculating a joint probability distribution P using conditional probability distribution results ij The computational expression is:
P ij =P j|i +P i|j
fitting the relative position relation of the high-dimensional sample space by using the conditional probability distribution result, wherein the calculation expression is as follows:
wherein x is i Is the hyperspectral image dataset, x after dimension reduction treatment by the ith principal component analysis method j The data set x of the hyperspectral image after the dimension reduction treatment of the jth principal component analysis method k Is the hyperspectral image dataset and sigma after the dimension reduction treatment of the kth principal component analysis method i The variance of the hyperspectral image data set after the dimension reduction treatment by the principal component analysis method;
setting a desired distribution entropy Per, making log (Per) = Σp j|i log(P j|i ) Searching the optimal entropy Per by a binary search method beta Order-making
P pair P ij Normalization processing is carried out, and the calculation expression is as follows:
s3.2.2. constructing probability distribution Q in low-dimensional space using student-t distribution ij The method is used for fitting the position relation among the low-order sample points, and the calculation expression is as follows:
wherein y is i Is hyperspectral image data, y after dimension reduction treatment by the ith principal component analysis method j Is hyperspectral image data, y after dimension reduction treatment by the j-th principal component analysis method k Is hyperspectral image data, y after dimension reduction treatment by kth principal component analysis method l The hyperspectral image data after the dimension reduction treatment of the first principal component analysis method;
s3.2.3, learning and adjusting low-dimensional data through an impulse gradient descent method to enable high-dimensional and low-dimensional distribution to be close, namely enabling S to be minimum, wherein a calculation expression is as follows:
wherein S is a loss value;
the impulse gradient descent method has the following calculation expression:
correction of y by iterative calculation i 、y j Obtaining the hyperspectral image data channel information with reduced dimension.
5. The soil nutrient inversion method as claimed in claim 4, wherein the specific implementation method of step S5 comprises the following steps:
s5.1, constructing a multiscale space attention mechanism layer A_M_SAM;
s5.1.1, carrying out average pooling and maximum pooling on the input characteristic data in the channel direction to obtain an average pooling characteristic A (c) and a maximum pooling characteristic M (c);
S5.1.2, connecting the A (c) and the M (c) obtained in the step S5.1.1 in the channel direction to obtain a connection characteristic Y (c), wherein the calculation expression is as follows:
Y(c)=Cat(A(c),M(c))
wherein Cat represents a join operation;
s5.1.3, performing 7×7 convolution kernel convolution operation, BN batch normalization calculation and Relu6 activation function calculation on the Y (c) to obtain a convolution characteristic Y (F), wherein the calculation expression is as follows:
Y(F)=Relu6(BN(∫ 7×7 (Y(C))))
wherein ≡ 7×7 A convolution operation representing a 7 x 7 convolution kernel;
s5.1.4. performing sigmoid activation function on Y (F) to obtain attention vector, distributing the attention vector to input characteristic data, and outputting Y A_M_SAM The computational expression is:
Y A_M_SAM =sigmoid(Y(F))×input x
wherein sigmoid represents an activation function operation, input x Representing input feature data;
s5.2, constructing a multi-scale channel attention mechanism layer A_M_SE;
s5.2.1, carrying out global average pooling and global maximum pooling on the input characteristic data to obtain global average pooling characteristic A c (H, W), global max pooling feature M c (H,W);
S5.2.2. A obtained in step S5.2.1 c (H,W)、M c (H, W) respectively performing BN batch normalization calculation and Relu6 activation function calculation, and respectively obtaining calculation expressions as follows:
A c1 =Relu6(BN(A c (H,W)))
M c1 =Relu6(BN(M c (H,W)));
wherein A is c1 For global average pooling feature calculated by BN batch normalization calculation, relu6 activation function calculation, M c1 Global max pooling features calculated for BN batch normalization calculation, relu6 activation functions;
S5.2.3. A obtained in step S5.2.2 c1 、M c1 Performing sigmoid operation of an activation function to obtain feature attention vectors, distributing the feature attention vectors to input feature data, and completing the distribution of a multi-scale channel attention mechanism layer A_M_SE to obtain a multi-scale channel attention mechanism layer feature Y A_M_SE The expression is calculated as:
Y A_M_SE =sigmoid(A C1 ,M C1 )×input x ;
S5.3, constructing a multi-attention-enhanced expansion feature extraction model At_E_EFEM, wherein the multi-attention-enhanced expansion feature extraction model is composed of a convolution kernel size of 3×3, a multi-scale space attention mechanism layer A_M_SAM branch, 3 cavity convolution branches with expansion rates of 2, 4 and 6 respectively, a multi-scale channel attention mechanism layer A_M_SE branch and two 1×1 convolutions, and the calculation expression of the multi-attention-enhanced expansion feature extraction model is as follows:
X 1 =∫ 1×1 (input x )
Z 1 =A_M_SAM(∫ 3×3 (X 1 ))
X 2 =∫ 1×1 (Cat(Z 1 ,Z 2 ))
Y At_E_EFEM =X 1 +X 2
wherein ≡ 1×1 For convolution operation with convolution kernel size of 1×1, the method is as follows 3×3 For convolution operations with a convolution kernel size of 3 x 3, a _ M _ SAM is a multiscale spatial attention mechanism operation, a _ M _ SE is a multiscale channel attention mechanism operation, the convolution kernel is convolution with the size of 3 multiplied by 3 and cavity convolution operations of 2, 4 and 6 respectively, and Cat is a splicing operation.
6. The soil nutrient inversion method of claim 5, wherein the unilateral inhibition gate control cyclic neural network model of step S6 is comprised of a reset gate and an update gate;
Reset gate is a special inputThe sign information is combined with the previous memory, i.e. using a weight matrix w r Respectively with the previous characteristic information h t-1 New input of characteristic information x t Multiplication with offset matrix b r Adding, and activating by using softplus function to obtain reset gate processing result r t Based on the weight matrix w h Offset matrix b h Calculating hidden states of reset gates using ELU functions
The update gate controls the degree to which the state information of the previous time is brought to the current state, i.e. by using the weight matrix w z Respectively with the previous characteristic information h t-1 And the new input characteristic information is multiplied, and the result is multiplied by an offset matrix b z Adding, and activating by using softplus function to obtain updated gate processing result z t Updating in the hidden state to obtain h t The computational expression is:
r t =softplus(w r (h t-1 ,x t )+b r )
z t =softplus(w z (h t-1 ,x t )+b z )
wherein w is r 、w h 、w z Weight matrix of reset gate, reset gate hidden state, update gate, b r 、b h 、b z Offset matrix, x, of reset gate, reset gate hidden state, update gate, respectively t H is the newly input characteristic information t-1 Is the previous characteristic information.
7. The soil nutrient inversion method as claimed in claim 6, wherein the specific implementation method of step S7 comprises the following steps:
S7.1, respectively carrying out feature extraction and 4 maximum pooling downsampling operations on the hyperspectral image data subjected to the dimension reduction treatment in the unfrozen period through 5 multi-attention enhanced expansion feature extraction models At_E_EFEM, and inputting the feature extraction results into a single-side inhibition gate control cyclic neural network model S_E_GRU for further feature reset and update;
s7.2, extracting features of a primary freezing period, a freezing period and an open period according to the method of the step S7.1;
s7.3, inputting the result of the S_E_GRU processing in the unfrozen period into the S_E_GRU processing in the primary freezing period, inputting the result of the S_E_GRU processing in the primary freezing period into the S_E_GRU processing in the freezing period, inputting the result of the S_E_GRU processing in the freezing period into the S_E_GRU processing in the open period, and finally outputting the soil nutrient result.
8. The method for inverting soil nutrients according to claim 7, wherein step S8 inputs the model target dataset obtained in step S1 and the model input dataset obtained in step S4 into the soil nutrient inversion model constructed in step S7 for model training, and uses the determination coefficient R 2 Correction of root mean square errorThe model training precision is evaluated by pearson correlation coefficient r and average absolute error percentage MAPE, wherein RMSE is root mean square error, < > >The soil nutrient content average value is collected.
9. An electronic device comprising a memory and a processor, the memory storing a computer program, the processor implementing the steps of a soil nutrient inversion method as claimed in any one of claims 1 to 8 when the computer program is executed.
10. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a soil nutrient inversion method as claimed in any one of claims 1 to 8.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311691300.4A CN117688835B (en) | 2023-12-11 | 2023-12-11 | Soil nutrient inversion method, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311691300.4A CN117688835B (en) | 2023-12-11 | 2023-12-11 | Soil nutrient inversion method, electronic equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN117688835A true CN117688835A (en) | 2024-03-12 |
| CN117688835B CN117688835B (en) | 2024-06-04 |
Family
ID=90129594
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311691300.4A Active CN117688835B (en) | 2023-12-11 | 2023-12-11 | Soil nutrient inversion method, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117688835B (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118655099A (en) * | 2024-08-19 | 2024-09-17 | 陕西省环境监测中心站 | A water quality parameter classification inversion method and system based on multidimensional hyperspectral images |
| CN119178738A (en) * | 2024-11-22 | 2024-12-24 | 北京观微科技有限公司 | Soil nutrient evaluation method, device, electronic equipment and storage medium |
| CN120808194A (en) * | 2025-09-10 | 2025-10-17 | 大连亚农农业科技有限公司 | Fertilizer proportioning management method and system combined with remote sensing data analysis |
Citations (20)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100303371A1 (en) * | 2009-05-29 | 2010-12-02 | Raytheon Company | System and Method For Reducing Dimensionality Of Hyperspectral Images |
| WO2017053273A1 (en) * | 2014-09-12 | 2017-03-30 | The Climate Corporation | Estimating intra-field properties within a field using hyperspectral remote sensing |
| RU2695963C1 (en) * | 2018-11-28 | 2019-07-29 | Владислав Анатольевич Третьяков | Method of recognizing images of biochemical ground objects with fine spectral differences based on hyperspectral data |
| CN110376138A (en) * | 2019-08-05 | 2019-10-25 | 北京绿土科技有限公司 | Land quality monitoring method based on Airborne Hyperspectral |
| US20200005455A1 (en) * | 2017-03-09 | 2020-01-02 | Northwestern University | Hyperspectral imaging sensor |
| CN111368691A (en) * | 2020-02-28 | 2020-07-03 | 西南电子技术研究所(中国电子科技集团公司第十研究所) | A method for extracting spatial spectral features of unsupervised hyperspectral remote sensing images |
| CN112016392A (en) * | 2020-07-17 | 2020-12-01 | 浙江理工大学 | A small sample detection method based on hyperspectral image for soybean pest degree |
| CN113159446A (en) * | 2021-05-11 | 2021-07-23 | 南京农业大学 | Neural network-based soil nutrient and fruit quality relation prediction method |
| CN113420875A (en) * | 2021-06-22 | 2021-09-21 | 哈尔滨航天恒星数据系统科技有限公司 | Convolutional neural network soil available phosphorus analysis model construction system and method |
| WO2021226976A1 (en) * | 2020-05-15 | 2021-11-18 | 安徽中科智能感知产业技术研究院有限责任公司 | Soil available nutrient inversion method based on deep neural network |
| CN113670830A (en) * | 2021-08-22 | 2021-11-19 | 杭州领见数字农业科技有限公司 | A method and device for soil nutrient measurement based on machine learning |
| CN114282702A (en) * | 2021-11-12 | 2022-04-05 | 合肥工业大学 | Soil conditioning time series prediction method and system based on IGA-BP neural network |
| CN114357891A (en) * | 2022-01-11 | 2022-04-15 | 中国冶金地质总局矿产资源研究院 | Hyperspectral remote sensing quantitative inversion method for soil cadmium element content |
| CN114511170A (en) * | 2021-09-13 | 2022-05-17 | 杭州领见数字农业科技有限公司 | Soil nutrient estimation method and device based on multispectral image |
| CN115235997A (en) * | 2022-07-04 | 2022-10-25 | 南通智能感知研究院 | Soil texture inversion method based on satellite hyperspectral image |
| US20230114877A1 (en) * | 2020-06-29 | 2023-04-13 | Southwest Electronics Technology Research Institute ( China Electronics Technology Group Corporation | Unsupervised Latent Low-Rank Projection Learning Method for Feature Extraction of Hyperspectral Images |
| CN116046692A (en) * | 2023-03-23 | 2023-05-02 | 航天宏图信息技术股份有限公司 | Soil heavy metal pollution monitoring method and device based on hyperspectrum |
| CN116580318A (en) * | 2023-05-11 | 2023-08-11 | 中山大学 | Soil nutrient inversion method, device, equipment and medium for crop coverage area |
| CN116858785A (en) * | 2023-06-26 | 2023-10-10 | 广东省科学院广州地理研究所 | Soil nickel concentration inversion method, device, storage medium and computer equipment |
| CN117113189A (en) * | 2023-08-30 | 2023-11-24 | 哈尔滨航天恒星数据系统科技有限公司 | A comprehensive evaluation method for land classification, electronic equipment and storage media |
-
2023
- 2023-12-11 CN CN202311691300.4A patent/CN117688835B/en active Active
Patent Citations (22)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100303371A1 (en) * | 2009-05-29 | 2010-12-02 | Raytheon Company | System and Method For Reducing Dimensionality Of Hyperspectral Images |
| WO2017053273A1 (en) * | 2014-09-12 | 2017-03-30 | The Climate Corporation | Estimating intra-field properties within a field using hyperspectral remote sensing |
| CA2999865A1 (en) * | 2014-09-12 | 2017-03-30 | The Climate Corporation | Estimating intra-field properties within a field using hyperspectral remote sensing |
| US20170090068A1 (en) * | 2014-09-12 | 2017-03-30 | The Climate Corporation | Estimating soil properties within a field using hyperspectral remote sensing |
| US20200005455A1 (en) * | 2017-03-09 | 2020-01-02 | Northwestern University | Hyperspectral imaging sensor |
| RU2695963C1 (en) * | 2018-11-28 | 2019-07-29 | Владислав Анатольевич Третьяков | Method of recognizing images of biochemical ground objects with fine spectral differences based on hyperspectral data |
| CN110376138A (en) * | 2019-08-05 | 2019-10-25 | 北京绿土科技有限公司 | Land quality monitoring method based on Airborne Hyperspectral |
| CN111368691A (en) * | 2020-02-28 | 2020-07-03 | 西南电子技术研究所(中国电子科技集团公司第十研究所) | A method for extracting spatial spectral features of unsupervised hyperspectral remote sensing images |
| WO2021226976A1 (en) * | 2020-05-15 | 2021-11-18 | 安徽中科智能感知产业技术研究院有限责任公司 | Soil available nutrient inversion method based on deep neural network |
| US20230114877A1 (en) * | 2020-06-29 | 2023-04-13 | Southwest Electronics Technology Research Institute ( China Electronics Technology Group Corporation | Unsupervised Latent Low-Rank Projection Learning Method for Feature Extraction of Hyperspectral Images |
| CN112016392A (en) * | 2020-07-17 | 2020-12-01 | 浙江理工大学 | A small sample detection method based on hyperspectral image for soybean pest degree |
| CN113159446A (en) * | 2021-05-11 | 2021-07-23 | 南京农业大学 | Neural network-based soil nutrient and fruit quality relation prediction method |
| CN113420875A (en) * | 2021-06-22 | 2021-09-21 | 哈尔滨航天恒星数据系统科技有限公司 | Convolutional neural network soil available phosphorus analysis model construction system and method |
| CN113670830A (en) * | 2021-08-22 | 2021-11-19 | 杭州领见数字农业科技有限公司 | A method and device for soil nutrient measurement based on machine learning |
| CN114511170A (en) * | 2021-09-13 | 2022-05-17 | 杭州领见数字农业科技有限公司 | Soil nutrient estimation method and device based on multispectral image |
| CN114282702A (en) * | 2021-11-12 | 2022-04-05 | 合肥工业大学 | Soil conditioning time series prediction method and system based on IGA-BP neural network |
| CN114357891A (en) * | 2022-01-11 | 2022-04-15 | 中国冶金地质总局矿产资源研究院 | Hyperspectral remote sensing quantitative inversion method for soil cadmium element content |
| CN115235997A (en) * | 2022-07-04 | 2022-10-25 | 南通智能感知研究院 | Soil texture inversion method based on satellite hyperspectral image |
| CN116046692A (en) * | 2023-03-23 | 2023-05-02 | 航天宏图信息技术股份有限公司 | Soil heavy metal pollution monitoring method and device based on hyperspectrum |
| CN116580318A (en) * | 2023-05-11 | 2023-08-11 | 中山大学 | Soil nutrient inversion method, device, equipment and medium for crop coverage area |
| CN116858785A (en) * | 2023-06-26 | 2023-10-10 | 广东省科学院广州地理研究所 | Soil nickel concentration inversion method, device, storage medium and computer equipment |
| CN117113189A (en) * | 2023-08-30 | 2023-11-24 | 哈尔滨航天恒星数据系统科技有限公司 | A comprehensive evaluation method for land classification, electronic equipment and storage media |
Non-Patent Citations (7)
| Title |
|---|
| LI MA ET AL.: "Inversion of Soil Organic Matter Content Based on Improved Convolutional Neural Network", 《SENSORS (BASEL)》, 13 October 2022 (2022-10-13) * |
| 丁美青;肖红光;陈松岭;郭云开;吴昊;: "基于BP神经网络的土地开发整理区土壤有机质含量遥感定量反演", 湘潭大学自然科学学报, no. 02, 15 June 2012 (2012-06-15) * |
| 刘慧敏;甄佳奇;刘勇;解洪富;许文超;: "基于PCA-Attention-LSTM网络的土壤氮含量监测", 中国农机化学报, no. 09, 15 September 2020 (2020-09-15) * |
| 张东辉;赵英俊;秦凯;: "一种新的光谱参量预测黑土养分含量模型", 光谱学与光谱分析, no. 09, 15 September 2018 (2018-09-15) * |
| 蒋烨林;王让会;李焱;李成;彭擎;吴晓全;: "艾比湖流域不同土地覆盖类型土壤养分高光谱反演模型研究", 中国生态农业学报, no. 11, 13 September 2016 (2016-09-13) * |
| 陈德宝;陈桂芬;: "基于Landsat8遥感图像的黑土区土壤有机质含量反演研究", 中国农机化学报, no. 06, 15 June 2020 (2020-06-15) * |
| 陶培峰;王建华;李志忠;周萍;杨佳佳;高樊琦;: "基于高光谱的土壤养分含量反演模型研究", 地质与资源, no. 01, 15 February 2020 (2020-02-15) * |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118655099A (en) * | 2024-08-19 | 2024-09-17 | 陕西省环境监测中心站 | A water quality parameter classification inversion method and system based on multidimensional hyperspectral images |
| CN119178738A (en) * | 2024-11-22 | 2024-12-24 | 北京观微科技有限公司 | Soil nutrient evaluation method, device, electronic equipment and storage medium |
| CN120808194A (en) * | 2025-09-10 | 2025-10-17 | 大连亚农农业科技有限公司 | Fertilizer proportioning management method and system combined with remote sensing data analysis |
Also Published As
| Publication number | Publication date |
|---|---|
| CN117688835B (en) | 2024-06-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN117688835B (en) | Soil nutrient inversion method, electronic equipment and storage medium | |
| Chen et al. | Estimating tropical cyclone intensity by satellite imagery utilizing convolutional neural networks | |
| Lu et al. | Streamflow simulation in data-scarce basins using Bayesian and physics-informed machine learning models | |
| Batunacun et al. | Using Shapley additive explanations to interpret extreme gradient boosting predictions of grassland degradation in Xilingol, China | |
| Abbasi et al. | A hybrid of Random Forest and Deep Auto-Encoder with support vector regression methods for accuracy improvement and uncertainty reduction of long-term streamflow prediction | |
| Wang et al. | An evaluation of ECMWF SEAS5 seasonal climate forecasts for Australia using a new forecast calibration algorithm | |
| Qin et al. | Application of machine learning methodologies for predicting corn economic optimal nitrogen rate | |
| Wang et al. | Customized deep learning for precipitation bias correction and downscaling | |
| Tao et al. | A deep neural network modeling framework to reduce bias in satellite precipitation products | |
| Zhu et al. | A cross-resolution transfer learning approach for soil moisture retrieval from Sentinel-1 using limited training samples | |
| Kumar et al. | Regional flood frequency analysis using soft computing techniques | |
| Zhang et al. | Predicting soil moisture content over partially vegetation covered surfaces from hyperspectral data with deep learning | |
| CN118656650B (en) | Soil humidity inversion method, equipment, medium and product | |
| Schepen et al. | Calibration, bridging, and merging to improve GCM seasonal temperature forecasts in Australia | |
| Wan et al. | Modeling wetland aboveground biomass in the Poyang Lake National Nature Reserve using machine learning algorithms and Landsat-8 imagery | |
| Zhang et al. | QRF4P‐NRT: Probabilistic post‐processing of near‐real‐time satellite precipitation estimates using quantile regression forests | |
| Khan et al. | Assessing the impacts of climate change on streamflow dynamics: a machine learning perspective | |
| Batunacun et al. | Using SHAP to interpret XGBoost predictions of grassland degradation in Xilingol, China | |
| Hu et al. | Soil moisture retrieval using convolutional neural networks: Application to passive microwave remote sensing | |
| Rawat et al. | Parameterization of the modified water cloud model (MWCM) using normalized difference vegetation index (NDVI) for winter wheat crop: a case study from Punjab, India | |
| Kurosawa et al. | A statistical hypothesis testing strategy for adaptively blending particle filters and ensemble Kalman filters for data assimilation | |
| Zhang et al. | Simulation model of vegetation dynamics by combining static and dynamic data using the gated recurrent unit neural network-based method | |
| Núñez Ocasio et al. | TAMS: a tracking, classifying, and variable-assigning algorithm for mesoscale convective systems in simulated and satellite-derived datasets | |
| CN118537726A (en) | SAR image vegetation coverage inversion method, system, storage medium and electronic equipment based on Ada-Xgboost model | |
| Thien et al. | Modeling and assessing spatial and temporal changes in recent agricultural land-use in Ben Tre province, Vietnam |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |