Soil organic matter content hyperspectral modeling method based on MS-SERNNet
Through improved deep residual neural network model and hyperspectral remote sensing technology, combined with the fusion of attention mechanism and multi-scale features, the limitations of traditional soil organic matter measurement methods are solved, and efficient and accurate soil organic matter prediction is achieved.
Patent Information
- Application Number
- CN202510271752.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-09
- Publication Date
- 2025-07-01
AI Technical Summary
Traditional soil organic matter measurement methods have problems such as damage, long time, high cost, and difficulty in achieving lossless and real-time monitoring, which is difficult to meet the needs of large-scale and high-frequency soil monitoring.
A highly efficient soil organic matter prediction model is developed using an improved deep residual neural network (ResNet) model with an added attention module (SEBlock) and multi-scale feature fusion (Multi-scale Feature Fusion).
It significantly improves the accuracy of soil organic matter prediction, solves the problem of multicollinearity between various bands, and has the advantages of small workload, low cost, high accuracy and high reliability, and is suitable for different soils in different regions.
Smart Images

Figure CN120234754A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of soil spectral acquisition and analysis. Using this method, the soil organic matter content can be quickly determined, and the measurement accuracy can be improved. Background Art
[0002] As an important part of the Earth's surface system, soil is not only the foundation of agricultural production but also a key element for the healthy operation of the ecosystem. Soil quality directly determines the growth status of crops, the sustainability of agricultural production, and the stability of the ecological environment. Among the many properties of soil, soil organic matter (SOM) is one of the most core indicators. Soil organic matter is not only an important source of soil fertility but also indirectly regulates the soil's water-holding capacity, nutrient supply capacity, and microbial activity by affecting the physical, chemical, and biological properties of the soil. In addition, soil organic matter plays an important role in the global carbon cycle, and its dynamic changes have a profound impact on climate change. Therefore, accurately monitoring and predicting the soil organic matter content is of great significance for achieving precision agriculture, optimizing soil management, and addressing climate change.
[0003] Traditional methods for measuring soil organic matter mainly rely on laboratory chemical analysis, such as wet chemical analysis methods (such as potassium dichromate oxidation method) and dry combustion methods (such as high-temperature combustion method). Although these methods have high precision, they have obvious limitations: First, they require the destruction of soil samples and cannot achieve non-destructive detection; second, the experimental process is time-consuming and costly, making it difficult to meet the needs of large-scale and high-frequency soil monitoring; finally, laboratory analysis usually requires professional equipment and technicians, which limits its application in field real-time monitoring. With the increasing global demand for soil data in agriculture and the ecological environment, developing a fast, efficient, and non-destructive method for detecting soil organic matter has become an urgent need in current research.
[0004] In recent years, the rapid development of remote sensing technology has provided new solutions for the rapid monitoring of soil properties. Among them, hyperspectral remote sensing technology has gradually become an important tool for soil science research because it can provide continuous and dense spectral information. Hyperspectral remote sensing obtains the surface reflection spectrum through a sensor in multiple wavelength ranges such as visible light, near-infrared, and short-wave infrared, and can capture the fine spectral characteristics of the soil. These spectral characteristics are closely related to the physical, chemical, and biological properties of the soil, such as organic matter content, water content, and mineral composition. By analyzing the hyperspectral data of the soil, a quantitative relationship between soil properties and spectral characteristics can be established, thereby realizing the rapid prediction of soil properties.
[0005] In addition, the preprocessing and feature selection of hyperspectral data are also key factors affecting the model performance. Spectral data is usually interfered by noise, scattering effects, and baseline drift, and needs to be denoised and corrected through preprocessing methods (such as SG filtering, wavelet transform, multiplicative scatter correction, etc.). At the same time, the high dimensionality of hyperspectral data may lead to the problem of "curse of dimensionality", so key features need to be extracted through feature selection or dimensionality reduction methods (such as principal component analysis, PCA) to reduce the data dimensionality. The selection and optimization of these preprocessing and feature selection methods have an important impact on the performance of the model.
[0006] In summary, the rapid and accurate prediction of soil organic matter is of great significance for precision agriculture, soil management, and environmental protection. Hyperspectral remote sensing technology provides a new solution for the rapid monitoring of soil properties, but its high dimensionality and complexity pose great challenges to data processing and modeling. The purpose of this study is to develop an efficient soil organic matter prediction model by combining hyperspectral remote sensing technology and deep learning methods, providing technical support for soil science research and practical applications. Summary of the Invention
[0007] In view of this, the present invention proposes an improved deep residual neural network (ResNet) model with a squeeze-and-excitation block (SEBlock) and multi-scale feature fusion to alleviate the problems of gradient disappearance and low training efficiency that occur during the training of traditional deep learning models.
[0008] To achieve the above object, the present invention provides the following technical solutions:
[0009] The technical solution to achieve the object of the present invention is: A hyperspectral modeling method for soil organic matter content based on MS-SERNNet, comprising the following steps:
[0010] 1. Collection and processing of soil samples: Collect a number of samples, air-dry and grind the samples naturally, and divide the samples evenly into two parts;
[0011] 2. Determination of the organic matter content and spectral reflectance data of soil samples: Sieve the samples through a 0.2 nm soil sieve, then use potassium dichromate oxidation heating to measure the SOM content. Sieve the samples through a 0.149 nm soil sieve, and use an asd fieldspec1 4 hi-res ground object spectrometer to obtain hyperspectral data, with the spectral range including the visible and near-infrared regions, that is, the wavelength range of 350 - 2500 nm;
[0012] 3. Preprocess the soil spectral reflectance data in Step 2: that is, remove the edge bands with large noise in the spectral reflectance data and smooth the spectral reflectance data. Among them, the edge bands with large noise are the 350 - 399 nm and 2401 - 2500 nm bands, and the smoothing process is to perform Savitzky - Golay smoothing on the spectral reflectance data;
[0013] 4. Spectral reflectance data transformation: Perform transformation processing on the spectral reflectance, including first - order differential, second - order differential, moving average filtering, standard normal variate, and multiplicative scatter correction;
[0014] 5. Establish a soil organic matter prediction model using machine learning algorithms and deep learning algorithms. Among them, the machine learning algorithms are partial least squares regression and support vector machine, and the deep learning algorithm is long short - term memory network. 4 / 5 of the total number of samples is used as the training set, and 1 / 5 is the validation set. The plsr and dbo - svr models are implemented by calling the corresponding machine learning modules in the sklearn interface. The lstm model is established using the keras library in the pycharm software with the python3.8 language. Establish inversion models between five types of spectral reflectance data, namely r, 1dr, 2dr, maf, and msc, and soil organic matter content. The initial model is tested by fitting the data model using origin 2021;
[0015] 6. Establish a hyperspectral prediction model: Select the optimal model in Step 5;
[0016] 7. Model accuracy evaluation: Use the coefficient of determination and root mean square error to evaluate the soil organic matter prediction model established in Step 5, and determine the accuracy, stability, and prediction performance of the soil organic matter prediction model.
[0017] Compared with the prior art, the advantages and beneficial effects of this technical solution are as follows: Compared with modeling using the attention mechanism to optimize the traditional residual network model, this technical solution can significantly improve the modeling accuracy, solve problems such as multicollinearity between bands, and has the advantages of small workload, low cost, high accuracy, and high reliability. The generalization of the model is high and it is applicable to different soils in different regions. This technical solution provides a soil organic matter prediction method with a simple model, small data volume requirements, high operation efficiency, high accuracy, and good prediction performance.
[0018] Through soil sample collection and processing, soil organic matter determination, spectral reflectance data determination, spectral reflectance data transformation, establishment of machine learning algorithms and deep learning algorithm models, establishment of hyperspectral prediction models, and evaluation indicators, this technical solution can predict in real - time, quickly, and accurately compared with machine learning methods and traditional deep learning methods, and has good practical application value.
[0019] This method can be widely applied to engineering practice, providing a basis for the subsequent management and utilization of land resources. Brief Description of the Drawings
[0020] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be described in detail preferably with reference to the accompanying drawings, wherein:
[0021] Figure 1 It is a structural diagram of MS-SERNet.
[0022] Figure 2 It is a structural diagram of SEBlock.
[0023] Figure 3 It is a structural diagram of adaptive hybrid pooling.
[0024] Figure 4 It is a diagram of a multi-scale feature parallel adaptive fusion framework.
[0025] Figure 5 It is a convergence diagram of the prediction accuracy curve of the modeled SOM content.
[0026] Figure 6 It is a scatter diagram of the prediction accuracy of the modeled SOM content. Detailed Embodiments
[0027] The following specific examples illustrate the embodiments of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the drawings provided in the following embodiments only illustrate the basic concept of the present invention schematically. Without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0028] Among them, the drawings are only for illustrative purposes, showing only schematic diagrams, not physical diagrams, and should not be construed as a limitation to the present invention: for better illustrating the embodiments of the present invention, some components in the drawings will be omitted, enlarged or reduced, which do not represent the dimensions of the actual product; for those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted. The same or similar reference numerals in the drawings of the embodiments of the present invention correspond to the same or similar components.
[0029] The present invention provides a deep learning method for predicting soil organic matter based on near-infrared spectral data, aiming to improve the prediction accuracy. By improving the traditional residual network model, it realizes maintaining the optimal energy consumption and total cost, including the following steps:
[0030] Step 1: Improving the model with channel attention module
[0031] Channel attention is a method to improve the performance of convolutional operations and shows great potential in enhancing the performance of deep neural network models. SE channel attention is a typical representative of channel attention and an improved module of SENet channel attention. Avoiding dimensionality reduction is important for channel attention learning, and appropriate cross-channel interaction can significantly reduce model complexity while maintaining performance. The calculation formula of SEBlock is described as follows:
[0032]
[0033]
[0034]
[0035] represents the input feature map, is the number of input channels, represents the length of each feature. First, global average pooling is performed separately for each channel to obtain Subsequently, the number of cross-channels is adaptively calculated according to the number of input channels, that is, in 1D convolution. Finally, through the activation function and a stride of 1, with a kernel size of , and is assigned to the feature maps of each input channel respectively. is the function of global average pooling for each channel, represents 1D convolution, and the constants and are established as fixed values. In the paper , , represents the activation function.
[0036] Step 2: Improving the model with the adaptive hybrid pooling method
[0037] The pooling layer is crucial for reducing the size of activation maps in neural networks. Existing pooling methods all have different characteristics. Most architectures use max pooling or average pooling, both of which are fast and memory-efficient, but there is still room for improvement in retaining important information about the input features. The invention proposes an adaptive hybrid pooling method, in which the weighted average of max pooling and average pooling is called adaptive mean hybrid pooling (AHP).
[0038] For the adaptive hybrid pooling method, the downsampling rate can be adaptively selected according to the size of the output feature map. The selection of the downsampling rate depends on the dimension of the output feature map, which enables the network to adjust its processing resolution according to the input data. Assume that \(L\) represents the feature length of the input feature, \(L_{out}\) is the size of the output feature map of the module, and \(C\) represents the number of channels. and are the output feature maps obtained by AvgPool and MaxPool respectively. Therefore, AHP can be obtained by the following formula:
[0039]
[0040]
[0041] is the feature information output by AHP, represents the padding step, while is the kernel size of the adaptive pooling. Assume that the length of the input feature is , and the given size of the output feature is , then the size of the adaptive pooling kernel can be calculated according to the formula.
[0042] Step 3: Multi-scale Feature Parallel Adaptive Fusion Improved Model
[0043] The multi-scale feature parallel adaptive fusion method (Multi-scale Feature Parallel Adaptive Fusion) is a method that combines feature information of multiple scales and performs adaptive fusion. The core idea of multi-scale feature extraction is to extract feature information of different levels and sizes from the input data through convolution operations, pooling operations, etc. at different scales. Specifically, feature maps of different scales are processed on different paths, and each path may include different convolutional layers, pooling layers, etc. This parallel processing can capture features at different levels on different paths while avoiding the limitations of a single scale.
[0044] Assume that , and are all input feature maps of different scales, and the dimensions of each feature are , and . is the feature map after parallel fusion, and its size is , . Concatenate , and features, and then use a 1D kernel convolution to obtain the output feature map after the feature fusion process. Output feature represents the result of feature fusion and convolutional dimensionality reduction, and its feature map size is . Additionally represents the number of channels existing in the output features, represents the feature length, which is calculated according to the following formula:
[0045]
[0046] is the output feature of the th channel at the position , represents the input feature of the mth channel at the position . represents the output channel of the mth input channel and the kth convolutional kernel, represents the bias of the kth output channel.
[0047] Step 4: Comparative experiments of traditional deep learning models
[0048] The present invention uses three classic neural network models, namely VGGNet, ResNet, and DRSN, for modeling experiments to compare the differences in their modeling effects with the method of this study, as well as the prediction effects under different spectral preprocessing methods. As a traditional neural network model, VGGNet has a relatively simple design, and it stacks convolutional layers to extract features. ResNet is the basic model of the model MS-SERNet proposed in this chapter. ResNet overcomes the problem of gradient disappearance in training through residual connections. DRSN is also an extension of ResNet, introducing a gating mechanism to achieve contraction and inhibition during feature propagation.
[0049] To avoid the influence of random variables on this comparative experiment, the common hyperparameters of these models are unified. The mean squared error is used as the loss function during model training, and then the Adam optimizer is used, with the learning rate selected as 0.001 and the number of training epochs set to 800.
[0050] The prediction accuracy curves of MS-SERNet and other deep learning models exhibit different characteristics. All models have a relatively fast learning speed in the initial stage, and then the learning rate gradually slows down and finally stabilizes. From the overall trend, the training set and validation set curves of VggNet converge rapidly and remain stable in a relatively short period of time. After 100 rounds of training, the amplitude of vibration of the coefficient of determination and root mean square error is minimized. As the number of training rounds increases, the amplitude of vibration also expands to a certain extent, indicating that too many rounds of training cause overfitting to the model. The validation set curve and training set curve of ResNet change relatively violently throughout the training process, and the coefficient of determination of the validation set shows a slow downward trend, which indicates that, like VggNet, there is a slight overfitting phenomenon after the number of training rounds increases. For the DRSN model, there are jump phenomena in the curve, and the model effects in some rounds are significantly worse than those in other rounds. The curve of the MS-SERNet model has a relatively large amplitude of vibration and changes relatively violently in the first 200 rounds, but the model begins to converge after 200 rounds. As the number of training rounds increases, the model becomes more stable.
Claims
1. A modeling method for predicting soil organic matter content based on MS-SERNet, characterized in that: The method comprises the following steps: (1) Channel attention mechanism: Channel attention is a method to improve the performance of convolution operations and shows great potential in improving the performance of deep neural network models; (2) Adaptive hybrid pooling method: The adaptive hybrid pooling method can adaptively select the downsampling rate according to the size of the output feature map. The selection of the downsampling rate depends on the dimension of the output feature map, which enables the network to adjust its processing resolution according to the input data; (3) Multi-scale Feature Parallel Adaptive Fusion Method: Multi-scale Feature Parallel Adaptive Fusion is a method that combines feature information of multiple scales and adaptively fuses them.
2. The method according to claim 1, characterized in that The channel attention mechanism described in step (1) is a method for improving the performance of convolution operations. SE channel attention is a typical representative of channel attention and is an improved module of SENet channel attention; Avoiding dimensionality reduction is important for channel attention learning. Appropriate cross-channel interaction can significantly reduce model complexity while maintaining performance. The calculation formula of SEBlock is as follows: ; ; ; L×C represents the input feature map, C is the number of input channels, and L represents the length of each feature; First, each channel is globally average pooled separately to obtain G(X). Subsequently, the number of cross-channels k is adaptively calculated according to the number of input channels, that is, in 1D convolution; finally, through the Sigmoid activation function and 1 step size of 1, the kernel size is k, and is assigned to the feature map of each input channel respectively; G(X) is a function of global average pooling channel by channel, C1D represents 1D convolution, and constants b and t have been established as fixed values; in the invention t=2, b=1, Sigmoid represents the activation function.
3. The method according to claim 1, characterized in that The adaptive mixed pooling method described in step (2) is a method for improving pooling performance in a neural network model; the pooling layer is the key to reducing the size of activation maps in a neural network, and existing pooling methods have different characteristics. Most architectures use maximum pooling or average pooling, both of which are fast and memory-efficient, but there is still room for improvement in retaining important information about input features; the present invention proposes an adaptive mixed pooling method, wherein the weighted average of maximum pooling and average pooling is called adaptive mean mixed pooling (AHP); for the adaptive mixed pooling method, the downsampling rate can be adaptively selected according to the size of the output feature map; the selection of the downsampling rate depends on the dimension of the output feature map, which enables the network to adjust its processing resolution according to the input data; assuming that L represents the feature length of the input feature, L is the output feature map size of the module, and C represents the number of channels; and The output feature maps obtained by AvgPool and MaxPool respectively; therefore, AHP can be obtained by the following formula: ; ; is the characteristic information output by AHP, represents the filling step, and is the kernel size of adaptive pooling; assuming the length of the input feature is , given the size of the output feature is , then the size of the adaptive pooling kernel can be calculated according to the formula.
4. The method according to claim 1, characterized in that: The multi-scale feature parallel adaptive fusion method described in step (3) is a method that combines feature information of multiple scales and adaptively fuses them. The core idea of multi-scale feature extraction is to extract feature information of different levels and sizes from input data through convolution operations and pooling operations of different scales. Specifically, feature maps of different scales are processed on different paths, and each path may include different convolution layers, pooling layers, etc. This parallel processing can capture features of different levels on different paths while avoiding the limitations of a single scale. Assume , and They are all input feature maps of different scales, and the dimensions of the features are , and ; is the feature map after parallel fusion, and its size is , ; Splicing , and Features, and then use 1D kernel convolution to obtain the output feature map after the feature fusion process; Output characteristics It represents the result of feature fusion and convolution dimension reduction, and its feature map size is ;in addition Indicates the number of channels in the output feature, represents the characteristic length, Calculated according to the following formula: ; It is Channels at position The output features of Indicates that the mth channel is at position Input features of represents the mth input channel and the kth The output channel of the convolution kernel, Represents the deviation of the kth and output channels.