A method and system for coupling a lightweight strategy for soil erosion identification

CN121767742BActive Publication Date: 2026-10-27SUN YAT SEN UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511967431.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-10-27
Estimated Expiration
2045-12-24

AI Technical Summary

Technical Problem

[0005]针对所述缺陷,本发明实施例公开了一种耦合轻量化策略进行水土流失识别方法及系统,其能解决现有水土流失黄泥水监测技术中精度低、效率低、细微类别区分能力弱、无法边缘实时部署的缺陷

Benefits of technology

本发明实施例通过知识蒸馏、学生模型不仅学习了数据本身的规律,更深入模仿了教师模型复杂的判别逻辑与特征表示,最终部署的轻量化学生模型达到了接近甚至超越同体量模型从零训练所能达到的精度上限,在黄泥水六分类任务上实现了与庞大教师模型媲美的高准确率,解决了小模型精度低的核心矛盾;教师模型提供的软标签中所蕴含的类别间关系知识以及学生模型中集成的混合注意力机制实现对细微类别的区分,轻量化模型在边缘计算设备上能够实现毫秒级的图像推理速度,足以支持多路视频流的实时分析或高频次的定时监测,满足业务场景对时效性的要求,创造性地将稀疏损失嵌入蒸馏框架,强制模型学习更本质、更简洁的特征表达,从而有效抑制了轻量化模型在小规模数据集上容易过拟合的趋势,提升了模型在未见过的流域、不同光照天气条件下的泛化性能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121767742B_ABST
    Figure CN121767742B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a method and system for identifying soil erosion by coupling a lightweight strategy, comprising the following steps: distributing a plurality of image acquisition devices based on selected target river basins and deployment principles, and collecting yellow mud water image data of the target river basins according to a preset image acquisition rule; constructing a lightweight identification model, wherein the lightweight identification model comprises a teacher model and a student model, and the teacher model is pre-trained based on a yellow mud water image dataset; designing a loss function comprising a classification loss, a distillation loss and a sparsity loss, and training the student model through the loss function based on the pre-trained teacher model; and classifying and deploying the yellow mud water image dataset based on the trained student model. The embodiment realizes the technical effects of high monitoring precision, high efficiency and strong fine classification distinguishing ability of soil erosion yellow mud water.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual and environmental monitoring technology, specifically to a method and system for identifying soil erosion using a coupled lightweight strategy. Background Technology

[0002] Currently, muddy water caused by soil erosion threatens aquatic ecosystems, water quality safety, and watershed management. Its various states (such as normal water bodies, sediment deposition, mild / severe erosion, and mild / severe stratification) are key indicators of soil erosion intensity and urgently require accurate and real-time monitoring.

[0003] Traditional non-intelligent remote sensing techniques, while covering a wide area, have long revisit cycles and cannot capture transient events such as sudden sediment surges; field surveys rely on the experience of technical personnel, require significant manpower and resources, often exclude remote / inaccessible areas, and easily miss potential erosion events; topographic surveying techniques (such as ground laser scanning) have weak ability to identify subtle soil loss in complex agricultural environments and require extremely high data accuracy; modeling methods such as USLE and WEPP rely on flawed plot data and assume independent influencing factors, which does not match the actual watershed conditions and cannot meet the needs of real-time monitoring; radionuclide tracking (such as ¹³ 7 Cs can only estimate long-term erosion rates, cannot capture short-term acute events, and is difficult to support emergency response.

[0004] Existing deep learning technology bottlenecks include the following: While deep learning models in the field of computer vision can extract visual features of yellow mud water (color, texture, and layer boundaries), there is a trade-off between accuracy and efficiency. Large models such as Vision Transformer (ViT) have high classification accuracy, but they have a large number of parameters, long inference time, and require a lot of computing resources, making them unsuitable for deployment on edge devices (such as low-cost cameras). Existing lightweight models (such as the original MobileNetV3-large) have a small number of parameters and short inference time, but they face the problem of low accuracy, especially in distinguishing visually similar categories of yellow mud water (such as mild stratification (SL) and severe stratification (SH), mild erosion (SEL) and severe erosion (SEH), which cannot meet the needs of soil and water loss classification assessment. Summary of the Invention

[0005] To address the aforementioned shortcomings, this invention discloses a method and system for identifying soil erosion using a coupled lightweight strategy. This method overcomes the deficiencies of existing soil erosion monitoring technologies, such as low accuracy, low efficiency, weak ability to distinguish subtle categories, and inability to be deployed in real-time at the edge.

[0006] The first aspect of this invention discloses a method for identifying soil erosion by coupling a lightweight strategy, comprising: A target watershed is selected and a deployment principle is designed. Based on the selected target watershed and the deployment principle, several image acquisition devices are distributed. Yellow mud water image data of the target watershed is collected according to the preset image acquisition rules to form a yellow mud water image dataset. The yellow mud water image dataset includes yellow mud water images corresponding to six types of yellow mud water states. A lightweight recognition model is constructed, comprising a teacher model and a student model. The teacher model is pre-trained based on a yellow muddy water image dataset. The student model is constructed based on an enhanced lightweight convolutional neural network, integrating a hybrid attention module and undergoing structural simplification. The hybrid attention module includes a visual channel attention mechanism for enhancing turbidity features and a spatial attention mechanism for extracting water body stratification boundary features. Design a loss function, which includes classification loss, distillation loss and sparse loss, and train the student model based on the pre-trained teacher model using the loss function; The trained student model is used to classify and deploy the yellow muddy water image dataset. The yellow muddy water image data classified by the student model is randomly selected and its features are extracted for verification and evaluation. The verification and evaluation includes visual verification, confusion matrix verification, and quantitative indicators.

[0007] As an optional implementation, in the first aspect of the present invention, after collecting yellow muddy water image data of the target watershed according to preset image acquisition rules to form a yellow muddy water image dataset, the method further includes: The training set augmentation process is performed on the yellow muddy water image data, which includes size matching, horizontal flipping, color cropping and normalization. The enhanced yellow mud water image data of the training set were divided according to a preset ratio.

[0008] As an optional implementation, in the first aspect of the present invention, the deployment principles include sensitive area coverage, erosion risk classification, and geomorphic unit representativeness; the image acquisition rules include vertical overhead shooting and / or 0°-45° oblique shooting; and the six types of yellow mud water states include normal water body, sediment deposition, light erosion, heavy erosion, light stratification, and heavy stratification.

[0009] As an optional implementation method, in the first aspect of the present invention, the deployment principles include coverage of sensitive areas, erosion risk classification, and representativeness of landform units; the image acquisition rules include vertical overhead shooting and / or 0°-45° oblique shooting; and the six types of yellow mud water states include normal water body, sediment deposition, light erosion, heavy erosion, light stratification, and heavy stratification.

[0010] As an optional implementation, in the first aspect of the present invention, the formula for calculating the classification loss is: N is the batch sample size. For real labels, To predict the probability, the formula for calculating distillation loss is: , Output for students For the teacher's output, temp represents temperature, and KL divergence is used; the formula for calculating the sparsity loss is: , This is a sparse loss.

[0011] As an optional implementation, in the first aspect of the present invention, the formula for calculating distillation loss is: , Output for students For the teacher's output, temp is the temperature, and KL is the divergence.

[0012] As an optional implementation, in the first aspect of the present invention, the structural simplification includes: Remove redundant convolutional layers in the enhanced lightweight convolutional neural network whose muddy water feature is less than a set threshold. Replace the original Bottleneck-Large module in the bottleneck layer with a Bottleneck-Small module or a depthwise separable grouped convolution; The simplified classifier consists of a first fully connected layer, an activation function, a random deactivation layer, and a second fully connected layer connected in sequence. The input dimension of the first fully connected layer is the number of channels at the end, and the output dimension is 64. The input dimension of the second fully connected layer is 64, and the output dimension is 6.

[0013] A second aspect of this invention discloses a system for identifying soil erosion using a coupled lightweight strategy, comprising: Watershed selection module: used to select target watersheds and design deployment principles. Based on the selected target watersheds and the deployment principles, several image acquisition devices are distributed. According to the preset image acquisition rules, the yellow mud water image data of the target watersheds are collected to form a yellow mud water image dataset. The yellow mud water image dataset includes yellow mud water images corresponding to six types of yellow mud water states. Model building module: used to build a lightweight recognition model, which includes a teacher model and a student model. The teacher model is pre-trained based on a yellow muddy water image dataset. The student model is built based on an enhanced lightweight convolutional neural network and integrates a hybrid attention module and performs structural simplification. The hybrid attention module includes a visual channel attention mechanism for enhancing turbidity features and a spatial attention mechanism for extracting water body stratification boundary features. Model optimization module: used to design loss functions, including classification loss, distillation loss and sparse loss, and to train student models based on pre-trained teacher models using the loss functions; The results classification module is used to classify and deploy the yellow muddy water image dataset based on the trained student model. It arbitrarily selects the yellow muddy water image data classified by the student model and extracts features for verification and evaluation. The verification and evaluation includes visual verification, confusion matrix verification, and quantitative indicators.

[0014] As an optional implementation, in the second aspect of the present invention, after collecting yellow muddy water image data of the target watershed according to preset image acquisition rules to form a yellow muddy water image dataset, the method further includes: The training set augmentation process is performed on the yellow muddy water image data, which includes size matching, horizontal flipping, color cropping and normalization. The enhanced yellow mud water image data of the training set were divided according to a preset ratio.

[0015] As an optional implementation, in the second aspect of the present invention, the deployment principles include sensitive area coverage, erosion risk classification, and geomorphic unit representativeness; the image acquisition rules include vertical overhead shooting and / or 0°-45° oblique shooting; and the six types of yellow mud water states include normal water body, sediment deposition, light erosion, heavy erosion, light stratification, and heavy stratification.

[0016] As an optional implementation, in a second aspect of the present invention, the loss function is: ,in For loss function, For classification loss based on real labels, For distillation losses, S For sparsity loss, α is the weight of distillation loss. This represents the sparsity loss coefficient.

[0017] As an optional implementation, in the second aspect of the present invention, the formula for calculating the classification loss is: N is the batch sample size. For real labels, To predict probabilities.

[0018] As an optional implementation, in the second aspect of the present invention, the formula for calculating the classification loss is: N is the batch sample size. For real labels, To predict the probability, the formula for calculating distillation loss is: , Output for students For the teacher's output, temp represents temperature, and KL divergence is used; the formula for calculating the sparsity loss is: , This is a sparse loss.

[0019] As an optional implementation, in a second aspect of the present invention, the structural simplification includes: Remove redundant convolutional layers in the enhanced lightweight convolutional neural network whose muddy water feature is less than a set threshold. Replace the original Bottleneck-Large module in the bottleneck layer with a Bottleneck-Small module or a depthwise separable grouped convolution; The simplified classifier consists of a first fully connected layer, an activation function, a random deactivation layer, and a second fully connected layer connected in sequence. The input dimension of the first fully connected layer is the number of channels at the end, and the output dimension is 64. The input dimension of the second fully connected layer is 64, and the output dimension is 6.

[0020] A third aspect of the present invention discloses an electronic device, comprising: a memory storing executable program code; a processor coupled to the memory; the processor calling the executable program code stored in the memory to execute the method for identifying soil erosion using a coupling lightweight strategy disclosed in the first aspect of the present invention.

[0021] A fourth aspect of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the method for identifying soil erosion using a coupling lightweight strategy disclosed in the first aspect of the present invention.

[0022] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: This invention, through knowledge distillation, allows the student model to not only learn the patterns inherent in the data itself but also deeply mimic the complex discrimination logic and feature representations of the teacher model. The resulting lightweight student model achieves an accuracy close to or even surpasses the upper limit of accuracy achievable by a model of similar size trained from scratch. It achieves high accuracy comparable to a large teacher model on a six-class classification task involving muddy water, resolving the core contradiction of low accuracy in small models. The inter-category relationship knowledge inherent in the soft labels provided by the teacher model, along with the hybrid attention mechanism integrated in the student model, enables the differentiation of subtle categories. The lightweight model achieves millisecond-level image inference speeds on edge computing devices, sufficient to support real-time analysis of multiple video streams or high-frequency timed monitoring, meeting the timeliness requirements of business scenarios. It creatively embeds sparse loss into the distillation framework, forcing the model to learn more essential and concise feature representations, thereby effectively suppressing the tendency of lightweight models to overfit on small datasets and improving the model's generalization performance in unseen watersheds and under different lighting and weather conditions. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a flowchart illustrating a method for identifying soil erosion using a coupled lightweight strategy, as disclosed in an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of a system for identifying soil erosion using a coupled lightweight strategy, provided in an embodiment of the present invention. Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention: Figure 4 This is a feature visualization comparison diagram provided in an embodiment of the present invention; Figure 5 This is a confusion matrix verification diagram provided in an embodiment of the present invention; Figure 6 The ablation test table provided for embodiments of the present invention. Detailed Implementation

[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0026] It should be noted that the terms "first," "second," "third," "fourth," etc., in the specification and claims of this invention are used to distinguish different objects, not to describe a specific order. The terms "comprising" and "having," and any variations thereof, in the embodiments of this invention are intended to cover non-exclusive inclusion. Exemplarily, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.

[0027] This invention discloses a method, system, electronic device, and storage medium for identifying soil erosion using a coupled lightweight strategy. Through knowledge distillation, the student model not only learns the patterns in the data itself but also deeply mimics the complex discrimination logic and feature representation of the teacher model. The resulting lightweight student model achieves an accuracy close to or even exceeding the upper limit of accuracy achievable by a model of similar size trained from scratch. It achieves high accuracy comparable to a large teacher model on a six-class classification task of yellow muddy water, resolving the core contradiction of low accuracy in small models. The inter-category relationship knowledge contained in the soft labels provided by the teacher model and the hybrid attention mechanism integrated in the student model enable the differentiation of subtle categories. The lightweight model can achieve millisecond-level image inference speed on edge computing devices, sufficient to support real-time analysis of multiple video streams or high-frequency timed monitoring, meeting the timeliness requirements of business scenarios. It creatively embeds sparse loss into the distillation framework, forcing the model to learn more essential and concise feature representations, thereby effectively suppressing the tendency of lightweight models to overfit on small datasets and improving the model's generalization performance in unseen watersheds and under different lighting and weather conditions.

[0028] Example 1 Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for identifying soil erosion using a coupled lightweight strategy, as disclosed in an embodiment of the present invention. The execution entity of the method described in this embodiment is an execution entity composed of software and / or hardware. This execution entity can receive relevant information via wired or / or wireless means and can send certain instructions. It may also have certain processing and storage functions. This execution entity can control multiple devices, such as remote physical servers or cloud servers and related software, or local hosts or servers and related software that perform related operations on devices located in a certain location. In some scenarios, multiple storage devices can also be controlled; these storage devices may be placed in the same location as the devices or in different locations. Figure 1 As shown, the method for identifying soil erosion using this coupled lightweight strategy includes the following steps: 101. Select a target watershed and design deployment principles. Based on the selected target watershed and the deployment principles, distribute several image acquisition devices and collect yellow muddy water image data of the target watershed according to preset image acquisition rules to form a yellow muddy water image dataset. The yellow muddy water image dataset includes yellow muddy water images corresponding to six types of yellow muddy water states.

[0029] In this step, 98 smart cameras were deployed in the four major river basins of Jianjiang, Luodingjiang, Yangmeijiang, and Huanghuajiang in Xinyi City, Guangdong Province, according to the principles of covering hydrologically sensitive areas, classifying erosion risks, and representing geomorphic units. A strategy of vertical overhead shots to capture macroscopic stratification / sediment distribution and 30°-45° oblique shots to capture microscopic flow textures was employed, acquiring 2560×1440 resolution images every 10 minutes. Citizen science data was also incorporated, ultimately constructing a dataset containing 3084 valid samples, covering six types of yellow muddy water states: Normal water (NM), clear water with a small amount of sediment; Sedimentary (SD), visible sedimentary layers, slow flow velocity; Slight erosion (SEL), slightly turbid, blurred boundaries; Severe erosion (SEH), intensely turbid, uniform texture; Slight stratification (SL), subtle horizontal gradients between water layers; Severe stratification (SH), clear and sharp boundaries between clear and turbid water layers.

[0030] A high-quality, highly representative database of yellow muddy water images will be established to provide learning resources for subsequent model training. The deployment principle focuses on key areas of sediment transport and deposition, such as river confluences, reservoir inlets, and slope toes. Data points will be set up in areas with different erosion risk levels (e.g., mild, moderate, severe) to ensure data coverage of various erosion intensities and encompass different landforms such as hills, mountains, and riverbanks, enabling the model to adapt to diverse background environments. Specifically, the deployment principles include coverage of sensitive areas, erosion risk classification, and representativeness of landform units. The image acquisition rules include vertical overhead photography and / or oblique photography at 0°-45°. The six types of yellow muddy water states include normal water body, sediment deposition, mild erosion, severe erosion, mild stratification, and severe stratification.

[0031] Vertical overhead shots are used for macroscopic analysis of the spatial distribution of sediment and the thickness of sediment layers; 30°-45° oblique shots can better capture the flow texture, ripples and luster of the water surface, which are key visual cues for judging turbidity and flow state, and greatly enrich the feature dimensions of the data.

[0032] In addition, after collecting yellow muddy water image data of the target watershed according to the preset image acquisition rules to form a yellow muddy water image dataset, the process also includes: performing training set enhancement processing on the yellow muddy water image data, the training set enhancement processing including size matching, horizontal flipping, color cropping and normalization; and dividing the yellow muddy water image data after training set enhancement processing according to a preset ratio.

[0033] Training set augmentation: Implemented using `transforms.Compose`: randomly cropped to 224×224 to fit the model input, randomly flipped horizontally, color jittered (brightness / contrast / saturation ±30%), and normalized (mean [0.485, 0.456, 0.406], standard deviation [0.229, 0.224, 0.225]). By using random cropping, flipping, and color jittering, it simulates real-world lighting changes and shooting angle differences, essentially artificially expanding the data distribution. This is a standard and crucial operation to prevent model overfitting and improve generalization ability. Test / validation set processing: resized to 256×256 and then centered to 224×224, normalized in the same way as the training set. Dataset partitioning: divided into a training set (2159 samples), a validation set (617 samples), and a test set (308 samples) in a 7:2:1 ratio.

[0034] 102. Construct a lightweight recognition model, which includes a teacher model and a student model. The teacher model is pre-trained based on a yellow muddy water image dataset. The student model is constructed based on an enhanced lightweight convolutional neural network and integrates a hybrid attention module and performs structural simplification. The hybrid attention module includes a visual channel attention mechanism for enhancing turbidity features and a spatial attention mechanism for extracting water body stratification boundary features.

[0035] The goal of this step is to design a knowledgeable teacher and student, and first ensure that the teacher is well-versed in the subject and able to guide the student.

[0036] The teacher model, Vision Transformer (ViT-B / 16), serves as the knowledge source for knowledge distillation. It loads ImageNet pre-trained weights and replaces the classification head with nn.Linear(768, 6), adapting to 6 categories. Class token features are extracted during forward propagation for subsequent t-SNE visualization. With 85.9M parameters, it provides high-dimensional semantic knowledge, such as subtle category distinction logic. The student model is an enhanced lightweight MobileNetV3-small (LightMobileNet) based on the MobileNetV3-small architecture, loaded with ImageNet pre-trained weights.

[0037] The output formula of the hybrid attention module is as follows: ,in, This is a hybrid attention mechanism, with CA representing spatial attention and SE representing visual channel attention. The input features are used as input features. Simplification of the structure includes: removing redundant convolutional layers in the enhanced lightweight convolutional neural network where the muddy water feature is less than a set threshold; replacing the original Bottleneck-Large module of the bottleneck layer with a Bottleneck-Small module or a depthwise separable grouped convolution; simplifying the classifier to a first fully connected layer, an activation function, a random deactivation layer, and a second fully connected layer connected in sequence, wherein the input dimension of the first fully connected layer is the number of the last channel, and the output dimension is 64; the input dimension of the second fully connected layer is 64, and the output dimension is 6.

[0038] The student model achieves lightweight and high accuracy through three optimization steps: SE-CA hybrid attention module integration: After the last layer of the MobileNetV3-small feature extraction layer (the number of output channels is base_model.features[-1][0].out_channels), a MixedAttention module is added. The SE channel attention uses AdaptiveAvgPool2d to compress the spatial dimension, and then generates channel weights through two fully connected layers (hidden channel number = max(8, input channel number / 32)) and a Sigmoid function to enhance channels related to turbidity and layer boundaries, while suppressing redundant channels. The CA spatial attention uses AdaptiveAvgPool2d((None,1)) and AdaptiveAvgPool2d((1,None)) to extract horizontal / vertical position information respectively. After concatenation, these are processed by 1×1 convolution, BN, and ReLU to generate horizontal / vertical attention weights, capturing spatial patterns such as layer boundaries and turbidity plumes. The hybrid attention output feature map is first weighted by SE, then weighted by CA, using the following formula: .

[0039] In the embodiment, the SE-CA hybrid attention can also be replaced with CBAM channel-spatial attention + spectral attention. The CBAM module first strengthens the sediment channel through channel attention (global averaging / max pooling + fully connected layer), and then captures texture through spatial attention of 7×7 convolution. Spectral attention dynamically learns the weights of each band through 1×1 convolution to adapt to the differences in sediment spectrum in different watersheds (such as coarse sediment in the Yellow River Basin and fine sediment in the Pearl River Basin), which can achieve the same accuracy (±0.5%), but the number of parameters increases by about 10%.

[0040] The teacher model is first loaded with weights pre-trained on a massive general dataset (ImageNet), at which point the model already possesses strong basic visual feature extraction capabilities. Then, it is fine-tuned using the muddy water training set from step 101, adjusting its parameters through backpropagation to focus on distinguishing six muddy water states, achieving accurate classification across the six categories. The student model undergoes key enhancements through hybrid attention, channel attention, coordinate attention, and structural simplification. Structural simplification involves pruning experiments and replacing bottleneck layers to remove redundant structures that contribute little to the task.

[0041] 103. Design a loss function, which includes classification loss, distillation loss and sparse loss, and train the student model based on the pre-trained teacher model using the loss function.

[0042] The core objective of designing the loss function is to efficiently and compressively transfer the "knowledge" of the teacher model to the student model under the guidance of the composite loss function. Classification loss ensures that the student model's predictions are consistent with the true labels annotated by human experts, guaranteeing basic accuracy. Distillation loss allows the output probability distribution of the student model (smoothed by a temperature coefficient temp) to approximate the output distribution of the teacher model. Sparse loss applies L1 regularization penalty to all weights of the student model, encouraging a large number of weights to tend towards zero. As a strong regularization, it directly combats overfitting, improves generalization ability, and creates a highly sparse internal structure for the model, facilitating subsequent extreme compression. In terms of structural simplification, this includes redundant layer pruning: removing redundant convolutional layers in MobileNetV3-small that contribute less than 1% to the yellow mud water features (verified through ablation experiments); bottleneck layer replacement: replacing the original Bottleneck-Large module with a Bottleneck-Small module to reduce the computational cost of depthwise separable convolutions; and classifier simplification: replacing the original classifier with "nn.Linear (final number of channels, 64) + Hardswish + Dropout (0.2) + nn.Linear (64, 6)", reducing the number of parameters by 78% (from 5.61M to 1.02M). The implementation example pioneers a three-step collaborative optimization of SE-CA hybrid attention + structural simplification + sparse knowledge distillation, which retains ViT-level accuracy (93.23%) while compressing the number of parameters to 1.02M (82 times less than ViT), and shortening the inference time to 5.67ms / frame (1.8 times faster than ViT), breaking through the bottleneck of the accuracy-efficiency trade-off.

[0043] The sparse knowledge distillation in the embodiment can be replaced by mutual information distillation, which replaces L1 sparse regularization by calculating the mutual information of the feature layers of the student and teacher models (maximizing feature correlation). It can also achieve parameter compression (1.1M parameters) and improve accuracy by 1.2% on low-light samples, but increases training time by 20%.

[0044] During training, the teacher model's parameters are fixed and it is in evaluation mode, serving as a stable source of knowledge. During forward propagation, the same batch of images passes through both the teacher and student models simultaneously. The loss module calculates the aforementioned triple losses, and the total loss is obtained after weighted summation. During backpropagation, the gradient only updates the parameters of the student model. Under the triple constraints of imitating the teacher in DistillLoss, answering questions correctly in ClsLoss, and maintaining concise thinking in SparseLoss, the student model continuously optimizes itself, ultimately becoming a high-accuracy model.

[0045] 104. Based on the trained student model, classify and deploy the yellow muddy water image dataset. Randomly select the yellow muddy water image data classified by the student model and extract features for verification and evaluation. The verification and evaluation includes visual verification, confusion matrix verification, and quantitative indicators.

[0046] The purpose of this step is to validate the model's performance and translate it into real-world productivity by conducting a final evaluation of the best-performing student model using an independent test set that has never been involved in any training or hyperparameter tuning. Evaluation metrics should include not only overall accuracy but also precision, recall, and F1 score for each class of muddy water conditions to identify weaknesses in specific classes.

[0047] Combination Figure 4 and Figure 5 The SE-CA hybrid attention design enhances multi-class discrimination capability: The core of the model is embedded with the SE-CA hybrid attention module, in which SE channel attention prioritizes strengthening the visual channels related to turbidity of mud and sand, and CA spatial attention captures spatial patterns such as layer boundaries. This solves the limitation of single attention in recognizing subtle categories, reducing the number of misclassified samples of mild / severe stratification (SL / SH) to 2 (far lower than the 6-21 misclassified samples of the unoptimized model), achieving accurate differentiation of 6 types of yellow muddy water (NM / SD / SEL / SEH / SL / SH), and significantly improving the robustness of multi-class recognition.

[0048] The implementation example achieves a balance between accuracy and lightweight design through a simplified structure and sparse distillation. Based on the simplified structure of MobileNetV3-large, redundant layers are removed and replaced with Bottleneck-Small modules. Combined with the sparse distillation design that transfers knowledge from ViT, the number of model parameters is compressed to 1.02M, which is 82 times less than ViT, and the inference time is shortened to 5.67ms / frame, which is 1.8 times faster than ViT, while maintaining an accuracy of 93.23%, close to ViT's 93.55%. This achieves a balance between laboratory accuracy and edge deployment efficiency, breaking through the accuracy bottleneck of lightweight models.

[0049] Multi-dimensional evaluation enhances model credibility: During the model design phase, t-SNE feature visualization (verifying the high consistency between feature clustering and ViT), confusion matrix (quantifying misclassification patterns), and multiple indicators such as accuracy, weighted precision (93.11%), and weighted F1 (93.13%) are simultaneously applied to evaluate the model, clearly presenting the model recognition logic, avoiding the "black box" problem, and improving transparency and credibility in engineering applications.

[0050] In step 101 of the embodiment, the question of "what to learn" is addressed, thus determining the quality and scope of the collected data. Step 102 addresses the question of "who teaches and who uses," designing a teacher model to train the student model, which improves the accuracy of the student model. The student model is low-cost and easy to use. Step 103 addresses the question of "how the teacher model guides the student model." Through the core technology of knowledge distillation, the long-standing contradiction between recognition accuracy and implementation cost / efficiency is cleverly balanced, providing a practical and feasible technical path for the intelligent, large-scale, and routine monitoring of soil erosion.

[0051] Example 2 Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of a system for identifying soil erosion using a coupled lightweight strategy, as disclosed in an embodiment of the present invention. Figure 2As shown, the system for identifying soil erosion using a coupled lightweight strategy may include: a watershed selection module 201, a model building module 202, a model building module 203, and a result classification module 204. The watershed selection module 201 selects target watersheds and designs deployment principles. Based on the selected target watersheds and the deployment principles, several image acquisition devices are distributed, and muddy water image data of the target watersheds are collected according to preset image acquisition rules to form a muddy water image dataset. The muddy water image dataset includes muddy water images corresponding to six different muddy water states. The model building module 202 constructs a lightweight identification model, which includes a teacher model and a student model. The teacher model is pre-trained based on the muddy water image dataset. The student model is constructed based on an enhanced lightweight convolutional neural network and integrates a hybrid attention module and a result classification module. The structure is simplified; the hybrid attention module includes a visual channel attention mechanism for enhancing turbidity features and a spatial attention mechanism for extracting water body stratification boundary features; the model optimization module 203 is used to design a loss function, which includes classification loss, distillation loss and sparsity loss, and trains the student model based on the pre-trained teacher model using the loss function; the result classification module 204 is used to classify and deploy the yellow muddy water image dataset based on the trained student model, arbitrarily select the yellow muddy water image data classified by the student model and extract features for verification and evaluation, which includes visual verification, confusion matrix verification and quantitative indicators.

[0052] After the watershed selection module 201 collects yellow muddy water image data of the target watershed according to the preset image acquisition rules to form a yellow muddy water image dataset, it also includes: performing training set enhancement processing on the yellow muddy water image data, the training set enhancement processing including size matching, horizontal flipping, color cropping and normalization; and dividing the yellow muddy water image data after training set enhancement processing according to a preset ratio.

[0053] Regarding the deployment principles, the implementation examples include sensitive area coverage, erosion risk classification, and representativeness of geomorphic units. The image acquisition rules include vertical overhead shots and / or 0°-45° oblique shots. The six types of yellow mud water states include normal water bodies, sediment deposition, mild erosion, severe erosion, mild stratification, and severe stratification.

[0054] The loss function is ,in For loss function, For classification loss based on real labels, For distillation losses, S For sparsity loss, α is the weight of distillation loss. This represents the sparsity loss coefficient. Furthermore, the formula for calculating the classification loss is: N is the batch sample size. For real labels, To predict the probability, the formula for calculating distillation loss is: , Output for students For the teacher's output, temp represents temperature, and KL divergence is used. The formula for calculating the sparsity loss is: , This is a sparse loss.

[0055] The output formula of the hybrid attention module is: ,in, This is a hybrid attention mechanism, with CA representing spatial attention and SE representing visual channel attention. The input features are used as input features. Simplification of the structure includes: removing redundant convolutional layers in the enhanced lightweight convolutional neural network where the muddy water feature is less than a set threshold; replacing the original Bottleneck-Large module of the bottleneck layer with a Bottleneck-Small module or a depthwise separable grouped convolution; simplifying the classifier to a first fully connected layer, an activation function, a random deactivation layer, and a second fully connected layer connected in sequence, wherein the input dimension of the first fully connected layer is the number of the last channel, and the output dimension is 64; the input dimension of the second fully connected layer is 64, and the output dimension is 6.

[0056] Combination Figure 6 The experimental table and implementation examples, through a systematic and innovative design, successfully broke through the traditional dilemma of the trade-off between accuracy and efficiency in AI models. They produced a model that excels in laboratory metrics, rivals large-scale models in accuracy, meets the efficiency requirements for edge deployment, and adapts to complex environments in generalization. Ultimately, this effectively promoted a profound transformation in soil erosion monitoring from traditional methods to intelligent, precise, and routine approaches. A lightweight strategy was adopted to overcome the bottleneck in balancing accuracy and efficiency, achieving accurate multi-category identification. Example 3 Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. The electronic device can be a computer, a server, etc. Of course, in certain cases, it can also be a mobile phone, tablet computer, monitoring terminal, or other smart device, as well as an image acquisition device with processing capabilities. Figure 3 As shown, the electronic device may include: Memory 301 storing executable program code; Processor 302 coupled to memory 301; The processor 302 calls the executable program code stored in the memory 301 to execute some or all of the steps in the method for identifying soil erosion using the coupling lightweight strategy in Embodiment 1.

[0057] This invention discloses a computer-readable storage medium storing a computer program that causes a computer to perform some or all of the steps in the method for identifying soil erosion using a coupled lightweight strategy as described in Embodiment 1.

[0058] This invention also discloses a computer program product, wherein when the computer program product is run on a computer, the computer executes some or all of the steps in the method for identifying soil erosion using a coupled lightweight strategy in Embodiment 1.

[0059] This invention also discloses an application publishing platform, which is used to publish computer program products. When the computer program products are run on a computer, the computer executes some or all of the steps in the method for identifying soil erosion using a coupled lightweight strategy in Embodiment 1.

[0060] In various embodiments of the present invention, it should be understood that the sequence number of each process does not necessarily imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0061] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they can be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0062] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0063] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several requests to cause a computer device (which can be a personal computer, server, or network device, specifically a processor in the computer device) to execute some or all of the steps of the methods described in the various embodiments of the present invention.

[0064] In the embodiments provided by this invention, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.

[0065] Those skilled in the art will understand that some or all of the steps in the various methods of the embodiments described can be implemented by a program instructing related hardware. This program can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

[0066] The foregoing has provided a detailed description of the method, system, electronic device, and storage medium for identifying soil erosion using a coupling lightweight strategy disclosed in the embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for identifying soil erosion using a coupled lightweight strategy, characterized in that, include: A target watershed is selected and a deployment principle is designed. Based on the selected target watershed and the deployment principle, several image acquisition devices are distributed. Yellow muddy water image data of the target watershed are collected according to the preset image acquisition rules to form a yellow muddy water image dataset. The yellow muddy water image dataset includes yellow muddy water images corresponding to six types of yellow muddy water states. A lightweight recognition model is constructed, comprising a teacher model and a student model. The teacher model is pre-trained based on a yellow muddy water image dataset. The student model is built based on an enhanced lightweight convolutional neural network, integrating a hybrid attention module and undergoing structural simplification. The hybrid attention module includes a visual channel attention mechanism for enhancing turbidity features and a spatial attention mechanism for extracting water body stratification boundary features. The output formula of the hybrid attention module is as follows: ,in, This is a hybrid attention mechanism, with CA representing spatial attention and SE representing visual channel attention. For input features; Design a loss function that is a weighted sum of classification loss, distillation loss, and sparse loss, and train the student model using the loss function based on the pre-trained teacher model; The trained student model is used to classify and deploy the yellow muddy water image dataset. The yellow muddy water image data classified by the student model is randomly selected and its features are extracted for verification and evaluation. The verification and evaluation includes visual verification, confusion matrix verification, and quantitative indicators.

2. The method according to claim 1, characterized in that, After collecting yellow muddy water image data of the target watershed according to preset image acquisition rules to form a yellow muddy water image dataset, the process further includes: The training set augmentation process is performed on the yellow muddy water image data, which includes size matching, horizontal flipping, color cropping and normalization. The enhanced yellow mud water image data of the training set were divided according to a preset ratio.

3. The method according to claim 1, characterized in that, The deployment principles include sensitive area coverage, erosion risk classification, and representativeness of geomorphic units. The image acquisition rules include vertical overhead shooting and / or 0°-45° oblique shooting. The six types of yellow mud water states include normal water body, sediment deposition, light erosion, heavy erosion, light stratification, and heavy stratification.

4. The method according to claim 1, characterized in that, The loss function is: ,in For loss function, For classification loss based on real labels, For distillation loss, For sparsity loss, α is the weight of distillation loss. This represents the sparsity loss coefficient.

5. The method according to claim 4, characterized in that, The formula for calculating classification loss is: N is the batch sample size. For real labels, To predict the probability, the formula for calculating distillation loss is: , Output for students For the teacher's output, temp represents temperature, and KL divergence is used; the formula for calculating the sparsity loss is: , This is a sparse loss.

6. The method according to claim 1, characterized in that, The structural simplification includes: Remove redundant convolutional layers in the enhanced lightweight convolutional neural network whose muddy water feature is less than a set threshold. Replace the original Bottleneck-Large module in the bottleneck layer with a Bottleneck-Small module or a depthwise separable grouped convolution; The simplified classifier consists of a first fully connected layer, an activation function, a random deactivation layer, and a second fully connected layer connected in sequence. The input dimension of the first fully connected layer is the number of channels at the end, and the output dimension is 64. The input dimension of the second fully connected layer is 64, and the output dimension is 6.

7. A system for identifying soil erosion using a coupled lightweight strategy, characterized in that, include: Watershed selection module: used to select target watersheds and design deployment principles. Based on the selected target watersheds and the deployment principles, several image acquisition devices are distributed. According to the preset image acquisition rules, the yellow mud water image data of the target watersheds are collected to form a yellow mud water image dataset. The yellow mud water image dataset includes yellow mud water images corresponding to six types of yellow mud water states. Model building module: Used to construct a lightweight recognition model, which includes a teacher model and a student model. The teacher model is pre-trained based on a yellow muddy water image dataset. The student model is built based on an enhanced lightweight convolutional neural network, integrating a hybrid attention module and undergoing structural simplification. The hybrid attention module includes a visual channel attention mechanism for enhancing turbidity features and a spatial attention mechanism for extracting water body stratification boundary features. The output formula of the hybrid attention module is as follows: ,in, This is a hybrid attention mechanism, with CA representing spatial attention and SE representing visual channel attention. For input features; Model optimization module: used to design loss functions, including classification loss, distillation loss and sparse loss, and to train student models based on pre-trained teacher models using the loss functions; The results classification module is used to classify and deploy the yellow muddy water image dataset based on the trained student model. It arbitrarily selects the yellow muddy water image data classified by the student model and extracts features for verification and evaluation. The verification and evaluation includes visual verification, confusion matrix verification, and quantitative indicators.

8. An electronic device, characterized in that, include: Memory containing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the method for identifying soil erosion using the coupling lightweight strategy as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program causes a computer to perform the method for identifying soil erosion using the coupled lightweight strategy as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • ViT distillation training method, system and device and readable storage medium

    CN119129701A