Surface soil type identification method based on MCP-ShuffleNet V2

By using the MCP-ShuffleNet V2 model and the MELU activation function, combined with an attention mechanism and a bidirectional weighted loss function, the problems of non-soil factor interference and gradient vanishing in soil type identification are solved, thereby improving the accuracy and stability of soil type identification.

CN121010894APending Publication Date: 2025-11-25CHONGQING NORMAL UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511202386.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

Existing neural networks are easily affected by non-soil factors in images when identifying soil types, and the non-differentiability of activation functions leads to gradient vanishing, reducing recognition accuracy.

Method used

We adopt the MCP-ShuffleNet V2 model, which combines deformable convolutional layers, max pooling layers, feature extraction modules, and global pooling layers. We introduce channel, width, and height attention mechanisms, use the MELU activation function, and employ a bidirectional weighted loss function.

Benefits of technology

It effectively suppresses interference from non-soil elements in soil images, avoids gradient vanishing, improves soil type identification accuracy, and enhances the stability and robustness of neural networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121010894A_ABST
    Figure CN121010894A_ABST
Patent Text Reader

Abstract

The invention provides a surface soil type identification method based on MCP-ShuffleNet V2, and the method comprises the following steps: S1, obtaining a sample soil image, and carrying out the preprocessing of the sample soil image, and then forming a training data set; s2, constructing an MCP-ShuffleNet V2 prediction model, and inputting the training data set into the MCP-ShuffleNet V2 prediction model to carry out training; and S3, obtaining a to-be-detected soil image, preprocessing the to-be-detected soil image, and inputting the preprocessed to-be-detected soil image into the trained MCP-ShuffleNet V2 prediction model to obtain a soil classification result of the to-be-detected soil image, so that interference of non-soil elements in the soil image can be effectively inhibited, a neural network is guided to focus on a key soil area, a continuous and derivable MELU activation function is provided, and the accuracy of the soil classification result is improved. And the gradient disappearance problem is effectively avoided, so that the final soil type identification precision is effectively ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a soil type identification method, and more particularly to a surface soil type identification method based on MCP-ShuffleNet V2. Background Technology

[0002] Accurate identification of soil types is of great significance to modern agricultural production. In existing technologies, neural networks are generally used to identify soil types, which have high accuracy and high identification efficiency.

[0003] However, existing neural networks have the following technical drawbacks when identifying soil types: on the one hand, existing neural networks are easily affected by non-soil factors in images, which reduces the accuracy of soil type classification results; on the other hand, the activation functions of existing neural networks are not differentiable, which leads to gradient vanishing and further reduces the accuracy of soil type identification results.

[0004] Therefore, in order to solve the above-mentioned technical problems, it is urgent to propose a new technical approach. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a surface soil type identification method based on MCP-ShuffleNet V2, which can effectively suppress the interference of non-soil elements in soil images, thereby guiding the neural network to focus on key soil areas. Moreover, it has a continuously differentiable MELU activation function, which effectively avoids the gradient vanishing problem, thereby effectively ensuring the final soil type identification accuracy.

[0006] This invention provides a method for identifying topsoil species based on MCP-ShuffleNet V2, comprising the following steps:

[0007] S1. Obtain sample soil images and preprocess the sample soil images to form a training dataset;

[0008] S2. Construct the MCP-ShuffleNet V2 prediction model and input the training dataset into the MCP-ShuffleNet V2 prediction model for training;

[0009] The MCP-ShuffleNet V2 prediction model includes deformable convolutional layers, max pooling layers, three feature extraction modules with identical structures, a global pooling layer, and a fully connected layer.

[0010] A deformable convolutional layer is input to the soil image, and the output of the deformable convolutional layer is connected to the input of the max pooling layer. The inputs and outputs of the three feature extraction modules are connected sequentially. The input of the first feature extraction module is connected to the output of the max pooling layer, the output of the third feature extraction module is connected to the input of the global pooling layer, the output of the global pooling layer is connected to the input of the fully connected layer, and the output of the fully connected layer outputs the soil type classification result.

[0011] S3. Obtain the soil image to be tested, preprocess the soil image to be tested, and input it into the trained MCP-ShuffleNet V2 prediction model to obtain the soil species classification result of the soil image to be tested.

[0012] Furthermore, the output of the deformable convolutional layer is batch normalized and then processed by the MELU function before being input into the max pooling layer;

[0013] The output of the third feature extraction module is processed by batch normalization, then processed by the MELU function, and finally input into the global pooling layer.

[0014] Furthermore, the MELU function is:

[0015]

[0016] Furthermore, the feature extraction module includes a basic feature module and a downsampling module;

[0017] The input terminal of the basic feature module serves as the input terminal of the feature extraction module, the output terminal of the basic feature module is connected to the input terminal of the downsampling module, and the output terminal of the downsampling module serves as the output terminal of the feature extraction module.

[0018] Furthermore, the basic feature module includes a feature grouping module, a 1×1 convolutional layer I, a CHW attention module I, a 3×3 depthwise separable convolutional layer I, a 1×1 convolutional layer II, a splicing layer I, and a feature fusion module I;

[0019] The feature grouping module divides the input features into two groups. One group is input to the concatenation layer I, and the other group is input to the 1×1 convolutional layer I. The output of the 1×1 convolutional layer I is connected to the CHW attention module I. The output of the CHW attention module I is connected to the input of the 3×3 depth-separable convolutional layer I. The output of the 3×3 depth-separable convolutional layer I is connected to the input of the 1×1 convolutional layer II. The output of the 1×1 convolutional layer II is connected to the input of the concatenation layer I. The output of the concatenation layer I is connected to the input of the feature fusion module I. The output of the feature fusion module I serves as the output of the basic feature module.

[0020] Furthermore, the downsampling module includes a 3×3 depth separable convolutional layer II, a 3×3 depth separable convolutional layer III, a 1×1 convolutional layer III, a 1×1 convolutional layer IV, a 1×1 convolutional layer V, a CHW attention module II, a CHW attention module III, a splicing layer II, and a feature fusion module II;

[0021] The input of the 3×3 depthwise separable convolutional layer II is connected to the output of the feature fusion module I. The output of the 3×3 depthwise separable convolutional layer II is connected to the input of the CHW attention module II. The output of the CHW attention module II is connected to the input of the 1×1 convolutional layer III. The output of the 1×1 convolutional layer III is connected to the input of the stitching layer II. The input of the 1×1 convolutional layer IV is connected to the output of the feature fusion module I. The output of the 1×1 convolutional layer IV is connected to the input of the CHW attention module III. The output of the CHW attention module III is connected to the input of the 3×3 depthwise separable convolutional layer III. The output of the 3×3 depthwise separable convolutional layer III is connected to the input of the 1×1 convolutional layer V. The output of the 1×1 convolutional layer V is connected to the input of the stitching layer II. The output of the stitching layer II is connected to the input of the feature fusion module II. The output of the feature fusion module II serves as the output of the downsampling module.

[0022] Furthermore, the CHW attention module includes a channel attention module, a height attention module, and a width attention module with identical structures;

[0023] The channel attention module includes a global average pooling layer, a fully connected layer, and a sigmoid function.

[0024] The global average pooling layer takes the feature map as input, and its output is connected to a fully connected layer. The output of the fully connected layer is then processed by the sigmoid function before being output.

[0025] The channel attention module outputs channel attention weights, the height attention module outputs height attention weights, and the width attention module outputs width attention weights.

[0026] The input feature map is multiplied by the channel attention weight, height attention weight, and width attention weight, and the result is used as the output of the CHW attention module.

[0027] Furthermore, the loss function of the MCP-ShuffleNet V2 prediction model is:

[0028]

[0029] Where: w i Let N represent the weight of sample i, N represent the number of samples, c represent the number of classes, and p represent the weight of sample i. ij y represents the probability that the i-th sample is predicted to be of class j.ij One-hot encoding of the sample's true label.

[0030] Furthermore, the weight w of sample i is determined using the following method. i :

[0031] Define the recognition error g of the i-th sample. i :

[0032]

[0033] Define the average recognition error μ g :

[0034]

[0035] Define the variance of the identification error σ g :

[0036]

[0037] Calculate the dynamic grouping parameter b for the current batch of samples:

[0038]

[0039] Among them, b min The value is 5, b max The value is 20, b init The value is 10;

[0040] Divide the interval [0,1] into b gradient intervals, with each interval having a boundary of e. r :

[0041]

[0042] Determine the number N of samples in the current batch that fall within the gradient interval. b :

[0043] N b =∑I(e r ≤g i <e r+1 ); where: I(·) represents the indicator function, indicating whether the sample falls within the interval [e r e r+1 )middle;

[0044] Define the weight w of the current sample i n,i :

[0045]

[0046] Determine the number of historical samples a in the gradient interval where sample i is located. t :

[0047] a t =m×a t-1 +(1-m)N b ; m represents the smoothing factor;

[0048] Define the historical weight w of the current i-th sample. h,i :

[0049]

[0050] Define the smoothing coefficient λ:

[0051]

[0052] Determine the weight w i :

[0053] w i =λw h,i +(1-λ)w n,i .

[0054] The beneficial effects of this invention are as follows: In this invention, an attention mechanism with three temperatures—channel, width, and height—is introduced into the neural network, which can effectively suppress the interference of non-soil elements in the soil image, thereby guiding the neural network to focus on key soil areas and ensuring the accuracy of the final identification result.

[0055] By introducing a continuously reachable activation function, which is continuously differentiable in the negative interval, the problem of gradient vanishing in soil images is effectively avoided, ensuring the accuracy of the final recognition result.

[0056] By employing a bidirectional weighted loss function, the neural network's ability to identify minority and difficult-to-classify samples can be enhanced, thereby improving the stability and robustness of the entire neural network. Attached Figure Description

[0057] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0058] Figure 1 This is a schematic diagram of the process of the present invention.

[0059] Figure 2 This is a schematic diagram of the MCP-ShuffleNet V2 prediction model structure of the present invention.

[0060] Figure 3 This is a schematic diagram of the basic feature module structure of the present invention.

[0061] Figure 4 This is a schematic diagram of the downsampling module structure of the present invention.

[0062] Figure 5 This is a schematic diagram of the CHW attention module structure of the present invention.

[0063] Figure 6 This is a comparison chart of the MELU activation function and the ReLU activation function.

[0064] Figure 7 This is a comparison chart of the results of a specific experiment.

[0065] Figure 8 The curve shows the change in accuracy of experimental result 3.

[0066] Figure 9 The figures show the comparison curves of accuracy changes on the validation set for different network structures under Experiment 3.

[0067] Figure 10 Comparison curves showing the accuracy changes of different network structures on the validation set.

[0068] Figure 11 A comparison of the corresponding features under different activation functions.

[0069] Figure 12 The corresponding thermal comparison diagrams for the characteristics of different model stages.

[0070] Figure 13 The results show the confusion matrix comparison of different models on multiple soil classification tasks.

[0071] Figure 14 The results and analysis of soil type prediction. Detailed Implementation

[0072] The present invention will now be described in further detail:

[0073] This invention provides a method for identifying topsoil species based on MCP-ShuffleNet V2, comprising the following steps:

[0074] S1. Obtain sample soil images and preprocess the sample soil images to form a training dataset;

[0075] S2. Construct the MCP-ShuffleNet V2 prediction model and input the training dataset into the MCP-ShuffleNet V2 prediction model for training;

[0076] The MCP-ShuffleNet V2 prediction model includes deformable convolutional layers, max pooling layers, three feature extraction modules with identical structures, a global pooling layer, and a fully connected layer.

[0077] A deformable convolutional layer is input to the soil image, and the output of the deformable convolutional layer is connected to the input of the max pooling layer. The inputs and outputs of the three feature extraction modules are connected sequentially. The input of the first feature extraction module is connected to the output of the max pooling layer, the output of the third feature extraction module is connected to the input of the global pooling layer, the output of the global pooling layer is connected to the input of the fully connected layer, and the output of the fully connected layer outputs the soil type classification result.

[0078] S3. Obtain the soil image to be tested, preprocess the soil image to be tested, and input it into the trained MCP-ShuffleNet V2 prediction model to obtain the soil species classification result of the soil image to be tested.

[0079] The output of the deformable convolutional layer is first processed by batch normalization (BN is used to represent batch normalization in the attached figure), and then processed by the MELU function before being input into the max pooling layer.

[0080] The output of the third feature extraction module is processed by batch normalization, then processed by the MELU function, and finally input into the global pooling layer.

[0081] The MELU function is:

[0082]

[0083] By introducing an attention mechanism with three temperature parameters (channel, width, and height) into the neural network using the above method, interference from non-soil elements in soil images can be effectively suppressed, thereby guiding the neural network to focus on key soil areas and ensuring the accuracy of the final identification result. The loss function described above effectively avoids the death of some neurons, thus preventing the transmission of suppressed features; Figure 6 It is known that the MELU activation function is continuously differentiable in the 0 and negative intervals and has a non-zero gradient, which can alleviate gradient vanishing, greatly reduce neuron death, and ensure that shallow features of the network can be propagated backward.

[0084] By introducing a continuously reachable activation function, which is continuously differentiable in the negative interval, the problem of gradient vanishing in soil images is effectively avoided, ensuring the accuracy of the final recognition result.

[0085] In this embodiment, the feature extraction module includes a basic feature module and a downsampling module;

[0086] The input terminal of the basic feature module serves as the input terminal of the feature extraction module, the output terminal of the basic feature module is connected to the input terminal of the downsampling module, and the output terminal of the downsampling module serves as the output terminal of the feature extraction module.

[0087] Specifically, the basic feature module includes a feature grouping module, a 1×1 convolutional layer I, a CHW attention module I, a 3×3 depthwise separable convolutional layer I, a 1×1 convolutional layer II, a splicing layer I, and a feature fusion module I;

[0088] The feature grouping module divides the input features into two groups. One group is input to the concatenation layer I, and the other group is input to the 1×1 convolutional layer I. The output of the 1×1 convolutional layer I is connected to the CHW attention module I. The output of the CHW attention module I is connected to the input of the 3×3 depth-separable convolutional layer I. The output of the 3×3 depth-separable convolutional layer I is connected to the input of the 1×1 convolutional layer II. The output of the 1×1 convolutional layer II is connected to the input of the concatenation layer I. The output of the concatenation layer I is connected to the input of the feature fusion module I. The output of the feature fusion module I serves as the output of the basic feature module.

[0089] Specifically, before being input into CHW attention module I, the output of 1×1 convolutional layer I undergoes batch normalization and then is processed by the ReLU activation function. Similarly, the output of 1×1 convolutional layer II undergoes batch normalization and then is processed by the ReLU activation function before being input into feature fusion module I.

[0090] The downsampling module includes a 3×3 depth separable convolutional layer II, a 3×3 depth separable convolutional layer III, a 1×1 convolutional layer III, a 1×1 convolutional layer IV, a 1×1 convolutional layer V, a CHW attention module II, a CHW attention module III, a splicing layer II, and a feature fusion module II.

[0091] The input of the 3×3 depthwise separable convolutional layer II is connected to the output of the feature fusion module I. The output of the 3×3 depthwise separable convolutional layer II is connected to the input of the CHW attention module II. The output of the CHW attention module II is connected to the input of the 1×1 convolutional layer III. The output of the 1×1 convolutional layer III is connected to the input of the stitching layer II. The input of the 1×1 convolutional layer IV is connected to the output of the feature fusion module I. The output of the 1×1 convolutional layer IV is connected to the input of the CHW attention module III. The output of the CHW attention module III is connected to the input of the 3×3 depthwise separable convolutional layer III. The output of the 3×3 depthwise separable convolutional layer III is connected to the input of the 1×1 convolutional layer V. The output of the 1×1 convolutional layer V is connected to the input of the stitching layer II. The output of the stitching layer II is connected to the input of the feature fusion module II. The output of the feature fusion module II serves as the output of the downsampling module.

[0092] Specifically, the output of the 3×3 separable convolutional layer II is processed by batch normalization before being input into the CHW attention module II; the output of the 1×1 convolutional layer III is processed by batch normalization and then by the ReLU activation function before being input into the concatenation layer II; the output of the 1×1 convolutional layer IV is processed by batch normalization and then by the ReLU activation function before being input into the CHW attention module III; the output of the 3×3 separable convolutional layer III needs to be processed by batch normalization before being input into the 1×1 convolutional layer V; the output of the 1×1 convolutional layer V is processed by batch normalization and then by the ReLU activation function before being input into the concatenation layer II; batch normalization is represented by Batch Normalization (BN); the feature grouping module and the feature fusion module can both use existing modules in the neural network.

[0093] In this embodiment, the CHW attention module includes a channel attention module, a height attention module, and a width attention module with identical structures;

[0094] The channel attention module includes a global average pooling layer, a fully connected layer, and a sigmoid function.

[0095] The global average pooling layer takes the feature map as input, and its output is connected to a fully connected layer. The output of the fully connected layer is then processed by the sigmoid function before being output.

[0096] The channel attention module outputs channel attention weights, the height attention module outputs height attention weights, and the width attention module outputs width attention weights.

[0097] The input feature map is multiplied by the channel attention weight, height attention weight, and width attention weight, and the result is used as the output of the CHW attention module.

[0098] The CHW attention module has two fully connected layers, each performing a 1×1 convolution operation. The two fully connected layers are connected via the ReLU function.

[0099] The expression for the CHW attention module is:

[0100] M c =σ(Conv2D2(ReLU(Conv2D1(AvgPool(F)))))

[0101] M h =σ(Conv2D2(ReLU(Conv2D1(AvgPool(F)))))

[0102] M w =σ(Conv2D2(ReLU(Conv2D1(AvgPool(F)))));

[0103] Where: M c M h M w Let C, H, and W represent the channel attention weights, height attention weights, and width attention weights, respectively, with dimensions C×1×1, 1×H×1, and 1×1×W; F represents the input feature map, where c, h, and w represent the length, width, and height of the feature map, respectively; Conv2D1 and Conv2D2 represent 1×1 convolution operations, σ is the sigmoid activation function, and F′ represents the weighted fused feature map with the same dimensions as F.

[0104] F' = F·M c ·M h .M w By fusing attention across three dimensions—channel, height, and width—the CHW attention module effectively suppresses interference from non-soil elements and enhances the feature representation of key regions in soil images.

[0105] In this example, the loss function of the MCP-ShuffleNet V2 prediction model is:

[0106]

[0107] Where: w i Let N represent the weight of sample i, N represent the number of samples, c represent the number of classes, and p represent the weight of sample i. ij y represents the probability that the i-th sample is predicted to be of class j. ij One-hot encoding of the sample's true label.

[0108] The weight w of sample i is determined by the following method. i :

[0109] Define the recognition error g of the i-th sample. i :

[0110]

[0111] Define the average recognition error μ g :

[0112]

[0113] Define the variance of the identification error σ g :

[0114]

[0115] Calculate the dynamic grouping parameter b for the current batch of samples:

[0116]

[0117] Among them, b min The value is 5, b max The value is 20, b init The value is 10;

[0118] Divide the interval [0,1] into b gradient intervals, with each interval having a boundary of e. r :

[0119]

[0120] Determine the number N of samples in the current batch that fall within the gradient interval. b :

[0121] N b =∑I(e r ≤g i <e r+1 ); where: I(·) represents the indicator function, indicating whether the sample falls within the interval [e r e r+1 In this context, if the sample error is within the currently set range, the value of the indicator function is counted as 1; otherwise, it is counted as 0.

[0122] Define the weight w of the current sample i n,i :

[0123]

[0124] Determine the number of historical samples a in the gradient interval where sample i is located. t :

[0125] a t =m×a t-1 +(1-m)N b ; m represents the smoothing factor, typically taken as 0.9, a t a represents the number of historical samples in the previous batch within the gradient interval containing sample i. t-1 This represents the number of historical samples in the two preceding batches within the gradient interval containing sample i. For example, if the current batch of samples is the third batch, then a t Let a be the number of samples from the second batch that fall within the gradient interval of sample i in the current batch. t-1 This refers to the number of samples from the first batch that fall within the gradient interval of sample i in the current batch.

[0126] Define the historical weight w of the current i-th sample. h,i :

[0127]

[0128] Define the smoothing coefficient λ:

[0129]

[0130] Determine the weight w i :

[0131] w i =λw h,i +(1-λ)w n,i .

[0132] The invention will be further described in detail below with specific experiments:

[0133] To verify the effectiveness of the MCP-ShuffleNet V2 network, an experiment was designed:

[0134] (1) Experiment 1: Comparison of soil image recognition accuracy between MCP-ShuffleNet V2 and existing mainstream networks

[0135] The effectiveness of the MCP-ShuffleNetV2 network in this paper is verified by comparing the soil species identification accuracy of the improved ShuffleNet V2 with five mainstream networks: Xception (Chollet, 2017), MobileNet V3 (Howard, 2019), RepVGG (Ding, 2021), MobileViT V3 (Wadekar and Chaurasia, 2022), and FasterNet (Chen et al., 2023) on surface soil images.

[0136] (2) Experiment 2: This paper designs an experiment to verify the effectiveness of the CHWA attention mechanism.

[0137] To evaluate the effectiveness of the CHWA attention mechanism in the ShuffleNet V2 network, we selected CBAM, Coordinateattention (CA) (Hou et al., 2021), A simple, parameter-free attention module (SimAM) (Yang, 2021), and Efficient multi-scale attention (EMA) (Ouyang et al., 2023). Each attention mechanism was embedded into stage 2, stage 3, and stage 4 of the ShuffleNet V2 framework, respectively. We compared it with MCP-ShuffleNet V2 embedded with the CHWA attention mechanism to compare their soil species identification accuracy in surface soil images and verify their effectiveness.

[0138] (3) Experiment 3: MCP-ShuffleNet V2 Network Ablation Experiment

[0139] The design uses the ShuffleNet V2 network as a baseline (named "base"), and ablation experiments are conducted by replacing, adding, or removing key modules one by one. On the ShuffleNet V2 network, Conv1 is replaced with DConv to form the Base-DConv network; the Base-MELU network represents partially replacing ReLU with MELU on the ShuffleNet V2 network; the Base-CHWA network represents embedding the CHWA attention mechanism in Stages 2-4; the Base-PGHM network represents replacing cross-entropy with the PGHMC loss function on the ShuffleNet V2 network; the Base-DelConv5 network represents removing Conv5 from the ShuffleNet V2 network; and MCP-ShuffleNetV2 represents a synthesis of all improvement strategies. Complete ablation experiment configuration:

[0140] Table 1. Configuration of the ablation experiment

[0141]

[0142]

[0143] (4) Experiment 4: Visualization Experiment Based on Feature Map, Attention Heatmap and Confusion Matrix

[0144] Feature maps were used to analyze the expressive power of the MELU activation function, heatmaps were used to show the attention of the CHWA attention mechanism to key information regions, and the confusion matrix was used to evaluate the recognition accuracy improvement effect of the PGHMC loss function, thus verifying the scientific rationality of each improvement module.

[0145] Experimental environment and related experimental parameters:

[0146] The hardware environment for all experiments was: Intel(R) Core(TM) i9-14900KF (3.20GHz) processor, 48GB RAM, NVIDIA GeForce RTX 4090 24GB GPU; the software environment was: Windows 10, PyCharm 2024.2, Python 3.10, CUDA 12.0, and PyTorch 2.4.

[0147] The relevant experimental parameters are shown in Table 2:

[0148] Table 2

[0149]

[0150] Evaluation indicators

[0151] Four evaluation metrics—Accuracy, Precision, Recall, and F1-score (Opitz, 2024)—were used to measure the network's recognition performance. FLOPs (Flat Open Rates) were applied. (Maddox et al., 2025) calculate the computational complexity of the ShuffleNet V2 network and Params (Maddox et al., 2020) measure the parameter size of the ShuffleNet V2 network.

[0152] Experimental results and analysis:

[0153] Results and Analysis of Experiment 1

[0154] To verify the effectiveness of the improved network MCP-ShuffleNet V2 in identifying soil species in surface soil images, its soil species identification accuracy was compared with that of five mainstream networks: Xception, MobileNet V3, RepVGG, MobileViT V3, and FasterNet, using the same dataset.

[0155] like Figure 7 As shown, MCP-ShuffleNet V2 achieves an accuracy of 94.59%, a 0.27% improvement over the second-best MobileNet V3; its precision is 94.63%, surpassing MobileNet V3 by 0.29%; its recall and F1-score also reach 94.59% and 94.58% respectively, again ranking as the best performers. This indicates that the improved network MCP-ShuffleNet V2 is effective for soil species identification in surface soil images.

[0156] Table 3 compares the computational complexity and parameter size of the improved MCP-ShuffleNet V2 network for identifying soil species in surface soil images with those of the contrast network.

[0157] Table 3

[0158]

[0159] Note: Best experimental results are shown in bold.

[0160] As shown in Table 3, MCP-ShuffleNet V2 achieves an accuracy of 94.59%, while its computational cost (FLOPs) is only 31M and its parameter count (parameters) is only 0.36M, both significantly lower than other comparative networks. Compared to the lightweight MobileNet V3, FLOPs are reduced by approximately 46.6% and parameter count by approximately 85.8%; compared to FasterNet, which has the highest computational cost, FLOPs are reduced by nearly 99.5%. This demonstrates that MCP-ShuffleNet V2 maintains high accuracy with extremely low computational overhead, proving that its improvement strategy is effective and has potential for lightweight applications.

[0161] Results and Analysis of Experiment 2

[0162] To evaluate the effectiveness of the CHWA attention mechanism in the ShuffleNet V2 network, CBAM, SimAM, CA, EMA, and CHWA attention mechanisms were embedded in ShuffleNet V2 respectively, and soil species identification comparisons were performed on surface soil submap data, as shown in Table 4:

[0163] Table 4

[0164]

[0165] Table 4 shows that adding the CHWA attention mechanism to ShuffleNet V2 achieves a soil species identification accuracy of 94.86% for surface soil submap data, with precision, recall, and F1-score reaching 94.86%, 94.86%, and 94.85%, respectively. Compared to the commonly used CBAM and CA mechanisms, CHWA improves accuracy by 1.03% and accuracy by 0.65% compared to the second-best performing EMA. The CHWA attention mechanism also performs best in other evaluation metrics, indicating its effectiveness for the ShuffleNet V2 network.

[0166] Results and Analysis of Experiment 3

[0167] To verify the performance of the improved strategy for the ShuffleNet V2 network, an ablation experiment, "Experiment 3", was conducted, such as... Figure 8 As shown:

[0168] Figure 8 (a) shows that the Base-DConv network consistently outperformed the Base network in terms of accuracy after 106 rounds, with a final accuracy of 93.35%, which is 0.60% higher than the Base network. This indicates that the introduction of DConv can effectively improve the accuracy of soil type identification. Figure 8(b) shows that the accuracy of the Base-MELU network stabilized after 108 rounds and eventually rose to 93.62%, which is 0.87% higher than that of the Base network. This indicates that the MELU activation function has a stable optimization effect on the performance of the ShuffleNet V2 network and can further improve the soil type identification accuracy.

[0169] Figure 9 (a) shows that the accuracy of the Base-CHWA network on the validation set has been consistently higher than that of the Base network since the 80th round, eventually reaching 94.92%, which is 2.17% higher than that of the Base network. This indicates that the CHWA attention mechanism significantly improves the soil type identification accuracy, especially in the mid-to-late training stage. Figure 9 (b) shows that the Base-PGHM network has a slightly higher validation accuracy than the Base network in most training rounds, with a final accuracy of 93.51%, achieving a growth of 0.76%. Although the performance increase is limited, the addition of the PGHM loss function makes ShuffleNet V2 exhibit better stability during the convergence phase.

[0170] Figure 10 (a) shows that the Base-DelConv5 network has a higher accuracy than the Base network after 101 training rounds, reaching 93.24%, which is 0.49% higher than the Base network. This indicates that removing Conv5 reduces redundant feature interference to some extent, which helps the ShuffleNet V2 network to focus on key information more effectively, thereby improving the soil type identification accuracy. Figure 10 In (b), the MCP-ShuffleNet V2 network gradually surpassed the Base network from round 64 onwards, and finally the accuracy reached 95.02%, which was 2.27% higher than the Base network, proving that the improved network can effectively improve the soil type identification accuracy.

[0171] Table 5

[0172]

[0173] As shown in Table 5, the MCP-ShuffleNet V2 network achieves an accuracy of 94.59%, while its computational cost (FLOPs) is only 31M and its parameter count (parameters) is only 0.36M. Compared to the Base network, MCP-ShuffleNet V2 improves accuracy by approximately 2.11%, reduces FLOPs by approximately 26.7%, and reduces parameter count by approximately 73.7%. Furthermore, compared to Base-CHWA, which has the highest computational cost, MCP-ShuffleNet V2 reduces FLOPs by approximately 28.6% while maintaining high accuracy. This indicates that MCP-ShuffleNet V2 improves soil type identification performance through effective optimization strategies while achieving lightweight design.

[0174] Results and Analysis of Experiment 4

[0175] (1) Results and Analysis of Feature Maps

[0176] To fully demonstrate the impact of activation functions on the extraction of detailed soil features, Experiment 4 shows the changes in feature maps using ReLU and MELU activation functions. Results of Experiment 4 Figure 11 The results show a significant difference between ReLU and MELU in extracting soil detail features. Soil detail maps obtained using ReLU are relatively blurry, while those obtained using MELU exhibit richer texture and particle information.

[0177] Results and Analysis of Heat Map

[0178] To verify the effect of the CHWA attention mechanism on suppressing non-soil features in the soil submap, Experiment 4 shows a comparison of the heatmaps of the Base network and the Base-CHWA network after introducing CHWA in stage 2, stage 3 and stage 4. Figure 12 As shown, in (b), (c), and (d), the attention gradually shifts towards the interfering areas in the image. In contrast, (e) effectively suppresses the response to non-soil areas in the early stages, and (f) and (g) further enhance this suppression effect, focusing on soil areas with rich texture and vivid colors. It is evident that CHWA not only weakens the interference of non-soil elements but also enhances its ability to model discriminative soil features. Specifically: Figure 12 The colors in the text indicate the intensity of online attention: red represents areas of high attention, and blue represents areas of low attention.

[0179] Results and Analysis of the Confusion Matrix

[0180] To evaluate the impact of the PGHMC loss function on the soil species identification performance of the MCP-ShuffleNet V2 network, Experiment 4 shows the comparison results of the confusion matrix of the MCP-ShuffleNet V2 network under the cross-entropy and PGHMC loss functions respectively. Figure 13 In (b), the number of green boxes along the diagonal exceeds the number of red boxes, indicating that PGHMC improves soil type identification accuracy for categories such as Clay Soil, Purple Yellow Clay Soil, and Red Brown Purple Clay Soil. Simultaneously, the number of green boxes outside the diagonal is also greater, suggesting that the PGHMC loss function more effectively reduces category confusion. Its improvement mechanism, by introducing category difficulty awareness and gradient control strategies, guides the network to focus on easily confused and low-frequency categories, thereby enhancing overall recognition robustness and discriminative ability.

[0181] Results and Analysis of Soil Type Prediction

[0182] To verify the performance of MCP-ShuffleNet V2 in the soil subgraph classification task, Figure 14 The prediction results for a subset of samples are shown. The model achieves predictions consistent with the true labels on most images, with confidence levels close to or reaching 1.00, such as the categories Cold Sandy Soil, Purple Tidal Sandy Soil, and Red Stony Bone Soil, demonstrating strong recognition accuracy and stability. Although the prediction confidence levels for Red Brown Purple Clay Soil and Secondary Cay Soil are slightly lower, at 0.85 and 0.93 respectively, the classification results are still correct, indicating that the model has good discriminative ability among categories with similar textures.

[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for identifying topsoil species based on MCP-ShuffleNet V2, characterized in that: Includes the following steps: S1. Obtain sample soil images and preprocess the sample soil images to form a training dataset; S2. Construct the MCP-ShuffleNet V2 prediction model and input the training dataset into the MCP-ShuffleNet V2 prediction model for training; The MCP-ShuffleNet V2 prediction model includes deformable convolutional layers, max pooling layers, three feature extraction modules with identical structures, a global pooling layer, and a fully connected layer. A deformable convolutional layer is input to the soil image, and the output of the deformable convolutional layer is connected to the input of the max pooling layer. The inputs and outputs of the three feature extraction modules are connected sequentially. The input of the first feature extraction module is connected to the output of the max pooling layer, the output of the third feature extraction module is connected to the input of the global pooling layer, the output of the global pooling layer is connected to the input of the fully connected layer, and the output of the fully connected layer outputs the soil type classification result. S3. Obtain the soil image to be tested, preprocess the soil image to be tested, and input it into the trained MCP-ShuffleNetV2 prediction model to obtain the soil species classification result of the soil image to be tested.

2. The surface soil species identification method based on MCP-ShuffleNet V2 according to claim 1, characterized in that: The output of the deformable convolutional layer is batch normalized, then processed by the MELU function and input into the max pooling layer; The output of the third feature extraction module is processed by batch normalization, then processed by the MELU function, and finally input into the global pooling layer.

3. The surface soil species identification method based on MCP-ShuffleNet V2 according to claim 2, characterized in that: The MELU function is:

4. The surface soil species identification method based on MCP-ShuffleNet V2 according to claim 1, characterized in that: The feature extraction module includes a basic feature module and a downsampling module; The input terminal of the basic feature module serves as the input terminal of the feature extraction module, the output terminal of the basic feature module is connected to the input terminal of the downsampling module, and the output terminal of the downsampling module serves as the output terminal of the feature extraction module.

5. The surface soil species identification method based on MCP-ShuffleNet V2 according to claim 4, characterized in that: The basic feature module includes a feature grouping module, a 1×1 convolutional layer I, a CHW attention module I, a 3×3 depthwise separable convolutional layer I, a 1×1 convolutional layer II, a splicing layer I, and a feature fusion module I; The feature grouping module divides the input features into two groups. One group is input to the concatenation layer I, and the other group is input to the 1×1 convolutional layer I. The output of the 1×1 convolutional layer I is connected to the CHW attention module I. The output of the CHW attention module I is connected to the input of the 3×3 depth-separable convolutional layer I. The output of the 3×3 depth-separable convolutional layer I is connected to the input of the 1×1 convolutional layer II. The output of the 1×1 convolutional layer II is connected to the input of the concatenation layer I. The output of the concatenation layer I is connected to the input of the feature fusion module I. The output of the feature fusion module I serves as the output of the basic feature module.

6. The surface soil species identification method based on MCP-ShuffleNet V2 according to claim 5, characterized in that: The downsampling module includes a 3×3 depth separable convolutional layer II, a 3×3 depth separable convolutional layer III, a 1×1 convolutional layer III, a 1×1 convolutional layer IV, a 1×1 convolutional layer V, a CHW attention module II, a CHW attention module III, a splicing layer II, and a feature fusion module II. The input of the 3×3 depthwise separable convolutional layer II is connected to the output of the feature fusion module I. The output of the 3×3 depthwise separable convolutional layer II is connected to the input of the CHW attention module II. The output of the CHW attention module II is connected to the input of the 1×1 convolutional layer III. The output of the 1×1 convolutional layer III is connected to the input of the stitching layer II. The input of the 1×1 convolutional layer IV is connected to the output of the feature fusion module I. The output of the 1×1 convolutional layer IV is connected to the input of the CHW attention module III. The output of the CHW attention module III is connected to the input of the 3×3 depthwise separable convolutional layer III. The output of the 3×3 depthwise separable convolutional layer III is connected to the input of the 1×1 convolutional layer V. The output of the 1×1 convolutional layer V is connected to the input of the stitching layer II. The output of the stitching layer II is connected to the input of the feature fusion module II. The output of the feature fusion module II serves as the output of the downsampling module.

7. The surface soil species identification method based on MCP-ShuffleNet V2 according to claim 6, characterized in that: The CHW attention module includes a channel attention module, a height attention module, and a width attention module with identical structures. The channel attention module includes a global average pooling layer, a fully connected layer, and a sigmoid function. The global average pooling layer takes the feature map as input, and its output is connected to a fully connected layer. The output of the fully connected layer is then processed by the sigmoid function before being output. The channel attention module outputs channel attention weights, the height attention module outputs height attention weights, and the width attention module outputs width attention weights. The input feature map is multiplied by the channel attention weight, height attention weight, and width attention weight, and the result is used as the output of the CHW attention module.

8. The surface soil species identification method based on MCP-ShuffleNet V2 according to claim 1, characterized in that: The loss function of the MCP-ShuffleNet V2 prediction model is: Where: w i Let N represent the weight of sample i, N represent the number of samples, c represent the number of classes, and p represent the weight of sample i. ij y represents the probability that the i-th sample is predicted to be of class j. ij One-hot encoding of the sample's true label.

9. The surface soil species identification method based on MCP-ShuffleNet V2 according to claim 8, characterized in that: The weight w of sample i is determined by the following method. i : Define the recognition error g of the i-th sample. i : Define the average recognition error μ g : Define the variance of the identification error σ g : Calculate the dynamic grouping parameter b for the current batch of samples: Among them, b min The value is 5, b max The value is 20, b init The value is 10; Divide the interval [0,1] into b gradient intervals, with each interval having a boundary of e. r : Determine the number N of samples in the current batch that fall within the gradient interval. b : N b =∑I(e r ≤g i <e r+1 ); where: I(·) represents the indicator function, indicating whether the sample falls within the interval [e r e r+1 )middle; Define the weight w of the current sample i n,i : Determine the number of historical samples a in the gradient interval where sample i is located. t : a t =m×a t-1 +(1-m)N b ; m represents the smoothing factor; Define the historical weight w of the current i-th sample. h,i : Define the smoothing coefficient λ: Determine the weight w i : In i =λw h,i +(1-λ)in n,i 。