Remote sensing image building boundary segmentation method based on U-net network model
By using boundary-adaptive dilated convolution and high-frequency artifact detection, the receptive field is dynamically adjusted, solving the problems of boundary feature extraction and artifact interference in traditional remote sensing image building boundary segmentation. This achieves high-precision building boundary segmentation, supporting urban planning and disaster assessment.
Patent Information
- Application Number
- CN202610099853.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-26
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2046-01-26
AI Technical Summary
Traditional remote sensing image building boundary segmentation methods suffer from insufficient boundary feature extraction capabilities, difficulty in resolving artifact interference, and fixed and unbalanced receptive fields, resulting in unclear segmentation results and low accuracy, which limits their application in urban planning and disaster assessment.
A boundary-adaptive dilated convolutional unit is used. The boundary gradient magnitude map is extracted by the Sobel operator to generate a binary boundary mask. The dilated convolutional kernel is adjusted to a boundary-adaptive kernel, and a residual correction unit is added after the dilated convolutional layer. The high-frequency components are extracted by the Laplacian operator to generate an artifact binary mask, and the receptive field size is dynamically adjusted according to the boundary complexity.
It improves the accuracy of building boundary segmentation, solves the problems of boundary ambiguity and artifacts, achieves a balance between global and local features, and outputs high-precision building boundary segmentation results to support urban planning and disaster assessment.
Smart Images

Figure CN121582278A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of building boundary segmentation technology, specifically a method for segmenting building boundaries in remote sensing images based on the U-net network model. Background Technology
[0002] Traditional remote sensing image building boundary segmentation methods (including methods based on the traditional U-net network model) suffer from three major performance bottlenecks, making it difficult to meet the requirements of high-precision analysis: Insufficient boundary feature extraction capability: It cannot accurately capture the details of building edges, and is prone to boundary blurring problems, resulting in unclear transitions between building edges and backgrounds in the segmentation results, which affects the accuracy of boundary positioning.
[0003] Artifact interference is difficult to solve: When using techniques such as dilated convolution to expand the receptive field, boundary artifacts (such as edge breaks and false edges) are easily generated, and traditional restoration methods are prone to losing the original image details, further reducing the segmentation accuracy.
[0004] Receptive field imbalance: The size of the receptive field cannot be dynamically adjusted according to the actual complexity of the building boundary. When facing a large area with simple texture (such as a flat roof), local details are not captured enough. When facing a complex area with dense details (such as a building with multiple corners), the ability to integrate global contextual information is lacking, resulting in an imbalance between global and local feature capture.
[0005] The aforementioned problems limit the effectiveness of traditional methods in remote sensing image analysis tasks such as urban planning (e.g., building layout statistics) and disaster assessment (e.g., identification of the extent of building damage after a disaster). Therefore, there is an urgent need for a segmentation method that can overcome these bottlenecks.
[0006] Therefore, this invention provides a method for segmenting building boundaries in remote sensing images based on the U-net network model. Summary of the Invention
[0007] In order to overcome the shortcomings of the prior art, at least one technical problem raised in the background art is solved.
[0008] The technical solution adopted by this invention to solve its technical problem is: One objective of this invention is to provide a method for building boundary segmentation in remote sensing images based on the U-net network model, comprising: S1: Construct a boundary-adaptive dilated convolutional unit, including: obtaining the feature map of the i-th layer of the encoder; extracting the boundary gradient magnitude map of the input image with artifacts using the Sobel operator to generate a binary boundary mask; adjusting the traditional dilated convolutional kernel to a boundary-adaptive kernel based on the gradient of the binary boundary mask and the boundary gradient magnitude map; adding a residual correction unit after the dilated convolutional layer to calculate the boundary region residual between the dilated convolutional output feature and the original feature, and outputting the corrected feature map. S2: Input the current layer's corrected feature map, extract single-channel high-frequency components using the Laplacian operator, combine with the boundary mask to generate a binary mask for artifacts; for each point marked as a suspected artifact, extract the feature mean and gradient direction of non-artifact points in its 3×3 neighborhood, and output the artifact removal features; S3: Calculate the boundary density of the boundary gradient map of the i-th layer of the encoder and output the boundary complexity score; dynamically adjust the receptive field size using a preset void ratio candidate set.
[0009] As a further improvement of the present invention, the specific process of generating the binary boundary mask is as follows: Select the feature map Fi output from the i-th layer and prepare the input image with artifacts to be processed and input it into the encoder; The classic Sobel operator is used to operate on the input image with artifacts to calculate the trend of pixel grayscale changes in the input image with artifacts, thereby obtaining the boundary gradient magnitude map G. The numerical range of the boundary gradient magnitude map G is scaled to the [0,1] interval for subsequent binarization judgment; A threshold is set; when the gradient value of any pixel p in the boundary gradient magnitude map G is greater than the set threshold, the pixel is determined to belong to the boundary region, and a binary boundary mask is used. The corresponding position is marked as 1; otherwise, it is marked as 0.
[0010] As a further improvement of the present invention, the specific process of adjusting the traditional dilated convolution kernel to a boundary-adapting kernel based on the gradient of the binary boundary mask and the boundary gradient magnitude map is as follows: Based on the calculated binary boundary mask The gradient ∇G(p) of the boundary gradient magnitude map G is used to modify the original traditional dilated convolution kernel in the U-net encoder to obtain the boundary adaptation kernel. The specific improvement process is as follows: Introduce the parameter λ, and based on the formula For traditional dilated convolution kernels Each position p is modified, where, To adapt the weight value of the dilated convolution kernel at position p to the modified boundary, This represents the original weight values of the traditional dilated convolution kernel at position p. The value of the binary boundary mask at position p. Let G be the gradient value of the boundary gradient magnitude map G at position p, and ⊙ be the element-wise multiplication operator; For non-boundary areas, That is, the kernel weights remain unchanged from the original dilated convolution kernel, without affecting the global receptive field and context modeling capability; For the boundary region, .
[0011] As a further improvement of the present invention, the specific process of adjusting the traditional dilated convolution kernel to a boundary-adapting kernel based on the gradient of the binary boundary mask and the boundary gradient magnitude map further includes: If the gradient value of the boundary gradient magnitude map G at position p increases, then the weight value of the modified boundary-adapted dilated convolution kernel at position p will also increase. If the gradient value of the boundary gradient magnitude map G at position p decreases, then the weight value of the modified boundary-adapted dilated convolution kernel at position p will also decrease.
[0012] As a further improvement of the present invention, the specific process of outputting the corrected feature is as follows: Let the features of the input image with artifacts be... (Including: width W, height H, number of channels C), after processing by a dilated convolutional layer, the output features are: ; Calculate the boundary region residual between the dilated convolution output feature and the original feature, and generate a high-frequency residual boundary mask using an edge detection algorithm. In high-frequency residual boundary mask In the diagram, boundary positions are marked as 1, and non-boundary positions are marked as 0; The boundary region residual between the dilated convolution output feature and the original feature. ; in, To calculate the difference between the dilated convolution output features and the original features element by element, For high-frequency residual boundary masks, This is element-wise multiplication; By introducing boundary masks Only The residuals are preserved at the boundary locations, while the residuals in the interior regions are set to zero; The output features of dilated convolution are scaled by subtracting the residuals in the boundary region. ; This is the scaling factor. To correct features.
[0013] As a further improvement of the present invention, the specific process for generating the artifact binary mask is as follows: Let the current layer's corrected feature map be... The discrete Laplacian operator ∇² is used to extract high-frequency details of each channel, and the classic four-neighbor Laplacian kernel is used to correct the feature map. Each channel is convolutionally processed independently to obtain single-channel high-frequency components; The high-frequency components of all channels are fused according to the maximum value per pixel to obtain a single-channel high-frequency component map; Introducing artifact detection boundary masks By using semantic segmentation or edge detection algorithms, pixels in the corrected feature map that belong to object boundaries or region edges are labeled. Artifact detection boundary mask A pixel with a median value of 1 indicates that high frequencies are allowed at that location; artifact detection boundary mask. Pixels with a median value of 0 represent non-boundary regions and high-frequency anomalies; Single-channel high-frequency components Artifact detection boundary mask Perform element-wise multiplication to obtain the high-frequency components in the non-boundary region. ;in, This is element-wise multiplication; Set dynamic threshold High-frequency components in non-boundary regions Pixels exceeding the threshold are marked as suspected artifacts. Generate artifact binary mask .
[0014] As a further improvement of the present invention, the specific process of outputting artifact removal features is as follows: For each point marked as a suspected artifact Extract suspected artifact points A small, localized area of 3x3 surrounding it; Exclude points that were also marked as suspected artifacts. For points, only those not suspected artifacts are retained; Calculate suspected artifact points eigenmean And use gradient algorithm to calculate suspected artifact points. gradient direction .
[0015] As a further improvement of the present invention, the specific process of outputting artifact removal features also includes: If suspected artifact point It is a boundary: strictly follows the neighborhood gradient direction. repair; If suspected artifact point Not a boundary: combined with the mean Filling should prioritize ensuring feature consistency within the region; Through formula Output artifact removal features; in, The feature map is the original input. The symbol is a mask for suspected artifacts, and ⊙ represents element-wise multiplication. This is a function for artifact repair.
[0016] As a further improvement to the present invention, the specific process for outputting the boundary complexity score is as follows: Assuming the output artifact-removed features are layered, the resulting image is the i-th layer with size W×H. The boundary gradient map of this layer is calculated using an edge detection algorithm. : Canny operator first checks Perform gradient calculations to obtain the gradient magnitude and direction for each pixel. ; Calculate boundary density : ; Calculate boundary tortuosity : ; Calculate the boundary complexity score : ; The number of critical segments at the boundary. This represents the local angular feature at the p-th position.
[0017] As a further improvement of the present invention, the specific process of dynamically adjusting the size of the receptive field is as follows: The preset candidate set for dilation rate is R={1,2,3}, and the receptive field of dilated convolution is determined by the dilation rate r; therefore: r=1: The receptive field is 3×3; r=2: The receptive field is expanded to 5×5; r=3: The receptive field is expanded to 7×7; Based on boundary complexity score and threshold , Based on the size relationship, the void ratio is selected in three categories: Low complexity: Choose r=3 and use a 7×7 receptive field; Medium complexity: Choose r=2 and use a 5×5 receptive field; High complexity: Choose r=1 and use a 3×3 receptive field.
[0018] The second objective of this invention is to provide a remote sensing image building boundary segmentation system based on the U-net network model, comprising: Boundary-adaptive dilated convolution module: Constructs a boundary-adaptive dilated convolution unit, including: obtaining the feature map of the i-th layer of the encoder; extracting the boundary gradient magnitude map of the input image with artifacts using the Sobel operator to generate a binary boundary mask; adjusting the traditional dilated convolution kernel to a boundary-adaptive kernel based on the gradient of the binary boundary mask and the boundary gradient magnitude map; adding a residual correction unit after the dilated convolution layer to calculate the boundary region residual between the dilated convolution output feature and the original feature, and outputting a corrected feature map; High-frequency artifact detection and repair module: Input the current layer correction feature map, extract single-channel high-frequency components through the Laplacian operator, combine with the boundary mask to generate a binary mask for artifacts; for each point marked as a suspected artifact, extract the feature mean and gradient direction of non-artifact points in its 3×3 neighborhood, and output the artifact removal features; The receptive field adaptive module for boundary complexity awareness calculates the boundary density of the boundary gradient map of the i-th layer of the encoder and outputs the boundary complexity score; it dynamically adjusts the receptive field size based on a preset hole rate candidate set.
[0019] The beneficial effects of this invention are as follows: The Sobel operator extracts boundary gradient magnitude maps and generates binary boundary masks. The weights of dilated convolution kernels are dynamically adjusted based on the gradient direction: the larger the gradient value in the boundary region, the higher the kernel weight, focusing on key edge features; the original kernel weights are maintained in non-boundary regions, without affecting global context modeling. This design allows the convolution kernel to focus on demand, effectively improving the boundary blurring problem of traditional methods and enhancing boundary localization accuracy. The boundary region residual between the dilated convolution output and the original features is calculated using a high-frequency residual boundary mask, correcting only boundary artifacts and avoiding information distortion in non-boundary regions. High-frequency components are extracted using the Laplacian operator, and artifact points are marked with a dynamic threshold. Then, depending on whether the artifact point is a boundary, neighborhood gradient direction repair or mean filling is used respectively, removing artifacts while preserving the original image details to the greatest extent possible. The boundary complexity score is obtained by calculating boundary density and tortuosity. The void ratio is adaptively selected from the preset void ratio candidate set—r=3 (7×7 receptive field) is selected for low complexity regions to capture global information, and r=1 (3×3 receptive field) is selected for high complexity regions to focus on local details. This completely solves the problem of global and local feature imbalance caused by the fixed receptive field of traditional methods. The overall method breaks through the three major performance bottlenecks of traditional methods. The high-precision building boundary segmentation results output can directly serve urban planning and provide reliable data support for subsequent building layout statistics. It has strong practical value and promotion potential. Attached Figure Description
[0020] The invention will now be further described with reference to the accompanying drawings.
[0021] Figure 1 This is a flowchart illustrating the steps of a remote sensing image building boundary segmentation method based on the U-net network model according to the present invention. Figure 2 This is a system module diagram of a remote sensing image building boundary segmentation system based on the U-net network model of the present invention. Detailed Implementation
[0022] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.
[0023] Example 1 like Figure 1 As shown in the embodiment of the present invention, a method for segmenting building boundaries in remote sensing images based on a U-net network model includes: S1: Construct a boundary-adaptive dilated convolutional unit, including: obtaining the feature map of the i-th layer of the encoder; extracting the boundary gradient magnitude map of the input image with artifacts using the Sobel operator to generate a binary boundary mask; adjusting the traditional dilated convolutional kernel to a boundary-adaptive kernel based on the gradient of the binary boundary mask and the boundary gradient magnitude map; adding a residual correction unit after the dilated convolutional layer to calculate the boundary region residual between the dilated convolutional output feature and the original feature, and outputting the corrected feature map. In S1, the generation of the binary boundary mask The specific process is as follows: Select the feature map Fi output from the i-th layer, and prepare the input image with artifacts to be processed and input it into the encoder (such as building images, as input data for subsequent edge detection). The classic Sobel operator is used to operate on the input image with artifacts to calculate the trend of pixel grayscale changes in the input image with artifacts, thereby obtaining the boundary gradient magnitude map G (the value of each pixel in the boundary gradient magnitude map G corresponds to the edge intensity at that location in the original image, and the larger the value, the more likely it is to be a boundary). The numerical range of the boundary gradient magnitude map G is scaled to the [0,1] interval for subsequent binarization judgment; A threshold is set (in this embodiment, the threshold is set to 0.5); when the gradient value of any pixel p in the boundary gradient magnitude map G is greater than the set threshold, the pixel is determined to belong to the boundary region, and the binary boundary mask is used. The corresponding position is marked as 1; otherwise, it is marked as 0 (when the gradient value of any pixel p in the boundary gradient magnitude map G is less than or equal to the set threshold). In S1, the binary boundary mask-based... Gradient of boundary gradient magnitude map G Adjusting the traditional dilated convolution kernel For boundary adaptation kernel The specific process is as follows: Based on the calculated binary boundary mask The gradient ∇G(p) of the boundary gradient magnitude map G (i.e., the direction and intensity of the gradient at each pixel) is used to modify the traditional dilated convolution kernel in the U-net encoder to obtain the boundary adaptation kernel. The specific improvement process is as follows: Introducing the parameter λ (λ=0.3 in this embodiment), and based on the formula... For traditional dilated convolution kernels Each position p is modified, where, To adapt the weight value of the dilated convolution kernel at position p to the modified boundary, This represents the original weight values of the traditional dilated convolution kernel at position p. The value of the binary boundary mask at position p. Let G be the gradient value of the boundary gradient magnitude map G at position p, and ⊙ be the element-wise multiplication operator; For non-boundary areas ( (representing non-boundary regions) That is, the kernel weights remain unchanged from the original dilated convolution kernel, without affecting the global receptive field and context modeling capability; For the boundary area ( (representing the boundary area) ; If the gradient value of the boundary gradient magnitude map G at position p is ( As the value of ) increases, the weight value of the modified boundary-adaptive dilated convolution kernel at position p also increases. If the gradient value of the boundary gradient magnitude map G at position p is ( As the value of the modified boundary-adaptive dilated convolution kernel decreases, the weight value of the kernel at position p also decreases. Through the above steps, boundary-aware dilated convolutional units are constructed in the dilated convolutional layers of the U-net encoder, which can more accurately capture boundary details and contextual features when processing images containing boundary information.
[0024] In S1, a residual correction unit is added after the dilated convolutional layer to calculate the boundary region residual between the dilated convolutional output feature and the original feature. The specific process of outputting the corrected feature is as follows: While dilated convolution can capture more information by expanding the receptive field, it can also easily cause detail distortion in image boundary areas due to pixel jumps. To address this issue, the specific implementation logic of adding a residual correction unit after the dilated convolution layer can be broken down into the following steps: Let the features of the input image with artifacts be... (Including: width W, height H, number of channels C), after processing by a dilated convolutional layer, the output features are: ; Calculate the boundary region residual between the dilated convolution output feature and the original feature, and generate a high-frequency residual boundary mask using an edge detection algorithm (such as the Sobel operator or the Canny operator). In high-frequency residual boundary mask In the diagram, boundary positions are marked as 1, and non-boundary positions are marked as 0; The boundary region residual between the dilated convolution output feature and the original feature. ; in, To calculate the difference between the dilated convolution output features and the original features element by element, For high-frequency residual boundary masks, This is element-wise multiplication; By introducing boundary masks Only The residuals are preserved at the boundary locations, while the residuals in the interior regions are set to zero; To ensure that the boundary features retain both the global information from the dilated convolution and closely approximate the original real-world details, it is necessary to reverse-correct the residuals. Specifically, this involves subtracting the proportional scaling value of the boundary region residuals from the dilated convolution output features. ; The scaling factor (in this embodiment, let be...) ), To correct features; It should be noted that the scaling factor is used to balance the correction strength and information preservation. If the scaling factor is too large, the features will regress excessively to the original state, losing the advantage of the large receptive field of dilated convolution. If the scaling factor is too small, the correction effect will be weak. A learning network model can be preset to learn the scaling factor. This invention does not impose a specific numerical limit on the scaling factor, which can be set according to the specific situation. S2: Input the current layer's corrected feature map, extract single-channel high-frequency components using the Laplacian operator, combine with the boundary mask to generate a binary mask for artifacts; for each point marked as a suspected artifact, extract the feature mean and gradient direction of non-artifact points in its 3×3 neighborhood, and output the artifact removal features; In S2, the process of inputting the corrected feature map of the current layer, extracting single-channel high-frequency components through the Laplacian operator, and generating an artifact binary mask by combining the boundary mask is as follows: Let the current layer's corrected feature map be... (Including: width W, height H, number of channels C), artifacts often manifest as local high-frequency noise. Therefore, the discrete Laplacian operator ∇² is needed to extract the high-frequency details of each channel. The classic four-neighbor Laplacian kernel is used to correct the feature map. Each channel is convolutionally processed independently to obtain single-channel high-frequency components; The high-frequency components of all channels are fused according to the maximum value of each pixel (or the average value or the maximum value of a single channel is taken, depending on the task's requirements for high-frequency sensitivity) to obtain a single-channel high-frequency component map. Introducing artifact detection boundary masks By using semantic segmentation or edge detection algorithms, pixels in the corrected feature map that belong to object boundaries or region edges are labeled. Artifact detection boundary mask A pixel with a median value of 1 indicates that high frequencies are allowed at that location; artifact detection boundary mask. Pixels with a median value of 0 represent non-boundary regions and high-frequency anomalies; Single-channel high-frequency components Artifact detection boundary mask Perform element-wise multiplication to obtain the high-frequency components in the non-boundary region. ;in, This is element-wise multiplication; Set dynamic threshold High-frequency components in non-boundary regions Pixels exceeding the threshold are marked as suspected artifacts. Generate artifact binary mask ; Dynamic threshold This is a reference value set by those skilled in the art based on their experience. In this embodiment, The value can be between 0.5 and 2.0; The specific process of extracting the feature mean and gradient direction of non-artifact points within its 3×3 neighborhood and outputting the artifact-removed features is as follows: In S2, for each point marked as a suspected artifact, the mean feature value and gradient direction of the non-artifact points in its 3×3 neighborhood are extracted, and the artifact removal features are output. The specific process is as follows: For each point marked as a suspected artifact Extract suspected artifact points A 3×3 local area surrounds p itself and its 8 neighbors in the top, bottom, left, right, front, and back. Exclude points that were also marked as suspected artifacts. Only non-artifact points are retained (i.e., pixels in the high-frequency components of non-boundary regions that do not exceed the threshold). Calculate suspected artifact points eigenmean And use gradient algorithms (such as the Sobel operator) to calculate suspected artifact points. gradient direction ; If suspected artifact point The boundary (Mb(p)=1): strictly follows the neighborhood gradient direction. repair; If suspected artifact point Not a boundary: combined with the mean Filling should prioritize ensuring feature consistency within the region; Through formula Output artifact removal features; in, The feature map is the original input. The symbol is a mask for suspected artifacts, and ⊙ represents element-wise multiplication. This is a function for artifact repair. S3: Calculate the boundary density of the boundary gradient map of the i-th layer of the encoder and output the boundary complexity score; dynamically adjust the receptive field size using a preset hole rate candidate set; In S3, the specific process of calculating the boundary density of the boundary gradient map of the i-th layer of the encoder and outputting the boundary complexity score is as follows: Assuming the output artifact-removed features are layered, the resulting image is the i-th layer with size W×H (total number of pixels W×H). The boundary gradient map of this layer is calculated using an edge detection algorithm (such as the Canny operator). : Canny operator first checks Perform gradient calculations (such as using the Sobel operator) to obtain the gradient magnitude and direction for each pixel. (p is the pixel index, and the gradient direction range is normalized to) Radius (to facilitate subsequent angle difference calculations); Calculate boundary density : ; Calculate boundary tortuosity : ; Calculate the boundary complexity score : ; The number of critical segments at the boundary. This represents the local angular feature at the p-th position; It should be noted that, The key segmentation of a boundary is essentially the total number of segments after extracting key features of the boundary's shape. In image processing, boundaries are composed of continuous pixels, but direct pixel-by-pixel analysis is redundant and inefficient. Therefore, it is necessary to first perform key segmentation on the boundary—identifying feature inflection points on the boundary (such as corners, abrupt changes in direction, curvature extrema, etc.), and treating the line segment between two adjacent inflection points as a key segment. That is, the number of these key segments; This represents the local angular feature at position p, used to quantify the directional information of the boundary at the local position; position p needs to be understood in conjunction with the partitioning logic of the key segments: if If p is the number of key segments, then p corresponds to these segments (or feature points within the segments). It is the tangent direction angle of the boundary at that location; if the boundary is stored as a "polyline segment" (such as being composed of the start-end coordinates of multiple line segments): Defined as the angle between the p-th line segment and a reference axis (such as the horizontal or vertical axis) (the range is usually taken as...). Radius (to avoid periodic ambiguity); if the boundary is stored in pixel chain code (such as Freeman chain code): The angle of the orientation encoding conversion of the p-th pixel in the corresponding chain code; In S3, the specific process of dynamically adjusting the receptive field size based on the preset hole rate candidate set is as follows: The preset candidate set for dilation rate is R={1,2,3}, and the logic for the corresponding receptive field size is: the receptive field of dilated convolution is determined by the dilation rate r; therefore: r=1 (standard convolution): receptive field is 3×3, focusing on extremely local details; r=2: The receptive field is expanded to 5×5 to balance details with small-scale context; r=3: The receptive field is further expanded to 7×7, capturing a wider range of long-distance associations.
[0025] Dynamic selection rules: Decision logic for three scenarios Based on boundary complexity score and threshold , ( The size relationship between the void ratio and the void ratio is used to select the void ratio in three categories: Low complexity (boundary complexity score less than the threshold) ): When the regional texture is simple and has very little variation (such as a large area of blue sky or flat wasteland), a large receptive field is more important than details. Choose r=3 and use a 7×7 receptive field to integrate global information to avoid losing long-distance connections due to limited field of view. Medium complexity (boundary complexity score greater than or equal to the threshold) Less than the threshold ): The area has some variations but no extreme details (such as a mixture of grass and shrubs, or a lightly textured wall). A trade-off needs to be made between context and detail. We chose r=2 and used a 5×5 receptive field to balance the two, preserving local features while connecting them to a slightly larger context. High complexity (boundary complexity score greater than or equal to the threshold) ): The region is extremely detailed, with dense and subtle edges (a difference of one pixel may correspond to a key structure in the real scene). At this time, a small receptive field is crucial. Choosing r=1 (standard convolution) and using a 3×3 receptive field to accurately capture each subtle structure will prevent a large receptive field from blurring small edges or textures. It should be noted that the threshold , The determination of the boundary complexity score needs to be based on the statistics of the task dataset. For example, calculate the boundary complexity score of all regions on the training set, divide the quantiles according to the proportion of low, medium and high samples (e.g., each accounting for 1 / 3), or optimize the performance through the validation set. Example 2 like Figure 2 As shown in Example 1, this invention provides a remote sensing image building boundary segmentation system based on the U-net network model, comprising: Boundary-adaptive dilated convolution module: Constructs a boundary-adaptive dilated convolution unit, including: obtaining the feature map of the i-th layer of the encoder; extracting the boundary gradient magnitude map of the input image with artifacts using the Sobel operator to generate a binary boundary mask; adjusting the traditional dilated convolution kernel to a boundary-adaptive kernel based on the gradient of the binary boundary mask and the boundary gradient magnitude map; adding a residual correction unit after the dilated convolution layer to calculate the boundary region residual between the dilated convolution output feature and the original feature, and outputting a corrected feature map; High-frequency artifact detection and repair module: Input the current layer correction feature map, extract single-channel high-frequency components through the Laplacian operator, combine with the boundary mask to generate a binary mask for artifacts; for each point marked as a suspected artifact, extract the feature mean and gradient direction of non-artifact points in its 3×3 neighborhood, and output the artifact removal features; The receptive field adaptive module for boundary complexity awareness calculates the boundary density of the boundary gradient map of the i-th layer of the encoder and outputs the boundary complexity score; it dynamically adjusts the receptive field size based on a preset hole rate candidate set.
[0026] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for building boundary segmentation in remote sensing images based on the U-net network model, characterized in that: include: S1: Construct a boundary-adaptive dilated convolutional unit, including: obtaining the feature map of the i-th layer of the encoder, extracting the boundary gradient magnitude map of the input image with artifacts through the Sobel operator, and generating a binary boundary mask; Based on the binary boundary mask and the gradient of the boundary gradient magnitude map, the traditional dilated convolution kernel is adjusted to a boundary adaptation kernel; a residual correction unit is added after the dilated convolution layer to calculate the boundary region residual between the dilated convolution output feature and the original feature, and output the corrected feature map. S2: Input the current layer's corrected feature map, extract single-channel high-frequency components using the Laplacian operator, combine with the boundary mask to generate a binary mask for artifacts; for each point marked as a suspected artifact, extract the feature mean and gradient direction of non-artifact points in its 3×3 neighborhood, and output the artifact removal features; S3: Calculate the boundary density of the boundary gradient map of the i-th layer of the encoder and output the boundary complexity score; dynamically adjust the receptive field size using a preset void ratio candidate set.
2. The method for building boundary segmentation in remote sensing images based on the U-net network model according to claim 1, characterized in that: The specific process for generating the binary boundary mask is as follows: Select the feature map Fi output from the i-th layer and prepare the input image with artifacts to be processed and input it into the encoder; The classic Sobel operator is used to operate on the input image with artifacts to calculate the trend of pixel grayscale changes in the input image with artifacts, thereby obtaining the boundary gradient magnitude map G. The numerical range of the boundary gradient magnitude map G is scaled to the [0,1] interval for subsequent binarization judgment; A threshold is set; when the gradient value of any pixel p in the boundary gradient magnitude map G is greater than the set threshold, the pixel is determined to belong to the boundary region, and a binary boundary mask is used. The corresponding position is marked as 1; otherwise, it is marked as 0.
3. The method for segmenting building boundaries in remote sensing images based on the U-net network model according to claim 1, characterized in that: The specific process of adjusting the traditional dilated convolution kernel to a boundary-adapting kernel based on the gradient of the binary boundary mask and the boundary gradient magnitude map is as follows: Based on the calculated binary boundary mask The gradient ∇G(p) of the boundary gradient magnitude map G is used to modify the original traditional dilated convolution kernel in the U-net encoder to obtain the boundary adaptation kernel. The specific improvement process is as follows: Introduce the parameter λ, and based on the formula For traditional dilated convolution kernels Each position p is modified, where, To adapt the weight value of the dilated convolution kernel at position p to the modified boundary, This represents the original weight values of the traditional dilated convolution kernel at position p. The value of the binary boundary mask at position p. Let G be the gradient value of the boundary gradient magnitude map G at position p, and ⊙ be the element-wise multiplication operator; For non-boundary regions, That is, the kernel weights remain unchanged from the original dilated convolution kernel, without affecting the global receptive field and context modeling capability; For the boundary region, .
4. The method for segmenting building boundaries in remote sensing images based on the U-net network model according to claim 3, characterized in that: The specific process of adjusting the traditional dilated convolution kernel to a boundary-adapting kernel based on the gradient of the binary boundary mask and the boundary gradient magnitude map also includes: If the gradient value of the boundary gradient magnitude map G at position p increases, then the weight value of the modified boundary-adapted dilated convolution kernel at position p will also increase. If the gradient value of the boundary gradient magnitude map G at position p decreases, then the weight value of the modified boundary-adapted dilated convolution kernel at position p will also decrease.
5. The method for segmenting building boundaries in remote sensing images based on the U-net network model according to claim 1, characterized in that: The specific process of outputting corrected features is as follows: Let the features of the input image with artifacts be... (Including: width W, height H, number of channels C), after processing by a dilated convolutional layer, the output features are: ; Calculate the boundary region residual between the dilated convolution output feature and the original feature, and generate a high-frequency residual boundary mask using an edge detection algorithm. In high-frequency residual boundary mask In the diagram, boundary positions are marked as 1, and non-boundary positions are marked as 0; The boundary region residual between the dilated convolution output feature and the original feature. ; in, To calculate the difference between the dilated convolution output features and the original features element by element, For high-frequency residual boundary masks, This is element-wise multiplication; By introducing boundary masks Only The residuals are preserved at the boundary locations, while the residuals in the interior regions are set to zero; The output features of dilated convolution are scaled by subtracting the residuals in the boundary region. ; This is the scaling factor. To correct features.
6. The method for segmenting building boundaries in remote sensing images based on the U-net network model according to claim 1, characterized in that: The specific process of generating the artifact binary mask is as follows: Let the current layer's corrected feature map be... The discrete Laplacian operator ∇² is used to extract high-frequency details of each channel, and the classic four-neighbor Laplacian kernel is used to correct the feature map. Each channel is convolutionally processed independently to obtain single-channel high-frequency components; The high-frequency components of all channels are fused according to the maximum value per pixel to obtain a single-channel high-frequency component map; Introducing artifact detection boundary masks By using semantic segmentation or edge detection algorithms, pixels in the corrected feature map that belong to object boundaries or region edges are labeled. Artifact detection boundary mask A pixel with a median value of 1 indicates that high frequencies are allowed at that location; artifact detection boundary mask. Pixels with a median value of 0 represent non-boundary regions and high-frequency anomalies; Single-channel high-frequency components Artifact detection boundary mask Perform element-wise multiplication to obtain the high-frequency components in the non-boundary region. ;in, This is element-wise multiplication; Set dynamic threshold High-frequency components in non-boundary regions Pixels exceeding the threshold are marked as suspected artifacts. Generate artifact binary mask .
7. The method for building boundary segmentation in remote sensing images based on the U-net network model according to claim 1, characterized in that: The specific process of outputting artifact removal features is as follows: For each point marked as a suspected artifact Extract suspected artifact points A small, localized area of 3x3 surrounding it; Exclude points also marked as suspected artifacts For points, only those not suspected artifacts are retained; Calculate suspected artifact points eigenmean And use gradient algorithm to calculate suspected artifact points. gradient direction .
8. The method for segmenting building boundaries in remote sensing images based on the U-net network model according to claim 7, characterized in that: The specific process of outputting artifact removal features also includes: If suspected artifact point It is a boundary: strictly follows the neighborhood gradient direction. repair; If suspected artifact point Not a boundary: combined with the mean Filling should prioritize ensuring feature consistency within the region; Through formula Output artifact removal features; in, The feature map is the original input. The symbol is a mask for suspected artifacts, and ⊙ represents element-wise multiplication. This is a function for artifact repair.
9. The method for segmenting building boundaries in remote sensing images based on the U-net network model according to claim 1, characterized in that: The specific process of outputting the boundary complexity score is as follows: Assuming the output artifact-removed features are layered, the resulting image is the i-th layer with size W×H. The boundary gradient map of this layer is calculated using an edge detection algorithm. : Canny operator first checks Perform gradient calculations to obtain the gradient magnitude and direction for each pixel. ; Calculate boundary density : ; Calculate boundary tortuosity : ; Calculate the boundary complexity score : ; The number of critical segments at the boundary. This represents the local angular feature at the p-th position.
10. The method for segmenting building boundaries in remote sensing images based on the U-net network model according to claim 1, characterized in that: The specific process of dynamically adjusting the receptive field size is as follows: The preset candidate set for dilation rate is R={1,2,3}, and the receptive field of dilated convolution is determined by the dilation rate r; therefore: r=1: The receptive field is 3×3; r=2: The receptive field is expanded to 5×5; r=3: The receptive field is expanded to 7×7; Based on boundary complexity score and threshold , Based on the size relationship, the void ratio is selected in three categories: Low complexity: Choose r=3 and use a 7×7 receptive field; Medium complexity: Choose r=2 and use a 5×5 receptive field; High complexity: Choose r=1 and use a 3×3 receptive field.
Citation Information
Patent Citations
Integrated image restoration method and system based on image mask modeling
CN119722531A
MRI medical image correction method and system based on convolutional neural network, and computer readable storage medium
CN119963681A
Remote sensing large model construction method fusing edge semantic knowledge
CN120726320A
Artificial intelligence image segmentation processing method and device, equipment and medium
CN120782796A
Automation of zero-shot image segmentation
EP4592950A1
Cited By
Urban landscape evaluation system based on image element recognition
CN121982030A
