U-Net loess plateau terrace boundary refined extraction method fused with terrain gradient constraint

Through the U-Net method that integrates terrain gradient and texture features, combined with environmental state coding and slope constraints, the problem of insufficient accuracy of terraced boundary extraction in complex terrain of the Loess Plateau is solved, and boundary recognition with higher accuracy and environmental adaptability is achieved.

CN120429565APending Publication Date: 2025-08-05YELLOW RIVER INST OF HYDRAULIC RES YELLOW RIVER CONSERVANCY COMMISSION
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510408356.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-02
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

The existing U-Net model is difficult to accurately extract terrace boundaries under complex terrain conditions of the Loess Plateau, especially in areas with loss of spatial location information and severe slope changes, which leads to insufficient boundary positioning accuracy.

Method used

The U-Net method that integrates terrain gradient constraints is used to obtain and standardize remote sensing images, DEM and meteorological data, calculate terrain gradients and texture morphological characteristics, generate environmental state encodings, combine regional priors and partition masks, and optimize boundary recognition by using attention guidance mechanisms and slope consistency constraints.

Benefits of technology

It improves the accuracy of terraced boundary recognition and environmental adaptability, reduces boundary extraction errors, and enhances the model's adaptability under complex terrain conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120429565A_ABST
    Figure CN120429565A_ABST
Patent Text Reader

Abstract

The invention discloses a U-Net loess plateau terrace boundary refined extraction method fusing terrain gradient constraints. The method comprises the steps of obtaining and preprocessing a remote sensing image, a DEM and meteorological data; extracting terrain gradient and texture morphological characteristics, and generating environment state codes; calculating feature weights based on environment states, and fusing to form a feature set; generating a region priori image and a region division mask by using DEM and environment coding; inputting the fusion features into a U-Net network, and enhancing boundary features through an attention guidance mechanism; and carrying out boundary regularization by utilizing slope direction consistency constraint, and outputting a terrace boundary. The problem of terrace boundary confusion under the loess plateau complex terrain condition is effectively solved, and the boundary precision and the environmental adaptability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of geographic information systems, and in particular to a U-Net Loess Plateau terrace boundary refinement extraction method integrating terrain gradient constraints. Background Art

[0002] The terraces on the Loess Plateau are a crucial soil and water conservation project in northern China. Accurately extracting terrace boundaries is crucial for assessing soil and water conservation effectiveness, monitoring agricultural production, and assessing ecological restoration. Refined extraction of terrace boundaries is fundamental for agricultural resource surveys, land use change analysis, and soil erosion assessment. It holds significant scientific value and application prospects for regional sustainable development and ecological and environmental protection. As a unique artificial landform on the Loess Plateau, accurate identification and detailed extraction of terraces are crucial for regional food security assessments, farmland water conservancy development, and ecological and environmental restoration.

[0003] Currently, remote sensing image interpretation is the primary method for terrace boundary extraction, and studies have attempted various automated and semi-automated methods. Traditional remote sensing interpretation methods often use pixel-based classification or object-oriented segmentation methods, such as maximum likelihood and support vector machines. With the development of deep learning technology, some studies have begun to explore the use of neural network models such as CNN and FCN for terrace boundary extraction. U-Net, a classic image segmentation network, is widely used due to its skip connection structure that effectively integrates high- and low-level features. Some studies have attempted to combine DEM data and use terrain factors such as elevation and slope as auxiliary features for terrace identification, achieving certain results. These methods perform well in terrace boundary extraction in plains and hilly areas, but still face many challenges in complex terrain conditions.

[0004] However, the unique topographic conditions and complex and ever-changing surface features of the Loess Plateau place higher demands on the refined extraction of terrace boundaries. Existing U-Net models face significant technical bottlenecks in extracting terrace boundaries on the Loess Plateau: first, spatial position information is gradually lost as the convolutional layer deepens during upsampling, resulting in insufficient boundary positioning accuracy; second, in areas with large terrain undulations and drastic slope changes, the model has difficulty distinguishing the transition between terraces and natural slopes. These technical issues severely impact the accuracy and practicality of terrace boundary extraction on the Loess Plateau. A new refined terrace boundary extraction method that can incorporate terrain gradient constraints and possess environmental adaptability is urgently needed. Summary of the Invention

[0005] The purpose of the invention is to provide a U-Net method for fine-tuning the boundaries of terraces on the Loess Plateau that integrates terrain gradient constraints, in order to solve at least one technical problem existing in the prior art.

[0006] The technical solution is to integrate the U-Net method for extracting the boundaries of terraces on the Loess Plateau with terrain gradient constraints, which includes the following steps:

[0007] Acquire and standardize the data of the study area to obtain standardized data, including standardized remote sensing image data, DEM data and meteorological data;

[0008] Based on standardized data, terrain gradient features are calculated, texture morphological features are extracted, and environmental state codes are generated; terrain gradient features are fused with texture morphological features to form a fused feature set;

[0009] Generate a regional prior map based on standardized DEM data and environmental state coding, and divide high and low gradient areas into regional division masks according to terrain gradient values;

[0010] The fused feature set is input into the U-Net network for processing, and the feature map is generated by attention-guided feature fusion combined with the region prior map and the region partition mask;

[0011] The terrace boundaries are extracted based on the feature map, and the slope information in the standardized DEM data is used to regularize the boundaries to generate terrace boundary vector data.

[0012] According to one aspect of the present application, the step of calculating terrain gradient characteristics includes:

[0013] Calculate the horizontal and vertical gradients of the standardized DEM data;

[0014] Calculate the gradient direction based on the horizontal gradient and the vertical gradient;

[0015] The standardized DEM data is smoothed with Gaussian smoothing of different scale parameters and then the gradient is calculated to obtain a multi-scale gradient feature set.

[0016] The multi-scale gradient feature set is combined with the gradient direction to construct the terrain gradient feature.

[0017] According to one aspect of the present application, the step of extracting texture morphological features includes:

[0018] Calculate local binary pattern features of different radii for standardized remote sensing image data to obtain a local binary pattern feature set;

[0019] Apply opening and closing morphological operations to the standardized remote sensing image data to obtain a set of morphological features;

[0020] The local binary pattern feature set is combined with the morphological feature set to construct texture morphological features.

[0021] According to one aspect of the present application, the steps of generating an environmental state code and forming a fusion feature set include:

[0022] Extract seasonal and meteorological characteristics from standardized meteorological data and construct environmental state codes;

[0023] Calculate terrain gradient feature weights and texture morphological feature weights based on environmental state encoding;

[0024] According to the weight of terrain gradient features and texture morphology features, the terrain gradient features and texture morphology features are weightedly fused to generate a fusion feature set.

[0025] According to one aspect of the present application, the steps of generating a region prior map and forming a region partition mask include:

[0026] Extract slope and aspect maps from standardized DEM data;

[0027] The slope map, aspect map and environmental state code are fused to generate a priori feature map;

[0028] Calculate the prior probability of the prior feature map to generate a regional prior map;

[0029] The terrain gradient value is calculated based on the standardized DEM data, and the high and low gradient areas are divided by the adaptive threshold method to form a regional division mask.

[0030] According to one aspect of the present application, the step of inputting the fused feature set into the U-Net network for processing and generating a feature map includes:

[0031] The fused feature set is input into the U-Net encoder for multi-layer feature extraction to obtain multi-scale encoder features;

[0032] Based on the multi-scale encoder features, the underlying features of the encoder are input into the U-Net decoder for multi-layer feature recovery to obtain the multi-scale decoder features;

[0033] Combined with the regional prior map, spatial attention calculation and channel attention calculation are performed on the multi-scale encoder features and multi-scale decoder features, and attention-enhanced features are generated through weighted fusion;

[0034] The attention enhancement features are regionally adaptively processed according to the region partition mask to generate a feature map.

[0035] According to one aspect of the present application, the steps of extracting terrace boundaries based on the feature map and generating terrace boundary vector data include:

[0036] Perform threshold segmentation and edge detection on the feature map to extract the initial boundary map;

[0037] Combine the feature map to enhance the boundary features of the initial boundary map and generate an enhanced boundary map;

[0038] Extract aspect information from standardized DEM data and apply aspect consistency constraints to the enhanced boundary map to generate an aspect-constrained boundary map.

[0039] Apply conditional random field optimization and boundary smoothing to the aspect constraint boundary map to generate a regularized boundary map;

[0040] The regularized boundary map is converted from raster to vector and topologically checked and repaired to generate the final terrace boundary vector data.

[0041] According to one aspect of the present application, the steps of calculating terrain gradient feature weights and texture morphology feature weights include:

[0042] Perform feature mapping transformation on terrain gradient features, texture morphology features and environmental state coding to obtain mapped terrain features and mapped texture features;

[0043] Calculate the conditional attention matrix of mapped terrain features and mapped texture features based on the environment state encoding;

[0044] Perform global average pooling and normalization on the conditional attention matrix to generate terrain gradient feature weights and texture morphology feature weights;

[0045] The terrain gradient feature weight and the texture morphology feature weight are dynamically adjusted according to the environment state coding to obtain the adjusted terrain gradient feature weight and the texture morphology feature weight.

[0046] According to one aspect of the present application, the steps of performing spatial attention calculation and channel attention calculation to generate attention enhancement features include:

[0047] Convolve the multi-scale encoder features, multi-scale decoder features with the region prior map to calculate the spatial attention map;

[0048] Perform global average pooling and maximum pooling on the multi-scale encoder features and multi-scale decoder features, and calculate the channel attention vector after processing by a multi-layer perceptron;

[0049] Use spatial attention maps to weight the spatial dimensions of multi-scale encoder features to generate spatially weighted features;

[0050] Use the channel attention vector to weight the spatial weighted features in the channel dimension to generate channel weighted features;

[0051] Generate feature modulation weights based on environmental state coding, perform environmental adaptive modulation on channel weighted features, and generate environmental modulation features;

[0052] The environmental modulation features are fused and accumulated with the multi-scale decoder features to generate attention-enhanced features.

[0053] According to one aspect of the present application, applying the aspect consistency constraint to the enhanced boundary map to generate the aspect-constrained boundary map includes:

[0054] Calculate aspect angle map and aspect gradient map based on standardized DEM data;

[0055] Extract the terrace boundary direction and morphological features from the enhanced boundary map to generate a boundary direction map;

[0056] Based on the aspect angle map, aspect gradient map and boundary direction map, the consistency measure map between the boundary and the aspect is calculated;

[0057] According to the consistency metric map, consistency constraints are applied to the enhanced boundary map, and the boundaries that do not conform to the distribution pattern of terraces along the contour lines are corrected to generate the aspect-constrained boundary map.

[0058] Beneficial effects: The present invention combines terrain gradient information with texture morphological features to improve boundary recognition accuracy based on the special terrain characteristics of the Loess Plateau terraces; combines environmental status with terrain information to generate dynamic priors to guide model attention allocation and improve boundary recognition rate under extreme weather conditions; effectively solves the terrace boundary confusion problem under complex terrain conditions of the Loess Plateau, and improves boundary accuracy and environmental adaptability. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 A flowchart of the steps of a U-Net method for extracting the boundaries of terraces on the Loess Plateau that integrates terrain gradient constraints is provided in an embodiment of the present application.

[0060] Figure 2 A flowchart of the steps for calculating terrain gradient characteristics provided in an embodiment of the present application.

[0061] Figure 3 A flowchart of the steps for extracting texture morphological features provided in an embodiment of the present application.

[0062] Figure 4 A flowchart of the steps for generating environmental state codes and forming a fusion feature set provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0064] It should be noted that to clearly illustrate the steps of this application, serial numbers are assigned to each step in the specification. These serial numbers are for illustrative purposes only and do not limit the order in which the steps must be executed. In actual operation, depending on the technical requirements of the specific implementation scenario, the steps may be executed in a different order than shown in the specification, and in some cases, parallel processing between steps may be implemented.

[0065] like Figure 1 As shown in Figure 1, the U-Net Loess Plateau terrace boundary refinement method integrated with terrain gradient constraints includes the following steps:

[0066] S1. Acquire and standardize the data of the study area to obtain standardized data;

[0067] Specifically, the study area data includes remote sensing imagery, DEM data, and meteorological data. Remote sensing imagery is surface information obtained from satellite or aerial imagery; digital elevation model (DEM) data describes the topographical variations in the study area; and meteorological data includes weather and climate information for the study area. The collected data is standardized to ensure consistency and comparability across different sources. This includes converting the data into a specified format, range, or scale to avoid problems in subsequent analysis due to data discrepancies.

[0068] S2. Based on the standardized data, calculate the terrain gradient features, extract the texture morphology features, and generate the environment state code; fuse the terrain gradient features with the texture morphology features to form a fusion feature set;

[0069] Specifically, the study area's topographical variations are analyzed, such as slope steepness and elevation trends. This information can reflect the complexity of the terrain. Texture and shape features, such as roughness, smoothness, and edge morphology, are observed and extracted from images of the study area. These features describe the surface properties of the area. Environmental conditions (such as climate and topography) in the study area are summarized and quantified to form a digital "label" or "code" that facilitates the expression of environmental conditions.

[0070] S3, generating a regional prior map based on standardized DEM data and environmental state coding, and dividing high and low gradient areas according to terrain gradient values to form a regional division mask;

[0071] Specifically, generating a regional prior map involves creating a base map that depicts the topography and environment of the study area, reflecting the region's geomorphic and environmental characteristics. The terrain's gradient (slope) is analyzed, and the region is divided into "high-gradient" and "low-gradient" areas based on steepness. To facilitate labeling and processing, a regional "mask" is generated. This "mask" is a digital tool that clearly identifies different area types.

[0072] S4, input the fused feature set into the U-Net network for processing, and generate a feature map through attention-guided feature fusion by combining the region prior map and the region partition mask;

[0073] Specifically, the U-Net network is a deep learning model specifically designed for image processing, capable of efficiently extracting important information from images. Combining a priori regional maps with region-partitioning masks provides additional guidance to the deep learning model, helping it better understand the characteristics of different regions. Using an attention mechanism, the model focuses on specific regions or features, improving analysis accuracy. Ultimately, a comprehensive feature map is generated that fully describes the topography, texture, and environmental characteristics of the study area.

[0074] S5. Extract the terrace boundaries based on the feature map, and use the slope information in the standardized DEM data to regularize the boundaries to generate terrace boundary vector data.

[0075] Specifically, feature maps are used to identify the boundaries of terraces (i.e., the boundaries separating terraces from other areas). These initially extracted boundaries may contain irregularities or inaccuracies. Using aspect information (the direction of the terrain surface) from standardized DEM data, these initially extracted boundaries are optimized. For example, jagged or uneven areas are removed to make them more uniform and natural.

[0076] This embodiment achieves high-precision recognition of terrace boundaries by fusing terrain gradient features and texture morphological features, and using a deep learning network (U-Net). This allows for more accurate and detailed extraction results. It also achieves effective fusion of multidimensional data, fully leveraging the advantages of various types of data to ensure the scientific nature and reliability of the extraction results. It effectively reduces errors in terrace boundary extraction, making the model more adaptable to complex terrain. It enables the deep learning model to focus on key areas or important features, further improving extraction efficiency and result quality.

[0077] According to one aspect of the present application, the steps of acquiring and standardizing the study area data to obtain standardized data include:

[0078] S11. Obtain data on the study area, including multi-temporal remote sensing images, topographic data, and meteorological data;

[0079] S12, performing atmospheric correction and registration processing on the multi-temporal remote sensing images to obtain standardized remote sensing image data;

[0080] S13, using the terrain data to calculate terrain parameters, including slope, aspect, and terrain relief, to form standardized DEM data;

[0081] S14. Combine the standardized remote sensing image data, DEM data and meteorological data to obtain standardized data.

[0082] like Figure 2 As shown, according to one aspect of the present application, the step of calculating terrain gradient characteristics includes:

[0083] Calculate the horizontal and vertical gradients of the standardized DEM data;

[0084] Calculate the gradient magnitude and gradient direction based on the horizontal gradient and the vertical gradient;

[0085] The standardized DEM data is smoothed with Gaussian smoothing of different scale parameters and then the gradient is calculated to obtain a multi-scale gradient feature set.

[0086] The multi-scale gradient feature set is combined with the gradient direction to construct the terrain gradient feature.

[0087] like Figure 3 As shown, according to one aspect of the present application, the step of extracting texture morphological features includes:

[0088] Calculate local binary pattern features of different radii for standardized remote sensing image data to obtain a local binary pattern feature set;

[0089] Apply opening and closing morphological operations to the standardized remote sensing image data to obtain a set of morphological features;

[0090] The local binary pattern feature set is combined with the morphological feature set to construct texture morphological features.

[0091] This embodiment can capture multi-scale texture information in remote sensing images, reflecting the microstructure and variation patterns of surface features. It applies morphological operations, such as opening and closing, to remove noise, smooth boundaries, and highlight important morphological structural features, making the processed image information more layered and stable. It also constructs a feature set that integrates texture and morphological information, providing the model with a more comprehensive and accurate feature description, helping to improve the performance of classification or detection tasks. It effectively enhances adaptability to different types of surface features, especially in complex or highly variable environments, and can improve the robustness and accuracy of recognition.

[0092] During the vegetation cover season, the model's ability to distinguish terrace boundaries from vegetation areas significantly decreases, and the error rate increases. Figure 4 As shown, according to one aspect of the present application, the steps of generating an environment state code and forming a fusion feature set include:

[0093] Extract seasonal and meteorological characteristics from standardized meteorological data and construct environmental state codes;

[0094] Calculate terrain gradient feature weights and texture morphological feature weights based on environmental state encoding;

[0095] According to the weight of terrain gradient features and texture morphology features, the terrain gradient features and texture morphology features are weightedly fused to generate a fusion feature set.

[0096] Specifically, the environment state encoding is used as conditional input to construct a conditional channel attention mechanism; the optimal feature subset is dynamically selected according to the environment state, and feature sparsification constraints are applied; the terrain gradient features and texture morphological features are fused through the channel attention mechanism.

[0097] A convolutional neural network is used to extract features FE from the multi-temporal vegetation index NDVI(t) and meteorological data M(t). The environmental state encoding E = MLP(FE) with a dimension of 32 is generated through a multi-layer perceptron. A conditional channel attention mechanism is constructed, where the weight W = σ(MLP([FGTF, E])), FGTF is the gradient-texture fusion feature, and σ is the activation function. Feature selection FS = W Θ FGTF is implemented, where Θ represents the Hadamard product. L1 regularization Ls = λ||W||1 is applied to promote the sparsification of the weight W, where λ is the weight coefficient and is set to 0.001.

[0098] According to one aspect of the present application, the steps of calculating terrain gradient feature weights and texture morphology feature weights include:

[0099] Perform feature mapping transformation on terrain gradient features, texture morphology features and environmental state coding to obtain mapped terrain features and mapped texture features;

[0100] Calculate the conditional attention matrix of mapped terrain features and mapped texture features based on the environment state encoding;

[0101] Perform global average pooling and normalization on the conditional attention matrix to generate terrain gradient feature weights and texture morphology feature weights;

[0102] The terrain gradient feature weight and the texture morphology feature weight are dynamically adjusted according to the environment state coding to obtain the adjusted terrain gradient feature weight and the texture morphology feature weight.

[0103] This embodiment can more comprehensively and accurately reflect the terrain and texture characteristics of the study area, and adapt to environmental information, thereby increasing the expressive power of features; improves the flexibility and accuracy of feature processing, and can better capture the impact of the environment on terrain and texture characteristics; more effectively focuses on key feature areas and ignores irrelevant or minor features, thereby improving the accuracy of the overall task; ensures the balance and stability of weight distribution to avoid excessive influence of specific features on the model; and improves the model's adaptability to complex terrain and environmental changes.

[0104] According to one aspect of the present application, the steps of generating a region prior map and forming a region partition mask include:

[0105] Extract slope and aspect maps from standardized DEM data;

[0106] The slope map, aspect map and environmental state code are fused to generate a priori feature map;

[0107] Calculate the prior probability of the prior feature map to generate a regional prior map indicating the potential terrace boundary area;

[0108] The terrain gradient value is calculated based on the standardized DEM data, and the high and low gradient areas are divided by the adaptive threshold method to form a regional division mask.

[0109] Specifically, the study area is divided based on the terrain gradient value; full-resolution calculations are applied to high-gradient areas, and low-resolution calculations are applied to low-gradient areas; and the calculation results of different areas are fused.

[0110] This embodiment effectively captures key terrain features related to terrace boundaries and improves the efficiency and accuracy of boundary extraction; combined with comprehensive analysis of multi-dimensional information, it helps to more comprehensively reflect terrain characteristics and can effectively deal with feature ambiguity problems caused by environmental changes; using an adaptive threshold method to divide high and low gradient areas, the gradient division standard can be automatically adjusted according to terrain changes in different areas, improving the flexibility of partitioning, which is particularly suitable for complex terrace terrain and can reduce errors caused by manually setting fixed thresholds; the regional division mask can provide a clear regional division basis for subsequent terrace boundary extraction and optimization, helping the model to focus more efficiently on high-gradient areas and reduce the possibility of false detection and missed detection. While improving the accuracy of terrace boundary recognition, this embodiment also provides strong technical support for the adaptability and generalization ability of the model in complex terrain.

[0111] According to one aspect of the present application, the step of inputting the fused feature set into the U-Net network for processing and generating a feature map includes:

[0112] The fused feature set is input into the U-Net encoder for multi-layer feature extraction to obtain multi-scale encoder features;

[0113] Based on the multi-scale encoder features, the underlying features of the encoder are input into the U-Net decoder for multi-layer feature recovery to obtain the multi-scale decoder features;

[0114] Combined with the regional prior map, spatial attention calculation and channel attention calculation are performed on the multi-scale encoder features and multi-scale decoder features, and attention-enhanced features are generated through weighted fusion;

[0115] The attention enhancement features are regionally adaptively processed according to the region partition mask to generate a feature map.

[0116] Specifically, the steps for constructing a lightweight U-Net backbone network include: building a lightweight U-Net network with MobileNetV3 as the encoder; setting the encoder to five downsampling stages and the decoder to five upsampling stages; and establishing skip connections between the encoder and decoder. Spatial and channel attention mechanisms are introduced in the U-Net skip connections, and the feature fusion process is modulated by environmental state coding to enhance feature representation in boundary areas.

[0117] According to one aspect of the present application, the steps of performing spatial attention calculation and channel attention calculation to generate attention enhancement features include:

[0118] Convolve the multi-scale encoder features, multi-scale decoder features with the region prior map to calculate the spatial attention map;

[0119] Perform global average pooling and maximum pooling on the multi-scale encoder features and multi-scale decoder features, and calculate the channel attention vector after processing by a multi-layer perceptron;

[0120] Use spatial attention maps to weight the spatial dimensions of multi-scale encoder features to generate spatially weighted features;

[0121] Use the channel attention vector to weight the spatial weighted features in the channel dimension to generate channel weighted features;

[0122] Generate feature modulation weights based on environmental state coding, perform environmental adaptive modulation on channel weighted features, and generate environmental modulation features;

[0123] The environmental modulation features are fused and accumulated with the multi-scale decoder features to generate attention-enhanced features.

[0124] This embodiment enhances the model's ability to perceive features in terraced field boundaries by combining a triple attention mechanism: spatial attention, channel attention, and environmental modulation. Experiments show that the triple attention mechanism improves boundary localization accuracy by 35% and reduces average boundary offset from 2.8 pixels to 0.8 pixels compared to the simple skip connections of a traditional U-Net. The spatial attention mechanism enables the model to capture the spatial context of boundaries, improving boundary continuity by 40% and effectively reducing the boundary fragmentation problem common in traditional methods. The environmental modulation step dynamically adjusts feature weights based on environmental conditions, ensuring stable model performance across different seasons and meteorological conditions. The performance difference between lush and sparse vegetation periods is reduced from ±18.5% to ±2.2%. In areas with high terrain complexity (slope > 25°), the triple attention mechanism improves the boundary F1 score by 15.3% to 84.3% compared to a model using only spatial attention. The environmental modulation mechanism enhances the model's robustness to interference factors such as lighting changes, cloud shadows, and shadows, improving recognition accuracy by 23.7% in areas with local interference.

[0125] According to one aspect of the present application, the steps of extracting terrace boundaries based on the feature map and generating terrace boundary vector data include:

[0126] Perform threshold segmentation and edge detection on the feature map to extract the initial boundary map;

[0127] Combine the feature map to enhance the boundary features of the initial boundary map and generate an enhanced boundary map;

[0128] Extracting aspect information from standardized DEM data and applying aspect consistency constraints to the enhanced boundary map to promote the distribution of boundaries along contour lines and generate aspect-constrained boundary maps.

[0129] Apply conditional random field optimization and boundary smoothing to the aspect constraint boundary map to generate a regularized boundary map;

[0130] The regularized boundary map is converted from raster to vector and topologically checked and repaired to generate the final terrace boundary vector data.

[0131] According to one aspect of the present application, applying the aspect consistency constraint to the enhanced boundary map to generate the aspect-constrained boundary map includes:

[0132] Calculate aspect angle map and aspect gradient map based on standardized DEM data;

[0133] Extract the terrace boundary direction and morphological features from the enhanced boundary map to generate a boundary direction map;

[0134] Based on the aspect angle map, aspect gradient map and boundary direction map, the consistency measure map between the boundary and the aspect is calculated;

[0135] According to the consistency metric map, consistency constraints are applied to the enhanced boundary map, and the boundaries that do not conform to the distribution pattern of terraces along the contour lines are corrected to generate the aspect-constrained boundary map.

[0136] According to another aspect of the present application, the step of extracting terrace boundary vector data through model training and optimization includes:

[0137] Construct a multi-objective joint loss function, including segmentation loss, boundary-aware loss, temporal consistency loss, and feature sparsification loss; use the Adam optimizer and cosine annealing learning rate strategy for model training; apply knowledge distillation technology to transfer knowledge from complex models to lightweight models;

[0138] Apply the trained model to the test image for inference; perform multi-scale boundary fusion and post-processing; and output the final terrace boundary extraction results.

[0139] According to one aspect of the present application, a U-Net Loess Plateau terrace boundary refinement extraction device integrating terrain gradient constraints includes:

[0140] The data preparation module is used to acquire and standardize the research area data to obtain standardized remote sensing image data, DEM data and meteorological data;

[0141] Multi-source feature extraction module, used to extract terrain gradient features from DEM data, texture morphological features from remote sensing images, and generate environmental state codes based on processed meteorological data;

[0142] The feature fusion module is used to calculate the weights of terrain gradient features and texture morphological features based on the environmental state encoding, and perform weighted fusion to generate a fused feature set;

[0143] The regional prior generation module is used to generate a regional prior map based on DEM data and environmental state coding, and divide the high and low gradient areas into regional division masks according to the terrain gradient value;

[0144] The U-Net processing module is used to input the fused feature set into the U-Net network for processing, and generate a feature map through attention-guided feature fusion by combining the region prior map and the region partition mask;

[0145] The boundary extraction and regularization module is used to extract the terrace boundaries based on the feature map, and regularize the boundaries using the slope information in the standardized DEM data to generate terrace boundary vector data.

[0146] In a specific embodiment of the present application, to address the problem of insufficient accuracy in terrace boundary extraction under the complex terrain conditions of the Loess Plateau, a U-Net method for fine-grained extraction of terrace boundaries on the Loess Plateau that integrates terrain gradient constraints is proposed, comprising the following steps:

[0147] Step 1: Data preparation and preprocessing.

[0148] This embodiment uses the following data: multi-temporal remote sensing images: 10m resolution multispectral images of the Sentinel-2 satellite in April 2023 (sparse vegetation period) and August 2023 (lush vegetation period) of the Yan'an City area of the Loess Plateau in Shaanxi Province; terrain data: 30m resolution DEM data of the Shuttle Radar Topography Mission (SRTM), resampled to 10m to match the optical image; meteorological data: rainfall and temperature data of the study area in 2023, with a temporal resolution of days; terrace boundary truth data: terrace boundary vector data of 200 sample areas obtained through manual interpretation.

[0149] Data preprocessing steps: Remote sensing image atmospheric correction: Sentinel-2 data were atmospherically corrected using the Sen2Cor tool; Image registration: Multi-temporal imagery was accurately registered with the DEM data, with a registration error within 0.5 pixels; Topographic parameter calculation: Slope, aspect, and terrain relief were calculated using the DEM data; Training sample generation: The study area was divided into 150 training sample areas and 50 test sample areas, each 256 × 256 pixels. The slope calculation window was 3 × 3 pixels, the aspect classification level was 8, and the terrain relief calculation radius was 15 pixels. Min-Max normalization was used to the range [0, 1].

[0150] Step 2: Build the model architecture.

[0151] The model architecture of this embodiment mainly includes the following key components:

[0152] 2.1. Lightweight U-Net backbone network.

[0153] A lightweight U-Net is used as the basic network structure, and the specific design is as follows: Encoder: MobileNetV3 is used as the backbone network, which includes 5 downsampling stages, and the number of feature channels is 16, 32, 64, 128, and 256 respectively; Decoder: 5 upsampling stages are used, and the number of feature channels is 256, 128, 64, 32, and 16 respectively; Shallow feature extraction: A 3×3 convolution kernel is used to extract the initial feature representation of the input image.

[0154] Compared with the existing technology, this embodiment adopts a lightweight design, reducing the number of parameters by 75% while maintaining the model's expressiveness, solving the traditional U-Net parameter redundancy problem and enabling the model to run efficiently on resource-constrained devices.

[0155] 2.2. Gradient-texture feature extraction module (GTFEM).

[0156] GTFEM is one of the cores of this embodiment, used to simultaneously extract and fuse terrain gradient features and texture morphological features. The module structure is as follows:

[0157] Terrain gradient branch: Input DEM data D; calculate horizontal gradient Gx = ΨD / Ψx and vertical gradient Gy = ΨD / Ψy, where D is DEM data, Ψ is partial derivative, x is horizontal coordinate, y is vertical coordinate; calculate gradient amplitude G = sqrt(Gx 2 +Gy 2 ) and gradient direction θ = arctan(Gy / Gx); the gradient is calculated using Gaussian smoothing at different scales to obtain a multi-scale gradient feature set {G1, G2, G3}, where G1, G2, and G3 correspond to different scale parameters σ = 1, 2, and 3, respectively. The terrain gradient feature vector FG = [G1, G2, G3, θ] is constructed. The convolution kernel for horizontal gradient calculation is [[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]; the convolution kernel for vertical gradient calculation is [[-1, -2, -1], [0, 0, 0], [1, 2, 1]]; the Gaussian convolution kernel sizes are 3×3, 5×5, and 7×7, respectively; the gradient direction quantization level is 8 directions; and the number of feature channels is 4 channels for each scale (gradient magnitude, direction cosine, direction sine, and gradient variance).

[0158] Texture morphology branch: Input remote sensing image I; Extract LBP features: Compute local binary pattern (LBP) features with radii R = 1, 2, and 3, using P = 8 sampling points; Apply opening and closing morphological operations, with structuring elements of size 3×3 and 5×5, respectively; Construct texture feature vector FT = [LBPR=1, LBPR=2, LBPR=3, MorphOpen, MorphClose], where LBPR is a local binary pattern with radius R, MorphOpen is the result of the morphological opening operation, and MorphClose is the result of the morphological closing operation. The LBP pattern is rotationally invariant; the number of feature channels is 3 for each radius (original LBP, uniform LBP, and variance features); the structuring element for opening is disk-shaped, with radii of 3 and 5 pixels, respectively; the structuring element for closing is disk-shaped, with radii of 3 and 5 pixels, respectively; the number of feature channels for both opening and closing is 2.

[0159] Feature fusion: Channel attention mechanism: SA(F) = σ(MLP(AvgPool(F)) + MLP(MaxPool(F))), where F is the feature vector and MaxPool is maximum pooling; fused features: FGTF = SA(FG) Θ FG + SA(FT) ΘFT. The channel attention mechanism parameters include the attention dimension reduction ratio r = 16; the global pooling type is average pooling and maximum pooling in parallel; the number of neurons in the intermediate layer is the number of feature channels / r; the activation function in the first layer is ReLU, and the output layer is Sigmoid.

[0160] Compared with existing technologies, GTFEM combines terrain gradient information and texture morphological features, and is particularly suitable for the terraced terrain characteristics of the Loess Plateau. It can simultaneously enhance the expression of areas with drastic terrain changes and areas with obvious texture characteristics, solving the problem that a single feature cannot accurately represent the terrace boundary, and improving the boundary recognition accuracy by about 40%.

[0161] 2.3. Environment Adaptive Feature Selection Network (EAFSN).

[0162] EAFSN is used to dynamically select the optimal feature subset based on the current environment state and is the second core of this embodiment:

[0163] Environmental state encoding: The input is the multi-temporal vegetation index (NDVI(t)) and meteorological data M(t) = [precipitation, temperature]. Feature extraction is performed using FE = CNN([NDVI(t), M(t)]). Environmental state encoding is performed using E = MLP(FE), with a dimension of 32. Meteorological data can also be 5-dimensional (precipitation, temperature, relative humidity, light intensity, wind speed). The multi-temporal vegetation index (NDVI(t)) is the monthly average NDVI value for the previous three months. The encoding network is a three-layer MLP with 64, 48, and 32 neurons, respectively.

[0164] Conditional channel attention mechanism: The input is the GTFEM feature FGTF and the environment state code E. Conditional mapping is performed: W = σ(MLP([FGTF, E])), where [,] represents feature concatenation. Feature selection is performed: FS = W Θ FGTF. The conditional concatenation method is to concatenate the environment code with the feature channel statistics after linear projection. The attention calculation convolution layer is a 1×1 convolution with 1 / 4 the number of channels. The feature mapping function is: f(x) = Conv1x1(LayerNorm(x)), and the activation function is the Swish activation function.

[0165] Feature Sparsification: Sparsity Constraint: L1 regularization is used to promote the sparsification of weight W. The sparsity loss is: LS = λ||W||1, where λ is the weight coefficient, set to 0.001. The sparsity target is to retain 30% of the most important features, and the gradient clipping range is [-1.0, 1.0].

[0166] Compared with existing technologies, EAFSN introduces environmental status as a conditional input for the first time to guide the feature selection process, solving the problem of differences in feature expression under different environmental conditions (such as drought / humidity, lush / sparse vegetation), improving the adaptability of the model in different seasons and meteorological conditions, and controlling the accuracy fluctuation in different seasons within ±5%.

[0167] 2.4. Dynamic Region Prior Generator (DRPG).

[0168] DRPG is used to generate regional prior knowledge adapted to the current environment and guide the model to focus on potential terrace boundary areas:

[0169] Prior knowledge was constructed by inputting slope S, aspect A, and environmental state code E derived from the DEM. Features were fused using a convolutional neural network (CNN) using FP = CNN([S, A, E]). This generated a prior map P = σ(Conv(FP)) with a value range of [0, 1]. The prior map P was divided into high-value regions (P > 0.7) corresponding to potential terrace boundaries, medium-value regions (0.3 < P ≤ 0.7) corresponding to terrace interiors and peripheries, and low-value regions (P ≤ 0.3) corresponding to non-terraced areas. The fusion network structure consisted of a three-layer convolutional network with a 3×3 kernel size, a number of channels in the range [32, 16, 8], a LeakyReLU activation function (α = 0.2), and channel-wise attention modulation for environmental code fusion. The probability calculation for generating the prior map used a softmax activation function, a boundary enhancement coefficient of β = 1.5, and a Gaussian smoothing algorithm with σ = 0.5 for smoothing.

[0170] Compared with existing technologies, DRPG combines static terrain information with dynamic environmental status to generate regional priors that adapt to the current environment, solving the limitation of static fixed prior knowledge in traditional methods and improving boundary recognition rate by 30% under extreme weather conditions (such as after heavy rainfall).

[0171] 2.5. Attention-guided skip connection (AG-Skip).

[0172] AG-Skip is an improvement to the traditional U-Net skip connection to enhance boundary feature transfer:

[0173] Calculate attention: input is high-resolution feature FH (from encoder), low-resolution feature FL (from decoder), prior map P; calculate spatial attention map MS = σ(Conv([FH, FL, P])), where Conv is a convolution operation, FH is a high-resolution feature, FL is a low-resolution feature, and P is a priori map; calculate channel attention vector MC = σ(MLP(AvgPool([FH, FL]))), where MLP is a multi-layer perceptron and AvgPool is average pooling; realize feature space weighting FS = MS ΘFH; realize feature channel weighting FC = MC Θ FS; perform environmental modulation based on the environment state E, and obtain the optimized feature FAS = W(E) Θ FC after environmental modulation, where W(E) is the weight based on the environment state E; generate the final output FOUT = FAS + FL containing attention enhancement features. The convolution kernel size for calculating the spatial attention map is 7×7, the number of intermediate channels is 64, and the activation function is ReLU + Sigmoid; the prior fusion coefficient α = 0.6; the dimensionality reduction ratio for calculating the channel attention vector is r = 8, the MLP hidden layer activation is ReLU; the output activation is Sigmoid; the modulation network for environmental modulation is a two-layer MLP with the number of neurons [64, the number of feature channels]; the modulation method is a multiplicative gating mechanism; and the modulation intensity coefficient γ = 0.8.

[0174] Compared with the simple feature splicing or addition of traditional U-Net, AG-Skip introduces a triple mechanism of spatial attention, channel attention and environmental modulation, which enhances the feature expression of boundary areas, solves the problem that traditional skip connections cannot distinguish important areas, and improves boundary positioning accuracy by 35%.

[0175] 2.6. Boundary Enhancement and Regularization Module (BERM).

[0176] BERM is used to enhance the boundary features of terraces and perform regularization based on prior knowledge:

[0177] Perform boundary feature enhancement: extract the boundary FB = Sobel(FS) from the segmentation feature map FS, where Sobel is the edge detection function; implement boundary enhancement FEB = FS + λB · FB, where λB is the boundary enhancement weight, set to 0.5; use the prior knowledge of the distribution of terraces along the contour lines, apply the slope consistency constraint, and the loss function LC = Σ|▽θ · ▽FS|, where θ is the slope angle and ▽ represents the gradient operator; use the conditional random field to optimize the boundary, the potential function φ(yi, yj) = μij·δ(yi ≠ yj), where μij is the similarity between nodes i and j, yi, yj are the states of two adjacent pixels (or nodes) in the image, and δ is the difference function. The weight of the single potential function of the conditional random field is θα = 4.0, the weight of the paired potential function is θβ = 3.0, the standard deviation of the Gaussian kernel is σ = 3.0, the spatial kernel in the bilateral kernel parameter is σα = 5.0, the range kernel σβ = 0.1, and the number of iterations is 5.

[0178] Compared with existing methods, BERM introduces a boundary regularization mechanism based on the topographic characteristics of terraces. It uses prior knowledge of the distribution of terraces along contour lines and the laws of artificial construction to solve the problems of boundary fragmentation and discontinuity, and improves boundary integrity by 45%.

[0179] 2.7. Perform gradient-guided regional adaptive calculation.

[0180] To improve computational efficiency, this embodiment designs a gradient-guided regional adaptive computation strategy:

[0181] Allocate computing resources: Based on the regional division of the terrain gradient G, high-gradient regions (G > Th) are treated as potential boundary regions and applied to full-resolution calculations; low-gradient regions (G ≤ Th) are treated as non-boundary regions and applied to low-resolution calculations, where the threshold Th is adaptively determined using the Otsu method; a complete feature extraction and fusion process is applied to high-gradient regions; a simplified feature extraction and processing process is used for low-gradient regions; and the result fusion MR = MH·MG + ML·(1-MG) is achieved, where MH and ML are the high-resolution and low-resolution calculation results, respectively, and MG is the gradient mask.

[0182] Compared with the traditional method of uniformly processing the entire image, this embodiment dynamically allocates computing resources according to the terrain gradient, improves computing efficiency, and reduces the amount of calculation by 75% while ensuring accuracy.

[0183] Step 3: Construct a joint loss function.

[0184] This embodiment designs a multi-objective joint loss function to guide model training:

[0185] Segmentation loss (Lseg): Dice loss: LDice = 1 - 2|Y∩Y*| / (|Y|+|Y*|), where Y is the true value and Y* is the predicted value; Focal loss: LFiocal = -α(1-pt)γlog(pt), where α=0.75, γ=2.0, and pt is the probability of the pt predicted value for the true category; comprehensive segmentation loss Lseg = 0.5LDice + 0.5LFocal, where LDice is the Dice loss, which is a loss function for semantic segmentation tasks; LFiocal is the focal loss, which is used to solve the category imbalance problem in classification tasks; boundary extraction, BY is the true value boundary, BY* is the predicted boundary; boundary perception loss Lboundary = 1 / N·ΣDist(BY, BY*), Dist is the Hausdorff distance, and N is the total number of samples or pixels; temporal consistency loss Lconsistency = 1 - SSIM(Y*t1, Y*t2), where Y*t1 and Y*t2 are the prediction results of different phases, and SSIM is the structural similarity index; the feature sparsification loss Lsparsity = λS||W||1, where the feature sparsification weight coefficient λS=0.001, ||W||1 is the weight L1 regularization; the total loss function Ltotal = λ1Lseg + λ2Lboundary + λ3Lconsistency + λ4Lsparsity, the weights are set to λ1=1.0, λ2=0.5, λ3=0.2, λ4=0.001.

[0186] Compared with the traditional single segmentation loss, the joint loss function of this embodiment takes into account four aspects: segmentation accuracy, boundary fineness, temporal consistency, and feature sparsity, comprehensively guiding model optimization and improving the generalization ability and robustness of the model.

[0187] Step 4: Training strategy.

[0188] This embodiment adopts the following training strategy:

[0189] Training data organization: Input multi-temporal optical images (April and August), DEM data and meteorological data; labels are manually interpreted true values of terrace boundaries; 256×256 pixel image blocks are used, and the batch size is 8.

[0190] Training process: The optimizer is Adam optimizer, with an initial learning rate of 0.001 and a weight decay of 0.0001; the learning rate strategy is cosine annealing with a minimum learning rate of 0.00001; the training rounds are 200 in total, each round contains all training samples; data augmentation includes random flipping, rotation, scaling, and brightness and contrast adjustment.

[0191] Feature knowledge distillation: Construct the teacher model: the full network (12M parameters) and the student model: the lightweight network (1.8M parameters); design the distillation loss LKD = KL(P_teacher || P_student), where P_teacher is the predicted distribution of the teacher model, P_student is the predicted distribution of the student model, and KL is the Kullback-Leibler divergence; set the distillation temperature T=2.0; jointly optimize the segmentation loss and distillation loss.

[0192] Compared with traditional end-to-end training, this embodiment introduces knowledge distillation technology to effectively transfer the knowledge of complex models to lightweight models, while maintaining accuracy while reducing the number of model parameters (85%) and computational complexity.

[0193] This embodiment was fully tested in the Yan'an test area on the Loess Plateau. The results are as follows: Terrace boundary extraction accuracy: average intersection over union (IoU): 0.89 (improved by 23.6%); boundary F1 score: 0.87 (improved by 31.8%); position accuracy: average offset 0.8 pixels (improved by 71.4%). Environmental adaptability assessment: IoU during sparse vegetation period (April): 0.90; IoU during lush vegetation period (August): 0.88; seasonal accuracy fluctuation: 2.2% (traditional method is 18.5%). Computational efficiency: processing speed: 1.2 seconds / km 2 (3.5 times faster than the baseline); memory usage: reduced by 78%; parameter size: 1.8MB (the original U-Net is 31.0MB). Special case testing: accuracy after heavy rainfall: reduced by only 3.5% (the baseline method reduced by 25.3%); fragmented terrace recognition accuracy: improved by 42.7%; boundary accuracy in complex terrain areas: improved by 38.9%.

[0194] Compared with existing technologies, this embodiment improves the accuracy and robustness of terrace boundary extraction on the Loess Plateau, especially in complex terrain conditions and with significant seasonal variations. It also reduces computing resource requirements, enabling the model to run efficiently on resource-constrained devices. The Gradient-Texture Feature Extraction Module (GTFEM) combines terrain gradient and texture morphological features to fully utilize the topographic and textural features of the terraces, solving the problem that a single feature cannot accurately represent terrace boundaries and improving boundary recognition accuracy by 40%. The Environment Adaptive Feature Selection Network (EAFSN) uses environmental conditions as conditional input to guide feature selection for the first time, addressing performance fluctuations caused by seasonal and meteorological changes and keeping accuracy fluctuations within ±5% across different seasons. The Dynamic Region Prior Generator (DRPG) combines static terrain information with dynamic environmental conditions to generate environmentally adaptive regional prior knowledge, improving boundary recognition by 30% under extreme conditions. The Attention-Guided Skip Connection (AG-Skip) introduces a triple attention mechanism (spatial, channel, and environmental modulation) to enhance the feature representation of boundary regions and improve boundary positioning accuracy by 35%. The Boundary Enhancement and Regularization Module (BERM) uses a boundary regularization mechanism designed based on the topographic characteristics of terraces to address boundary fragmentation and discontinuity, improving boundary integrity by 45%. Gradient-guided regional adaptive computation dynamically allocates computing resources based on terrain gradients, improving computational efficiency and reducing computational effort by 75% while ensuring accuracy. A U-Net method for fine-grained extraction of terrace boundaries on the Loess Plateau was constructed, integrating terrain gradient constraints with environmental adaptation. This method effectively addresses the technical challenges of fine-grained extraction of terrace boundaries under the complex terrain conditions of the Loess Plateau, providing a new technical path for research and application in related fields.

[0195] The study shows that the accuracy comparison of each method in the extraction of terrace boundaries on the Loess Plateau is as follows: the average IoU (%) of the traditional U-Net is 65.4; the boundary F1 score (%) is 55.2; the position accuracy (pixel offset) is 2.8; the processing speed (seconds / km 2 ) is 4.2. The average IoU (%) of DeepLabv3+ is 69.8; the boundary F1 score (%) is 62.6; the position accuracy (pixel offset) is 2.3; the processing speed (seconds / km 2 ) is 3.8. The average IoU (%) of PSPNet is 72.1; the boundary F1 score (%) is 65.3; the position accuracy (pixel offset) is 2.1; the processing speed (seconds / km 2 ) is 3.5. The average IoU (%) of U-Net+DEM is 76.3; the boundary F1 score (%) is 69.7; the position accuracy (pixel offset) is 1.9; the processing speed (seconds / km 2) is 4.3. The average IoU (%) of the method of the present invention is 89.0; the boundary F1 score (%) is 87.0; the position accuracy (pixel offset) is 0.8; the processing speed (seconds / km 2 ) is 1.2. In comparison, the average IoU of the proposed method is improved by 12.7%, the boundary F1 score is improved by 17.3%, the position accuracy is improved by an average of 1.1, and the processing speed is improved by an average of 3.0 seconds / km 2 .

[0196] The performance stability of the proposed method under different seasons and environmental conditions is as follows: in the sparse vegetation period (spring), the IoU (%) of the traditional U-Net is 78.2, and the IoU (%) of the proposed method is 90.0, with a performance improvement of 11.8%; in the lush vegetation period (summer), the IoU (%) of the traditional U-Net is 59.7, and the IoU (%) of the proposed method is 88.0, with a performance improvement of 28.3%; after harvest (autumn), the IoU (%) of the traditional U-Net is 75.6, and the IoU (%) of the proposed method is 88.0, with a performance improvement of 28.3%. .5, with a performance improvement of 12.9%; after heavy rainfall, the IoU (%) of the traditional U-Net is 52.9, while the IoU (%) of the proposed method is 86.5, with a performance improvement of 33.6%; in cloud-covered areas, the IoU (%) of the traditional U-Net is 48.3, while the IoU (%) of the proposed method is 82.0, with a performance improvement of 33.7%; during seasonal fluctuations, the IoU (%) of the traditional U-Net fluctuates by ±18.5%, while the IoU (%) of the proposed method fluctuates by ±2.2%, with stability improved by 8.4 times.

[0197] The boundary extraction accuracy of the present invention in areas with different terrain complexity is as follows: in low-complexity areas (slope <15°), the boundary F1 (%) of the traditional U-Net is 72.3, and the boundary F1 (%) of the method of the present invention is 89.5, an increase of 17.2%; in medium-complexity areas (slope 15°-25°), the boundary F1 (%) of the traditional U-Net is 61.8, and the boundary F1 (%) of the method of the present invention is 87.2, an increase of 25.4%; in high-complexity areas (slope >25°), the boundary F1 (%) of the traditional U-Net is 45.6, and the boundary F1 (%) of the method of the present invention is 84.3, an increase of 38.7%; in terrain transition areas, the boundary F1 (%) of the traditional U-Net is 42.1, and the boundary F1 (%) of the method of the present invention is 82.5, an increase of 40.4%.

[0198] Comparison of computing resource usage of different methods: The number of parameters (M) of traditional U-Net is 31.0, the GPU memory usage (GB) is 5.8, the inference time (ms / sample) is 325, and the training time (hours) is 24; the number of parameters (M) of DeepLabv3+ is 41.2, the GPU memory usage (GB) is 7.2, the inference time (ms / sample) is 385, and the training time (hours) is 32; the number of parameters (M) of PSPNet is 38.6, the GPU memory usage (GB) is 6.9, the inference time (ms / sample) is 360, and the training time (hours) is ) is 28; the parameter amount (M) of U-Net+DEM is 33.7, the GPU memory usage (GB) is 6.2, the inference time (ms / sample) is 340, and the training time (hours) is 26; the parameter amount (M) of the method of the present invention (full version) is 12.0, the GPU memory usage (GB) is 3.2, the inference time (ms / sample) is 115, and the training time (hours) is 20; the parameter amount (M) of the method of the present invention (light version) is 1.8, the GPU memory usage (GB) is 0.9, the inference time (ms / sample) is 78, and the training time (hours) is 14.

[0199] This method is applicable to the following scenarios: monitoring soil and water conservation effectiveness on the Loess Plateau; calculating terraced agricultural production area; evaluating the effectiveness of sloping farmland transformation; and surveying agricultural land resources in mountainous areas. It can also be expanded to other remote sensing image analysis tasks in similar areas with complex terrain, such as terraced water resource assessment and land use change monitoring in mountainous areas.

[0200] The present invention establishes an enhanced feature transfer channel between the encoder and decoder of U-Net by designing an attention-guided skip connection (AG-Skip) mechanism. This mechanism combines the triple mechanisms of spatial attention, channel attention and environmental modulation to enhance the feature expression of boundary areas. In the specific implementation, the spatial attention map and channel attention vector weight the spatial dimension and channel dimension of the high-resolution features respectively, so that the model can enhance the information transmission of the boundary area in a targeted manner, effectively solving the problem that the traditional U-Net skip connection cannot distinguish important areas, and improving the boundary positioning accuracy. The gradient-texture feature extraction module (GTFEM) is introduced to simultaneously extract and fuse terrain gradient features and texture morphological features. By calculating multi-scale terrain gradient features (including gradient amplitude and direction) and LBP texture and morphological features, and combining the channel attention mechanism for feature fusion, the model can fully capture the terrain characteristics and texture characteristics of the terraces. This dual-path feature extraction method is particularly suitable for the terrain characteristics of the terraces on the Loess Plateau. It can simultaneously enhance the expression of areas with drastic terrain changes and areas with obvious texture features, solving the problem that a single feature cannot accurately characterize the terrace boundaries, and improving the accuracy of boundary recognition. An environmental adaptive feature selection network (EAFSN) was designed to guide the feature selection process by generating environmental state encoding from multi-temporal vegetation indices and meteorological data. Based on the environmental state, the conditional channel attention weights are calculated, and the terrain gradient features and texture morphological features are dynamically weighted and fused, so that the model can adaptively adjust the feature weights according to the current environmental conditions (such as the period of lush vegetation or sparse vegetation). This embodiment uses the environmental state as a conditional input for the first time, which solves the problem of differences in feature expression under different environmental conditions, improves the adaptability of the model under different seasons and meteorological conditions, and controls the accuracy fluctuation amplitude in different seasons. A dynamic regional prior generator (DRPG) and a gradient-guided regional adaptive calculation strategy were developed. DRPG generates a regional prior map adapted to the current environment based on the slope, aspect information and environmental state encoding extracted from DEM data, providing the model with prior knowledge of the potential boundary locations of terraces. The regional adaptive calculation strategy divides high and low gradient areas according to the terrain gradient value, and applies processing strategies of different calculation accuracy to different areas, which not only ensures high-precision processing of boundary areas, but also improves overall calculation efficiency. By combining static terrain information with dynamic environmental conditions, an environment-adaptive regional prior is generated, which overcomes the limitation of static fixed prior knowledge in traditional methods, improves boundary recognition rate under extreme weather conditions, and reduces computational complexity while ensuring accuracy.

[0201] The preferred embodiments of the present invention are described in detail above. However, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all fall within the scope of protection of the present invention.

Claims

1. A U-Net method for extracting terrace boundaries on the Loess Plateau that integrates terrain gradient constraints is characterized by: The following steps are involved: Acquire and standardize the data of the study area to obtain standardized data, including standardized remote sensing image data, DEM data and meteorological data; Based on standardized data, terrain gradient features are calculated, texture morphological features are extracted, and environmental state codes are generated; terrain gradient features are fused with texture morphological features to form a fused feature set; Generate a regional prior map based on standardized DEM data and environmental state coding, and divide high and low gradient areas into regional division masks according to terrain gradient values; The fused feature set is input into the U-Net network for processing, and the feature map is generated by attention-guided feature fusion combined with the region prior map and the region partition mask; The terrace boundaries are extracted based on the feature map, and the slope information in the standardized DEM data is used to regularize the boundaries to generate terrace boundary vector data.

2. The method according to claim 1, characterized in that The steps to calculate terrain gradient characteristics include: Calculate the horizontal and vertical gradients of the standardized DEM data; Calculate the gradient direction based on the horizontal gradient and the vertical gradient; The standardized DEM data is smoothed with Gaussian smoothing of different scale parameters and then the gradient is calculated to obtain a multi-scale gradient feature set. The multi-scale gradient feature set is combined with the gradient direction to construct the terrain gradient feature.

3. The method according to claim 1, characterized in that The steps of extracting texture morphological features include: Calculate local binary pattern features of different radii for standardized remote sensing image data to obtain a local binary pattern feature set; Apply opening and closing morphological operations to the standardized remote sensing image data to obtain a set of morphological features; The local binary pattern feature set is combined with the morphological feature set to construct texture morphological features.

4. The method according to claim 1, wherein The steps of generating the environment state encoding and forming the fusion feature set include: Extract seasonal and meteorological characteristics from standardized meteorological data and construct environmental state codes; Calculate terrain gradient feature weights and texture morphological feature weights based on environmental state encoding; According to the weight of terrain gradient features and texture morphology features, the terrain gradient features and texture morphology features are weightedly fused to generate a fusion feature set.

5. The method according to claim 1, wherein The steps of generating a region prior map and forming a region partition mask include: Extract slope and aspect maps from standardized DEM data; The slope map, aspect map and environmental state code are fused to generate a priori feature map; Calculate the prior probability of the prior feature map to generate a regional prior map; The terrain gradient value is calculated based on the standardized DEM data, and the high and low gradient areas are divided by the adaptive threshold method to form a regional division mask.

6. The method according to claim 1, characterized in that The steps of inputting the fused feature set into the U-Net network for processing and generating a feature map include: The fused feature set is input into the U-Net encoder for multi-layer feature extraction to obtain multi-scale encoder features; Based on the multi-scale encoder features, the underlying features of the encoder are input into the U-Net decoder for multi-layer feature recovery to obtain the multi-scale decoder features; Combined with the regional prior map, spatial attention calculation and channel attention calculation are performed on the multi-scale encoder features and multi-scale decoder features, and attention-enhanced features are generated through weighted fusion; The attention enhancement features are regionally adaptively processed according to the region partition mask to generate a feature map.

7. The method according to claim 1, characterized in that The steps of extracting terrace boundaries based on the feature map and generating terrace boundary vector data include: Perform threshold segmentation and edge detection on the feature map to extract the initial boundary map; Combine the feature map to enhance the boundary features of the initial boundary map and generate an enhanced boundary map; Extract aspect information from standardized DEM data and apply aspect consistency constraints to the enhanced boundary map to generate an aspect-constrained boundary map. Apply conditional random field optimization and boundary smoothing to the aspect constraint boundary map to generate a regularized boundary map; The regularized boundary map is converted from raster to vector and topologically checked and repaired to generate the final terrace boundary vector data.

8. The method according to claim 4, characterized in that The steps of calculating terrain gradient feature weights and texture morphology feature weights include: Perform feature mapping transformation on terrain gradient features, texture morphology features and environmental state coding to obtain mapped terrain features and mapped texture features; Calculate the conditional attention matrix of mapped terrain features and mapped texture features based on the environment state encoding; Perform global average pooling and normalization on the conditional attention matrix to generate terrain gradient feature weights and texture morphology feature weights; The terrain gradient feature weight and the texture morphology feature weight are dynamically adjusted according to the environment state coding to obtain the adjusted terrain gradient feature weight and the texture morphology feature weight.

9. The method according to claim 6, characterized in that The steps of performing spatial attention calculation and channel attention calculation to generate attention-enhanced features include: Convolve the multi-scale encoder features, multi-scale decoder features with the region prior map to calculate the spatial attention map; Perform global average pooling and maximum pooling on the multi-scale encoder features and multi-scale decoder features, and calculate the channel attention vector after processing by a multi-layer perceptron; Use spatial attention maps to weight the spatial dimensions of multi-scale encoder features to generate spatially weighted features; Use the channel attention vector to weight the spatial weighted features in the channel dimension to generate channel weighted features; Generate feature modulation weights based on environmental state coding, perform environmental adaptive modulation on channel weighted features, and generate environmental modulation features; The environmental modulation features are fused and accumulated with the multi-scale decoder features to generate attention-enhanced features.

10. The method according to claim 7, characterized in that Apply the aspect consistency constraint to the enhanced boundary map. The steps to generate the aspect constraint boundary map include: Calculate aspect angle map and aspect gradient map based on standardized DEM data; Extract the terrace boundary direction and morphological features from the enhanced boundary map to generate a boundary direction map; Based on the aspect angle map, aspect gradient map and boundary direction map, the consistency measure map between the boundary and the aspect is calculated; According to the consistency metric map, consistency constraints are applied to the enhanced boundary map, and the boundaries that do not conform to the distribution pattern of terraces along the contour lines are corrected to generate the aspect-constrained boundary map.

Citation Information

Cited By

  • A method for designing terraced fields based on high-precision DEM data

    CN122365620A