Soil type identification method based on residual image convolution
By integrating pH indicators and color space information in soil species recognition and learning the hierarchical relationship between soil genus and soil species, the problem of insufficient recognition accuracy in the existing technology is solved, and higher recognition accuracy and adaptability are achieved .
Patent Information
- Application Number
- CN202411636919.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-11-15
AI Technical Summary
The prior art ignores the soil species hierarchy relationship in soil species identification, resulting in the identification accuracy being insufficient to meet actual needs.
The residual graph convolution method is used to fuse the pH index of soil and the soil color space information, and extract the edge texture information of soil image through the multi-scale edge space adaptive enhancement module to learn the hierarchical relationship between soil genus and soil species.
It effectively improves the final accuracy of soil species identification, provides accurate data support for agricultural production, and has strong adaptability and robustness throughout the process.
Smart Images

Figure CN119478534A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a soil type identification method, and in particular to a soil type identification method based on residual graph convolution. Background Art
[0002] Soil classification is an important identification tool for agricultural production.
[0003] In the prior art, soil type identification is generally achieved based on machine vision, that is, by acquiring an image of sample soil, then building a corresponding neural network, training the neural network based on the sample soil image, and after the training is completed, inputting the soil image to be tested into the corresponding neural network to obtain the final soil type classification probability. Although the prior art can identify soil types to a certain extent, the general focus of the prior art is on the color, brightness and texture of the acquired soil image, while ignoring the relationship between soil type levels, resulting in the accuracy of the final soil type identification still cannot meet actual needs.
[0004] Therefore, in order to solve the above technical problems, it is urgent to propose a new technical means. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a soil type recognition method based on residual graph convolution, which can effectively guarantee the final accuracy of soil type recognition by fusing soil pH index and soil color space information, and extracting soil image edge texture information by adopting a multi-scale edge space adaptive enhancement module, and learning the hierarchical relationship between soil genera and soil types, so as to provide accurate data support for subsequent agricultural production, and the whole process has strong adaptability and good robustness.
[0006] The present invention provides a soil type identification method based on residual graph convolution, comprising the following steps:
[0007] S1. Obtaining a sample soil image and a pH value of the sample soil;
[0008] S2. Mapping the sample soil image from the RGB color space to the Lab color space, removing the brightness component L in the Lab color space, and forming the first input information with the components of the three color channels of the RGB color space of the sample soil image and the a component and b component of the Lab color space;
[0009] S3. The sample soil image is converted into a grayscale image, and the second input information is formed by the grayscale image;
[0010] S4. Construct a soil type recognition model, which includes a PH color channel association enhancement module, a multi-scale edge space adaptive enhancement module, an average pooling layer, a soil level graph convolution module and a priori level guidance module; the output end of the PH color channel association enhancement module is connected to the input end of the multi-scale edge space adaptive enhancement module, the output end of the multi-scale edge space adaptive enhancement module is connected to the input end of the average pooling layer, the output end of the average pooling layer is connected to the input end of the first fully connected layer and the second fully connected layer respectively, the output information of the first fully connected layer and the second fully connected layer are input to the priori level guidance module, the output information of the soil level graph convolution module is input to the priori level guidance module, and the priori level guidance module outputs the soil type recognition result;
[0011] S5. Input the first input information into the PH color channel association enhancement module, input the second input information into the multi-scale edge space adaptive enhancement module, input the soil genus-soil type level label word embedding features of the sample soil and the soil genus-soil type level relationship adjacency matrix into the soil level graph convolution module, and train the soil type recognition model;
[0012] S6. Obtain a soil image to be tested, and after processing the soil image to be tested through step S2 and step S3, input the first input information, the second input information, the soil genus-soil species level label word embedding features, and the soil genus-soil species level relationship adjacency matrix of the soil image to be tested into the trained soil species recognition model to obtain the soil species of the soil to be tested.
[0013] Further, in step S4, the PH color channel association enhancement module extracts PH color channel features by the following method:
[0014] Determine the three color channel characteristics in the RGB color space and the a component and b component of the Lab color space, and determine the correlation coefficient between the pH value and the color channel;
[0015] The pH value of the soil is multiplied by the correlation coefficient, and then multiplied by the three color channel features in the RGB color space and the a component and b component in the Lab color space to obtain the color features, and the color features are normalized;
[0016] The normalized color features are added to the three color channel features in the initial RGB color space of the soil image and the a component and b component of the Lab color space to form the final PH color channel associated enhancement features and input them into the multi-scale edge space adaptive enhancement module.
[0017] Further, the multi-scale edge space adaptive enhancement module includes a first processing layer, a second processing layer, a third processing layer, a fourth processing layer, a first space adaptive normalization module, and a second space adaptive normalization module;
[0018] The first processing layer includes a 3×3 convolution kernel, a 5×5 convolution kernel, a 7×7 convolution kernel, a batch normalization module, a maximum pooling module, and a ReLU function module;
[0019] The PH color channel correlation enhancement features are respectively input into the 3×3 convolution kernel, 5×5 convolution kernel, and 7×7 convolution kernel for processing. The outputs of the 3×3 convolution kernel, 5×5 convolution kernel, and 7×7 convolution kernel are added and input into the batch normalization module. After the batch normalization module is processed, the output is output into the maximum pooling layer for processing, and finally input into the ReLU function module for processing and output into the second processing layer.
[0020] The second processing layer, the third processing layer, and the fourth processing layer all use BasicBlock modules.
[0021] Further, the output information of the first fully connected layer is added to the output information of the second fully connected layer and then input into the prior guidance module;
[0022] The output information of the average pooling layer is multiplied by the output information of the soil level graph convolution module, and then added to the output information of the second fully connected layer and input into the prior guidance module.
[0023] Furthermore, the soil level graph convolution module convolves the soil level graph features through the following process:
[0024] Determine the soil attribute label set G of the sample soil: G = {g 1 ,g 2 ,…,g m};
[0025] Determine the soil type label set S of the sample soil: S = {s 1 ,s 2 ,…,s k};
[0026] Define the mapping function H:S→G, which represents soil type s i Corresponding soil type g i , the mapping is represented by H(s i ) = g j ;
[0027] Define the indicator function I(·) that a soil type belongs to a soil genus:
[0028]
[0029] Define the soil layer adjacency matrix R:
[0030]
[0031] Add the identity matrix I to the adjacency matrix R to obtain the matrix R': R' = R + I;
[0032] Normalize the matrix R' to get the normalized matrix R norm :
[0033] R norm =D -1 / 2 (R+I)D -1 / 2 ;
[0034] D = ||R+I||; where D is the degree matrix, and ||·|| represents the count of non-zero elements;
[0035] Determine soil level graph convolution features:
[0036] F h' =σ(R norm σ(R norm F h W (0) )W (1) );
[0037] Where: σ(·) represents the LeakyReLU activation function, W is the weight matrix of graph convolution;
[0038] L g represents the soil label projection, L s represents the soil type label projection, m and k represent the number of soil genus and soil type categories, respectively.
[0039] Furthermore, the a priori guidance module outputs the soil type category by the following method:
[0040] Construct soil genus-soil species hierarchical relationship matrix:
[0041]
[0042] Determine the hierarchical guidance factor τ:
[0043]
[0044] Where: p g represents the soil probability distribution, p s is the soil species probability distribution, represents element-by-element multiplication, ⊙ represents the Hadamard product;
[0045] Normalize the hierarchical guidance factors:
[0046]
[0047] Corrected initial soil type prediction probability p s Then we get ρ i,j :
[0048]
[0049] Where: α is the weighting coefficient;
[0050] Determine the final soil type prediction probability ρ norm :
[0051]
[0052] The beneficial effects of the present invention are as follows: through the present invention, by integrating the soil pH index and the soil color space information, and adopting a multi-scale edge space adaptive enhancement module to extract the edge texture information of the soil image, by learning the hierarchical relationship between soil genera and soil species, the final accuracy of soil species identification can be effectively guaranteed, and accurate data support can be provided for subsequent agricultural production, and the whole process has strong adaptability and good robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0054] Figure 1 It is a flow chart of the present invention.
[0055] Figure 2 It is a schematic diagram of the soil type identification model structure of the present invention.
[0056] Figure 3 It is a schematic diagram of the structure of the multi-scale edge space adaptive enhancement module of the present invention.
[0057] Figure 4 It is a schematic diagram of the structure of the first processing layer of the present invention.
[0058] Figure 5 Schematic diagram of the PH color channel association enhancement module of the present invention.
[0059] Figure 6 Schematic diagram of the soil level graph convolution module of the present invention. DETAILED DESCRIPTION
[0060] The present invention is further described in detail below:
[0061] The present invention provides a soil type identification method based on residual graph convolution, comprising the following steps:
[0062] S1. Obtaining a sample soil image and a pH value of the sample soil;
[0063] S2. Mapping the sample soil image from the RGB color space to the Lab color space, and removing the brightness component L in the Lab color space, and forming the first input information with the components of the three color channels of the RGB color space of the sample soil image and the a component and the b component of the Lab color space; wherein the image is mapped from the RGB color space to the Lab color space using an existing method;
[0064] S3. The sample soil image is converted into a grayscale image, and the second input information is formed by the grayscale image;
[0065] S4. Construct a soil type recognition model, which includes a PH color channel association enhancement module, a multi-scale edge space adaptive enhancement module, an average pooling layer, a soil level graph convolution module and a priori level guidance module; the output end of the PH color channel association enhancement module is connected to the input end of the multi-scale edge space adaptive enhancement module, the output end of the multi-scale edge space adaptive enhancement module is connected to the input end of the average pooling layer, the output end of the average pooling layer is connected to the input end of the first fully connected layer and the second fully connected layer respectively, the output information of the first fully connected layer and the second fully connected layer are input to the priori level guidance module, the output information of the soil level graph convolution module is input to the priori level guidance module, and the priori level guidance module outputs the soil type recognition result;
[0066] S5. Input the first input information into the PH color channel association enhancement module, input the second input information into the multi-scale edge space adaptive enhancement module, input the soil genus-soil type level label word embedding features of the sample soil and the soil genus-soil type level relationship adjacency matrix into the soil level graph convolution module, and train the soil type recognition model;
[0067] S6. Obtain the soil image to be tested, and after the soil image to be tested is processed by step S2 and step S3, the first input information, the second input information, the soil genus-soil species hierarchical label word embedding features, and the soil genus-soil species hierarchical relationship adjacency matrix of the soil image to be tested are input into the trained soil species recognition model to obtain the soil species of the soil to be tested. Through the above method, by integrating the soil pH index and the soil color space information, and using a multi-scale edge space adaptive enhancement module to extract the edge texture information of the soil image, through the learning of the hierarchical relationship between soil genus and soil species, the final accuracy of soil species recognition can be effectively guaranteed, and accurate data support can be provided for subsequent agricultural production, and the whole process has strong adaptability and good robustness.
[0068] In this embodiment, in step S4, the PH color channel association enhancement module extracts PH color channel features by the following method: Figure 5 As shown:
[0069] Determine the three color channel characteristics in the RGB color space and the a component and b component of the Lab color space, and determine the correlation coefficient between the pH value and the color channel; that is, the pH value has a correlation with the color of the soil, and the correlation coefficient is determined by an existing method;
[0070] The pH value of the soil is multiplied by the correlation coefficient, and then multiplied by the three color channel features in the RGB color space and the a component and b component in the Lab color space to obtain the color features, and the color features are normalized;
[0071] The normalized color features are added to the three color channel features in the initial RGB color space of the soil image and the a component and b component of the Lab color space to form the final pH color channel association enhancement feature and input it into the multi-scale edge space adaptive enhancement module; through the above, the pH characteristics of the soil are associated with the color characteristics and enhanced, which is conducive to improving the final recognition accuracy of the entire prediction model.
[0072] In this embodiment, the multi-scale edge space adaptive enhancement module includes a first processing layer, a second processing layer, a third processing layer, a fourth processing layer, a first space adaptive normalization module, and a second space adaptive normalization module;
[0073] The first processing layer includes a 3×3 convolution kernel, a 5×5 convolution kernel, a 7×7 convolution kernel, a batch normalization module, a maximum pooling module, and a ReLU function module;
[0074] The PH color channel correlation enhancement features are respectively input into the 3×3 convolution kernel, 5×5 convolution kernel, and 7×7 convolution kernel for processing. The outputs of the 3×3 convolution kernel, 5×5 convolution kernel, and 7×7 convolution kernel are added and input into the batch normalization module. After the batch normalization module is processed, the output is output into the maximum pooling layer for processing, and finally input into the ReLU function module for processing and output into the second processing layer.
[0075] The second processing layer, the third processing layer and the fourth processing layer all use BasicBlock modules and the inputs and outputs of the second processing layer, the third processing layer and the fourth processing layer are connected in sequence, wherein the BasicBlock module is a structure in the RESNET34 network, which is a prior art and will not be elaborated here.
[0076] The first spatial adaptive normalization module and the second spatial adaptive normalization module both use the existing SPADE module to extract the edge, and the extraction process uses the existing technology, which is briefly described as follows:
[0077] Edge extraction ψ(I)∈R B×H×W×3 :
[0078]
[0079] G x and G y are the horizontal and vertical strengths of the soil image respectively, B is the batch size, and Conv represents the convolution operation.
[0080] The number of channels of ψ(I) is adjusted through SPADE and bilinear interpolation is performed to obtain projection features to match the feature size and dimension of each layer of the backbone network.
[0081]
[0082] In the formula, and denote the scaling factor and offset respectively, is the value of the input feature at (n,c,y,x), and denote the mean and variance respectively, the subscript c denotes the number of soil categories, n denotes the nth batch, y and x denote the position of the nth batch, and BN denotes batch normalization.
[0083] Feature fusion calculation of each layer:
[0084]
[0085] In the formula, ε i Edge projection features, I gray is the soil grayscale image, f i represents the features extracted from the i-th layer, Represents element-by-element addition.
[0086] In this embodiment, the output information of the first fully connected layer and the output information of the second fully connected layer are added and input into the prior guidance module;
[0087] The output information of the average pooling layer is multiplied by the output information of the soil level graph convolution module, and then added to the output information of the second fully connected layer and input into the prior guidance module.
[0088] In this embodiment, the soil level graph convolution module convolves the soil level graph features through the following process:
[0089] Determine the soil attribute label set G of the sample soil: G = {g 1 ,g 2 ,…,g m};
[0090] Determine the soil type label set S of the sample soil: S = {s 1 ,s 2 ,…,s k};
[0091] Define the mapping function H:S→G, which represents soil type s i Corresponding soil type g i , the mapping is represented by H(s i ) = g j ;
[0092] Define the indicator function I(·) that a soil type belongs to a soil genus:
[0093]
[0094] Define the soil layer adjacency matrix R:
[0095]
[0096] Add the identity matrix I to the adjacency matrix R to obtain the matrix R': R' = R + I;
[0097] Normalize the matrix R' to get the normalized matrix R norm :
[0098] R norm =D -1 / 2 (R+I)D -1 / 2 ;
[0099] D = ||R+I||; where D is the degree matrix, and ||·|| represents the count of non-zero elements;
[0100] Determine soil level graph convolution features:
[0101] F h' =σ(R norm σ(R norm F h W (0) )W (1) );
[0102] Where: σ(·) represents the LeakyReLU activation function, W is the weight matrix of graph convolution;
[0103] L g represents the soil label projection, L s represents the soil type label projection, m and k represent the number of soil genus and soil type categories, respectively.
[0104] In this embodiment, the a priori guidance module outputs the soil type category by the following method:
[0105] Construct soil genus-soil species hierarchical relationship matrix:
[0106]
[0107] Determine the hierarchical guidance factor τ:
[0108]
[0109] Where: p g represents the soil probability distribution, p s is the soil species probability distribution, represents element-by-element multiplication, ⊙ represents the Hadamard product;
[0110] Normalize the hierarchical guidance factors:
[0111]
[0112] Corrected initial soil type prediction probability p s Then we get ρ i,j :
[0113]
[0114] Where: α is the weighting coefficient;
[0115] Determine the final soil type prediction probability ρ norm :
[0116]
[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A soil type identification method based on residual graph convolution, characterized by: The following steps are involved: S1. Obtaining a sample soil image and a pH value of the sample soil; S2. Mapping the sample soil image from the RGB color space to the Lab color space, removing the brightness component L in the Lab color space, and forming the first input information with the components of the three color channels of the RGB color space of the sample soil image and the a component and b component of the Lab color space; S3. The sample soil image is converted into a grayscale image, and the second input information is formed by the grayscale image; S4. Constructing a soil type recognition model, the soil type recognition model includes a PH color channel association enhancement module, a multi-scale edge space adaptive enhancement module, an average pooling layer, a soil level graph convolution module and a priori level guidance module; The output end of the PH color channel association enhancement module is connected to the input end of the multi-scale edge space adaptive enhancement module, the output end of the multi-scale edge space adaptive enhancement module is connected to the input end of the average pooling layer, the output end of the average pooling layer is connected to the input end of the first fully connected layer and the second fully connected layer respectively, the output information of the first fully connected layer and the second fully connected layer are input to the prior level guidance module, the output information of the soil level graph convolution module is input to the prior level guidance module, and the prior level guidance module outputs the soil type recognition result; S5. Input the first input information into the PH color channel association enhancement module, input the second input information into the multi-scale edge space adaptive enhancement module, input the soil genus-soil type level label word embedding features of the sample soil and the soil genus-soil type level relationship adjacency matrix into the soil level graph convolution module, and train the soil type recognition model; S6. Obtain a soil image to be tested, and after processing the soil image to be tested through step S2 and step S3, input the first input information, the second input information, the soil genus-soil species level label word embedding features, and the soil genus-soil species level relationship adjacency matrix of the soil image to be tested into the trained soil species recognition model to obtain the soil species of the soil to be tested.
2. The soil type identification method based on residual graph convolution according to claim 1 is characterized in that: In step S4, the PH color channel association enhancement module extracts PH color channel features by the following method: Determine the three color channel characteristics in the RGB color space and the a component and b component of the Lab color space, and determine the correlation coefficient between the pH value and the color channel; The pH value of the soil is multiplied by the correlation coefficient, and then multiplied by the three color channel features in the RGB color space and the a component and b component in the Lab color space to obtain the color features, and the color features are normalized; The normalized color features are added to the three color channel features in the initial RGB color space of the soil image and the a component and b component of the Lab color space to form the final PH color channel associated enhancement features and input them into the multi-scale edge space adaptive enhancement module.
3. The soil type identification method based on residual graph convolution according to claim 2 is characterized in that: The multi-scale edge space adaptive enhancement module includes a first processing layer, a second processing layer, a third processing layer, a fourth processing layer, a first space adaptive normalization module, and a second space adaptive normalization module; The first processing layer includes a 3×3 convolution kernel, a 5×5 convolution kernel, a 7×7 convolution kernel, a batch normalization module, a maximum pooling module, and a ReLU function module; The PH color channel correlation enhancement features are respectively input into the 3×3 convolution kernel, 5×5 convolution kernel, and 7×7 convolution kernel for processing. The outputs of the 3×3 convolution kernel, 5×5 convolution kernel, and 7×7 convolution kernel are added and input into the batch normalization module. After the batch normalization module is processed, the output is output into the maximum pooling layer for processing, and finally input into the ReLU function module for processing and output into the second processing layer. The second processing layer, the third processing layer, and the fourth processing layer all use BasicBlock modules.
4. The soil type identification method based on residual graph convolution according to claim 1 is characterized in that: The output information of the first fully connected layer and the output information of the second fully connected layer are added and input into the prior guidance module; The output information of the average pooling layer is multiplied by the output information of the soil level graph convolution module, and then added to the output information of the second fully connected layer and input into the prior guidance module.
5. The soil type identification method based on residual graph convolution according to claim 1 is characterized in that: The soil level graph convolution module convolves the soil level graph features through the following process: Determine the soil attribute label set G of the sample soil: G = {g1, g2, ..., g m }; Determine the soil type label set S of the sample soil: S = {s1, s2, ..., s k }; Define the mapping function H:S→G, which represents soil type s i Corresponding soil type g i , the mapping is represented by H(s i ) = g j ; Define the indicator function I(·) that a soil type belongs to a soil genus: Define the soil layer adjacency matrix R: Add the identity matrix I to the adjacency matrix R to obtain the matrix R': R' = R + I; Normalize the matrix R' to get the normalized matrix R norm : R norm =D -1 / 2 (R+I)D -1 / 2 ; D = ||R+I||; where D is the degree matrix, and ||·|| represents the count of non-zero elements; Determine soil level graph convolution features: F h' =σ(R norm σ(R norm F h W (0) )W (1) ); Where: σ(·) represents the LeakyReLU activation function, W is the weight matrix of graph convolution; L g represents the soil label projection, L s represents the soil type label projection, m and k represent the number of soil genus and soil type categories, respectively.
6. The soil type identification method based on residual graph convolution according to claim 5 is characterized in that: The prior guidance module outputs the soil type category by the following method: Construct soil genus-soil species hierarchical relationship matrix: Determine the hierarchical guidance factor τ: Where: p g represents the soil probability distribution, p s is the soil species probability distribution, represents element-by-element multiplication, ⊙ represents the Hadamard product; Normalize the hierarchical guidance factors: Corrected initial soil type prediction probability p s Then we get ρ i,j : Where: α is the weighting coefficient; Determine the final soil type prediction probability ρ norm :
Citation Information
Patent Citations
Soil image brightness controllable enhancement method based on weighted Gaussian subtraction fitting
CN114764757A
Corn disease identification method based on texture-color multi-scale residual shrinkage network
CN116630960A
Soil lithology intelligent identification method and system based on deep learning
CN117874469A
Red soil pH measuring system and method based on image pixel numerical parameter identification
CN118334009A