Mountain city building information intelligent extraction method based on terrain adaptive PSPNet

By using the terrain-adaptive PSPNet method, a terrain slope map is generated, the receptive field is dynamically adjusted, terrain-constrained pyramid pooling and cross-modal attention fusion are introduced, and the loss function is optimized. This solves the problems of accuracy and robustness in building information extraction in mountainous cities and achieves high-precision building boundary localization.

CN121962896APending Publication Date: 2026-05-01CHONGQING UNIV OF ARTS & SCI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202512048464.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing technologies for extracting building information in mountainous cities suffer from insufficient generalization ability, failure of multi-scale feature fusion, lack of terrain geometric constraints, and inefficient multimodal data fusion, making it difficult to adapt to high-precision extraction of complex terrain and building forms.

Method used

By generating terrain slope maps, dynamically adjusting the receptive field, introducing terrain-constrained pyramid pooling and cross-modal attention fusion, and combining lightweight edge optimization, the multi-task loss function is optimized to improve the robustness and accuracy of the model in complex terrain.

Benefits of technology

It achieves high-precision extraction of building information in complex terrain, solves the problems of blurred building edges and insufficient terrain adaptability of traditional models in mountainous cities, and improves the accuracy of building boundary positioning and the robustness of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962896A_ABST
    Figure CN121962896A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of mountain city building information extraction, and discloses a mountain city building information intelligent extraction method based on terrain self-adaption PSPNet, and the method comprises the following specific steps: 1, generating a terrain slope map, and synchronously obtaining an optical remote sensing image and digital surface model DSM data; according to the method, a local slope angle is calculated according to DSM through a dynamic receptive field adjustment mechanism, and the expansion rate of expansion convolution is dynamically adjusted, so that the model can automatically adapt to the coupling characteristics of mountain buildings and terrains; topographic constraint pyramid pooling is carried out, a traditional pyramid pooling module is improved, and a topographic elevation map is superposed as condition input before pooling operation, so that feature extraction of different scales is synchronized with topographic geometric constraint; according to the method, multi-modal features are decoupled and fused, a double-branch encoder structure is designed, an optical image and a DSM are processed respectively, feature alignment is realized through a cross-modal attention mechanism, and the problem of edge blurring caused by modal conflicts in a traditional method is solved.
Need to check novelty before this filing date? Find Prior Art

Description

A method for intelligent extraction of building information in mountainous cities based on terrain-adaptive PSPNet Technical Field

[0001] This invention belongs to the field of building information extraction technology in mountainous cities, specifically a method for intelligent extraction of building information in mountainous cities based on terrain-adaptive PSPNet. Background Technology

[0002] PSPNet Mountain City Building Information Extraction is a technical method that uses the deep learning model of Pyramid Scene Parsing Network (PSPNet) and combines it with high-resolution remote sensing image data of mountain cities. Through multi-scale feature fusion and global context modeling, it realizes the automated and high-precision extraction of building outlines, locations and other information under complex terrain. Its core lies in capturing multi-scale contextual information of images through pyramid pooling.

[0003] Extracting building information from mountainous cities faces challenges such as complex terrain, diverse building forms, and severe occlusion. Existing technologies suffer from the following core shortcomings: traditional deep learning models lack generalization ability; conventional semantic segmentation models (such as U-Net and DeepLabv3+) use convolutional kernels with fixed receptive fields, making it difficult to adapt to the highly coupled characteristics of buildings and terrain in mountainous cities; multi-scale feature fusion fails, as mountainous buildings exhibit significant scale differences (e.g., high-rise residential buildings versus low-rise houses), and traditional pyramid pooling modules use fixed-scale pooling operations, failing to dynamically adjust the receptive field; terrain geometric constraints are lacking, as existing methods do not establish a geometric relationship between building outlines and terrain contour lines; and multimodal data fusion is inefficient, with simple stitching of optical images and DSM (Digital Surface Model) leading to feature conflicts, thus requiring improvement. Summary of the Invention

[0004] The purpose of this invention is to provide an intelligent extraction method for building information in mountainous cities based on terrain-adaptive PSPNet, so as to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for intelligent extraction of building information in mountainous cities based on terrain-adaptive PSPNet, the specific steps of which are as follows:

[0006] Step 1: Generating a terrain slope map

[0007] Optical remote sensing images and digital surface model (DSM) data are acquired simultaneously. Radiometric correction is performed on the optical image data, and noise reduction is performed on the DSM data. The resolution is unified to 0.2m using the nearest neighbor interpolation method. The terrain slope angle is calculated based on the processed DSM data, and the slope angle θ is linearly mapped to the grayscale range of [0,255] to generate a slope grayscale map with the same resolution as the DSM.

[0008] Step 2: Dynamic Receptive Field Adjustment Mechanism

[0009] The expansion rate is dynamically adjusted based on the slope grayscale map to achieve dynamic adjustment of the receptive field and solve the problem of drastic changes in the scale of mountain buildings;

[0010] Step 3: Two-branch feature encoding

[0011] Feature extraction is performed on the optical image branch and the digital surface model (DSM) branch to generate optical image feature maps and terrain-enhanced DSM feature maps, thereby enhancing the model's ability to jointly model terrain geometry and building spectral features.

[0012] Step 4: Terrain-Constrained Pyramid Pooling

[0013] Capture multi-scale contextual information and generate a global feature map for terrain awareness through multi-scale pooling and dynamic pooling operations;

[0014] Step 5: Cross-modal attention fusion

[0015] Non-local attention is used to calculate the similarity matrix between optical image features and digital surface model (DSM), and then feature weighting is performed to generate a cross-modal fusion feature map, which solves the problem of feature modal differences between optical image and DSM and strengthens the guiding role of terrain in architectural semantics.

[0016] Step Six: Lightweight Edge Optimization

[0017] Based on the cross-modal fusion feature map, edge features are extracted, and then the cross-modal fusion features are dynamically weighted through a gating mechanism. After edge fusion, an edge-enhanced segmentation feature map is generated, thereby improving the accuracy of building boundary positioning and solving the problem of edge blurring.

[0018] Step 7: Optimization of Multi-Task Loss Function

[0019] By calculating the main loss and edge loss, the model parameters are optimized to balance the optimization objectives of building classification and edge localization, thereby improving the robustness of the model in complex terrain.

[0020] Step 8: Post-processing

[0021] The pixel-level segmentation results are converted into standardized vector data to meet the application requirements of geographic information systems.

[0022] As a preferred embodiment of the present invention, the terrain slope angle mentioned in step one is calculated using ArcGIS's Surface Parameters tool, and the calculation formula is as follows:

[0023]

[0024] In the formula, θ is the terrain slope angle, Δh is the elevation difference between adjacent pixels, and x is the pixel spacing (0.5m);

[0025] The method for generating the slope map is as follows: the slope angle θ [0°, 45°] is linearly mapped to the grayscale range [0, 255] to generate a slope grayscale map with the same resolution as the Digital Surface Model (DSM) and then normalized. The normalization formula is:

[0026]

[0027] In the formula, I slope Represents the grayscale of the slope, θ min θ mini This represents the minimum / maximum slope in the dataset.

[0028] As a preferred embodiment of the present invention, the dynamic receptive field adjustment mechanism described in step two is implemented as follows:

[0029] Input a grayscale image of the slope and a pre-trained ResNet50 model (encoder base network);

[0030] Dynamic adjustment calculation of dilation rate: The dilation rate of dilated convolution is calculated based on the slope angle, using the following formula:

[0031] d = α·tan(θ)

[0032] In the formula, d represents the expansion rate; α is an empirical coefficient; and θ represents the terrain slope angle.

[0033] Dilated convolution kernel initialization: In the encoder stage of PSPNet, the 3×3 convolutions of the Conv3, Conv4, and Conv5 layers of ResNet50 are replaced with dynamically dilated convolutions, with the initial dilation rate set to d0 = 1, which is dynamically adjusted with θ.

[0034] Output a ResNet50 encoder initialized with dynamic dilated convolution.

[0035] As a preferred embodiment of the present invention, the dual-branch feature encoding described in step three is implemented as follows:

[0036] Input optical image data, digital surface model (DSM) data, and a ResNet50 encoder initialized with dynamic dilated convolution;

[0037] Optical Imaging Branch: A ResNet50 encoder initialized with dynamic dilated convolution extracts 5-level feature maps. (C1-C5), the number of channels doubles at each level, namely [64,256,512,1024,2048];

[0038] Digital Surface Model (DSM) branch: Design a DenseNet-121 variant (4 dense blocks, growth rate k=32), insert a terrain slope encoding layer (1×1 convolution) after each dense block, embed θ into the feature channel, and enhance terrain geometric constraints:

[0039]

[0040] In the formula, Represents the first layer DSM features, Conv 1×1 Indicates channel splicing, I slope Indicates the grayscale value of the slope;

[0041] Feature alignment: Affine transformation is performed on the bi-branch feature maps using a spatial transformation network to eliminate resolution differences between modalities.

[0042]

[0043] In the formula, T represents the simulation transformation matrix; s x s y Indicates the scaling factor; t x t y Indicates the amount of translation;

[0044] Output: Optical image feature map (C1-C5); Topographically Enhanced Digital Surface Model (DSM) Feature Map F dsm (Same resolution as C5)

[0045] As a preferred embodiment of the present invention, the terrain-constrained pyramid pooling implementation method in step four is as follows:

[0046] Multi-scale pooling: Slope map channels are stitched before the pyramid pooling module to generate terrain-enhanced feature maps.

[0047] Dynamic pooling operation: for F terrain Perform 4 levels of adaptive pooling, and after each pooling level, reduce the dimensionality to 512 channels using 1×1 convolution:

[0048]

[0049] Terrain condition fusion: Upsample the pooled feature map to the input size and compare it with the original F... terrain By stitching together channels, global features for terrain awareness are generated:

[0050]

[0051] F is obtained through 1×1 convolution. global The number of channels has been reduced to 1024;

[0052] Output: Global feature map F for terrain awareness global (1 / 16 input resolution, 1024 channels).

[0053] As a preferred embodiment of the present invention, the cross-modal attention fusion method described in step five is as follows:

[0054] Input: Optical image feature map F opt and Digital Surface Model (DSM) Feature Map F dsm ;

[0055] Attention mechanism: Non-local attention is used to compute optical image features F opt With the digital surface model (DSM) feature F dsm Similarity matrix S i,j The formula is:

[0056]

[0057] In the formula, i represents the optical image feature map F. opt The spatial location index; j represents the spatial location index of the Digital Surface Model (DSM) feature map; k represents the channel dimension index (i.e., the channel number of the feature map); C(x) represents the normalization coefficient, denoted as C(x) = N. k (Number of channels);

[0058] Feature weighting: generating attention weight map A using Softmax. i,j ,

[0059]

[0060] For F dsm We perform a weighted summation to obtain F. att ;

[0061]

[0062] In the formula, N represents the vector dimension;

[0063] Feature fusion generation: F att optical image feature map (C1-C5) Add element by element:

[0064]

[0065] Output: Cross-modal fused feature map F fused .

[0066] As a preferred technical solution of the present invention, the lightweight edge optimization implementation method in step six is ​​as follows:

[0067] Input cross-modal fusion feature map F fused ;

[0068] Edge feature extraction: A Gated-SCNN branch is introduced at the end of the ResNet50 encoder, using a 3×3 depthwise separable convolution (DWConv). 3×3 Extracting edge features F edge :

[0069] F edge =DWConv 3×3 (ReLU(BN(DWConv 3×3 (F fused ))))

[0070] Gating mechanism: An edge-gated signal G is generated using the Sigmoid function σ, and the fused feature F is then... fused Dynamic weighting is performed using the following formula:

[0071] G=σ(Conv 1×1 (ReLU(BN(Conv 1×1 (F fused )))))

[0072] Edge blending: F edge With F fused Element-wise multiplication generates edge-enhanced segmentation features F. seg

[0073] F seg =F fused ⊙G+F edge

[0074] Output edge-enhanced segmentation feature map F seg .

[0075] As a preferred embodiment of the present invention, the multi-task loss function optimization method described in step seven is as follows:

[0076] Input: Predicted segmentation map P; Ground truth labels G (building / non-building binary classification mask); Predicted edge map E (generated from P using the Sobel operator); Ground truth edge map G edge (Generated from G via the Canny operator);

[0077] Calculation process:

[0078] Main loss: Weighted cross-entropy loss L ce Give higher weight to building categories:

[0079]

[0080] In the formula, the weight ω for the building category is... i =2.0; Non-building category weight ω i =1.0;

[0081] Edge loss: Introduce edge loss L edge Strengthen boundary constraints, the formula is:

[0082]

[0083] The formula for calculating the total loss is:

[0084] L total =L ce +λL edge

[0085] In the formula, N represents the total number of pixels; i represents the pixel index (traversing all pixels or only edge pixels); p i This represents the probability predicted by the model that the i-th pixel belongs to the building edge; g i λ represents the true edge label of the i-th pixel; λ represents the weight hyperparameter of the edge loss.

[0086] Output the optimized model parameters.

[0087] As a preferred embodiment of the present invention, the post-processing process described in step eight is as follows:

[0088] Input the predicted segmentation map P;

[0089] CRF optimization: A fully connected conditional random field is used to refine the segmentation results, and the spatial kernel parameter σ is set. α =3, Color kernel parameter σ β =10;

[0090] Contour vectorization: The building contours are extracted using OpenCV's findContours function; the contours are simplified using the Douglas-Peucker algorithm with a tolerance threshold of 0.5 pixels; GeoJSON format vector data is generated, containing building contours, area, and terrain slope attributes.

[0091] Output vectorized building outlines (GeoJSON format).

[0092] The beneficial effects of this invention are as follows:

[0093] This invention introduces terrain slope awareness through a dynamic receptive field adjustment mechanism. It calculates the local slope angle based on the DSM (Distributed Slope Map) and dynamically adjusts the dilation rate of the dilated convolution, enabling the model to automatically adapt to the coupling characteristics of mountainous architecture and terrain. It employs terrain-constrained pyramid pooling, improving upon traditional pyramid pooling by overlaying a terrain elevation map as a conditional input before pooling, synchronizing feature extraction at different scales with terrain geometric constraints and improving the accuracy of multi-scale feature fusion. For multimodal feature decoupling and fusion, a dual-branch encoder structure is designed to process optical images (extracting texture features) and DSM (extracting geometric features) separately. A cross-modal attention mechanism is used to achieve feature alignment, resolving the edge blurring problem caused by modal conflicts in traditional methods. Lightweight edge optimization is achieved by introducing a Gated-SCNN edge-aware branch at the decoder end, using a gating mechanism to balance semantic information and edge details, resulting in high-precision mapping. Attached Figure Description

[0094] Figure 1 is a flowchart of the present invention;

[0095] Figure 2 is an example of the application of the present invention. Detailed Implementation

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

[0097] As shown in Figures 1 and 2, this embodiment of the invention provides a method for intelligent extraction of building information in mountainous cities based on terrain-adaptive PSPNet. The specific steps are as follows:

[0098] Step 1: Generating a terrain slope map

[0099] Optical remote sensing images and digital surface model (DSM) data are acquired simultaneously. Radiometric correction is performed on the optical image data, and noise reduction is performed on the DSM data. The resolution is unified to 0.2m using the nearest neighbor interpolation method. The terrain slope angle is calculated based on the processed DSM data, and the slope angle θ is linearly mapped to the grayscale range of [0,255] to generate a slope grayscale map with the same resolution as the DSM.

[0100] Step 2: Dynamic Receptive Field Adjustment Mechanism

[0101] The expansion rate is dynamically adjusted based on the slope grayscale map to achieve dynamic adjustment of the receptive field and solve the problem of drastic changes in the scale of mountain buildings;

[0102] Step 3: Two-branch feature encoding

[0103] Feature extraction is performed on the optical image branch and the digital surface model (DSM) branch to generate optical image feature maps and terrain-enhanced DSM feature maps, thereby enhancing the model's ability to jointly model terrain geometry and building spectral features.

[0104] Step 4: Terrain-Constrained Pyramid Pooling

[0105] Capture multi-scale contextual information and generate a global feature map for terrain awareness through multi-scale pooling and dynamic pooling operations;

[0106] Step 5: Cross-modal attention fusion

[0107] Non-local attention is used to calculate the similarity matrix between optical image features and digital surface model (DSM), and then feature weighting is performed to generate a cross-modal fusion feature map, which solves the problem of feature modal differences between optical image and DSM and strengthens the guiding role of terrain in architectural semantics.

[0108] Step Six: Lightweight Edge Optimization

[0109] Based on the cross-modal fusion feature map, edge features are extracted, and then the cross-modal fusion features are dynamically weighted through a gating mechanism. After edge fusion, an edge-enhanced segmentation feature map is generated, thereby improving the accuracy of building boundary positioning and solving the problem of edge blurring.

[0110] Step 7: Optimization of Multi-Task Loss Function

[0111] By calculating the main loss and edge loss, the model parameters are optimized to balance the optimization objectives of building classification and edge localization, thereby improving the robustness of the model in complex terrain.

[0112] Step 8: Post-processing

[0113] The pixel-level segmentation results are converted into standardized vector data to meet the application requirements of geographic information systems.

[0114] In the data layer of the PSPNet model, this method introduces prior knowledge of terrain through multimodal data fusion; in the feature layer, it dynamically adjusts the receptive field and explicitly models the terrain-building relationship; in the decision layer, it jointly optimizes classification and edge localization tasks to improve adaptability to complex scenes; in the output layer, it achieves high-precision conversion from pixels to vectors through post-processing. Figure 2 is an example of the application of the method of this invention in the intelligent extraction of building information in Yuzhong District, Chongqing.

[0115] In step one, the terrain slope angle is calculated using ArcGIS's Surface Parameters tool, and the formula is as follows:

[0116]

[0117] In the formula, θ is the terrain slope angle, Δh is the elevation difference between adjacent pixels, and x is the pixel spacing (0.5m);

[0118] The method for generating the slope map is as follows: the slope angle θ [0°, 45°] is linearly mapped to the grayscale range [0, 255] to generate a slope grayscale map with the same resolution as the Digital Surface Model (DSM), and then normalized. The normalization formula is:

[0119]

[0120] In the formula, I slope Represents the grayscale of the slope, θ min θ mini This represents the minimum / maximum slope in the dataset.

[0121] ArcGIS's Surface Parameters tool is a geoprocessing tool for calculating raster surface parameters such as aspect, slope, and curvature. It uses a geodesic method to perform the calculations and can output hosted image layers, providing critical data support for terrain analysis in Geographic Information Systems (GIS).

[0122] The dynamic receptive field adjustment mechanism in step two is implemented as follows:

[0123] Input a grayscale image of the slope and a pre-trained ResNet50 model (encoder base network);

[0124] Dynamic adjustment calculation of dilation rate: The dilation rate of dilated convolution is calculated based on the slope angle, using the following formula:

[0125] d = α·tan(θ)

[0126] In the formula, d represents the expansion rate; α is an empirical coefficient; and θ represents the terrain slope angle.

[0127] Dilated convolution kernel initialization: In the encoder stage of PSPNet, the 3×3 convolutions of the Conv3, Conv4, and Conv5 layers of ResNet50 are replaced with dynamically dilated convolutions, with the initial dilation rate set to d0 = 1, which is dynamically adjusted with θ.

[0128] Output a ResNet50 encoder initialized with dynamic dilated convolution.

[0129] α is set to 2.5 to ensure that the receptive field expands by 1.5 times for every 10° increase in slope. During training, the expansion rate is dynamically adjusted according to the input slope map and updated once every 100 iterations.

[0130] The implementation method of the dual-branch feature encoding in step three is as follows:

[0131] Input optical image data, digital surface model (DSM) data, and a ResNet50 encoder initialized with dynamic dilated convolution;

[0132] Optical Imaging Branch: A ResNet50 encoder initialized with dynamic dilated convolution extracts 5-level feature maps. (C1-C5), the number of channels doubles at each level, namely [64,256,512,1024,2048];

[0133] Digital Surface Model (DSM) branch: Design a DenseNet-121 variant (4 dense blocks, growth rate k=32), insert a terrain slope encoding layer (1×1 convolution) after each dense block, embed θ into the feature channel, and enhance terrain geometric constraints:

[0134]

[0135] In the formula, Represents the first layer DSM features, Conv 1×1 Indicates channel splicing, I slope Indicates the grayscale value of the slope;

[0136] Feature alignment: Affine transformation is performed on the bi-branch feature maps using a spatial transformation network to eliminate resolution differences between modalities.

[0137]

[0138] In the formula, T represents the simulation transformation matrix; s x s y Indicates the scaling factor; t x t y Indicates the amount of translation;

[0139] Output: Optical image feature map (C1-C5); Topographically Enhanced Digital Surface Model (DSM) Feature Map F dsm (Same resolution as C5)

[0140] Spatial Transformation Network is a differentiable spatial transformation module designed to improve the model's adaptability to geometric transformations and enhance model performance by dynamically adjusting the geometry of the input image or feature map. During computation, the scaling factor is calculated by the ratio of the digital surface model (DSM) to the optical image resolution, and the translation amount is determined by center point alignment.

[0141] The implementation method of terrain-constrained pyramid pooling in step four is as follows:

[0142] Multi-scale pooling: Slope map channels are stitched before the pyramid pooling module to generate terrain-enhanced feature maps.

[0143] Dynamic pooling operation: for F terrain Perform 4 levels of adaptive pooling, and after each pooling level, reduce the dimensionality to 512 channels using 1×1 convolution:

[0144]

[0145] Terrain condition fusion: Upsample the pooled feature map to the input size and compare it with the original F... terrain By stitching together channels, global features for terrain awareness are generated:

[0146]

[0147] F is obtained through 1×1 convolution. global The number of channels has been reduced to 1024;

[0148] Output: Global feature map F for terrain awareness global (1 / 16 input resolution, 1024 channels).

[0149] For F terrain When performing 4-level adaptive pooling, the pooling kernel sizes are [1×1, 2×2, 3×3, 6×6].

[0150] The cross-modal attention fusion in step five is implemented as follows:

[0151] Input: Optical image feature map F opt and Digital Surface Model (DSM) Feature Map F dsm ;

[0152] Attention mechanism: Non-local attention is used to compute optical image features F opt With the digital surface model (DSM) feature F dsm Similarity matrix S i,j The formula is:

[0153]

[0154] In the formula, i represents the optical image feature map F. opt The spatial location index; j represents the spatial location index of the Digital Surface Model (DSM) feature map; k represents the channel dimension index (i.e., the channel number of the feature map); C(x) represents the normalization coefficient, denoted as C(x) = N. k (Number of channels);

[0155] Feature weighting: generating attention weight map A using Softmax. i,j ,

[0156]

[0157] For F dsm We perform a weighted summation to obtain F. att ;

[0158]

[0159] In the formula, N represents the vector dimension;

[0160] Feature fusion generation: F att optical image feature map (C1-C5) Add element by element:

[0161]

[0162] Output: Cross-modal fused feature map F fused .

[0163] Optical image feature map F opt The resolution is 1 / 16, with 2048 channels; the digital surface model (DSM) feature map is 1 / 16, with 256 channels; the output cross-modal fusion feature map F... fused It has a 1 / 16 resolution and 2048 channels.

[0164] The lightweight edge optimization in step six is ​​implemented as follows:

[0165] Input cross-modal fusion feature map F fused ;

[0166] Edge feature extraction: A Gated-SCNN branch is introduced at the end of the ResNet50 encoder, using a 3×3 depthwise separable convolution (DWConv). 3×3 Extracting edge features F edge :

[0167] F edge =DWConv3×3 (ReLU(BN(DWConv 3×3 (F fused ))))

[0168] Gating mechanism: An edge-gated signal G is generated using the Sigmoid function σ, and the fused feature F is then... fused Dynamic weighting is performed using the following formula:

[0169] G=σ(Conv 1×1 (ReLU(BN(Conv 1×1 (F fused )))))

[0170] Edge blending: F edge With F fused Element-wise multiplication generates edge-enhanced segmentation features F. seg

[0171] F seg =F fused ⊙G+F edge

[0172] Output edge-enhanced segmentation feature map F seg .

[0173] Gated-SCNN is an innovative two-stream convolutional neural network architecture designed specifically for semantic segmentation tasks. By separating the shape information processing stream from the classical feature stream and introducing a gating mechanism, it significantly improves the accuracy of boundary prediction and the segmentation performance for small objects; the output is an edge-enhanced segmentation feature map F. seg It has a 1 / 16 resolution and 256 channels.

[0174] The multi-task loss function optimization in step seven is implemented as follows:

[0175] Input: Predicted segmentation map P; Ground truth labels G (building / non-building binary classification mask); Predicted edge map E (generated from P using the Sobel operator); Ground truth edge map G edge (Generated from G via the Canny operator);

[0176] Calculation process:

[0177] Main loss: Weighted cross-entropy loss L ce Give higher weight to building categories:

[0178]

[0179] In the formula, the weight ω for the building category is... i =2.0; Non-building category weight ω i =1.0;

[0180] Edge loss: Introduce edge loss L edge Strengthen boundary constraints, the formula is:

[0181]

[0182] The formula for calculating the total loss is:

[0183] L total =L ce +λL edge

[0184] In the formula, N represents the total number of pixels; i represents the pixel index (traversing all pixels or only edge pixels); p i This represents the probability predicted by the model that the i-th pixel belongs to the building edge; g i λ represents the true edge label of the i-th pixel; λ represents the weight hyperparameter of the edge loss.

[0185] Output the optimized model parameters.

[0186] λ is used to balance the main task and the edge constraints. In the experimental calculations, λ = 5 is taken.

[0187] The specific post-processing procedure in step eight is as follows:

[0188] Input the predicted segmentation map P;

[0189] CRF optimization: A fully connected conditional random field is used to refine the segmentation results, and the spatial kernel parameter σ is set. α =3, Color kernel parameter σ β =10;

[0190] Contour vectorization: The building contours are extracted using OpenCV's findContours function; the contours are simplified using the Douglas-Peucker algorithm with a tolerance threshold of 0.5 pixels; GeoJSON format vector data is generated, containing building contours, area, and terrain slope attributes.

[0191] Output vectorized building outlines (GeoJSON format).

[0192] Fully connected conditional random fields are a type of conditional random field model in an image where each pixel is related to all other pixels. It establishes a binary potential function for each pixel pair and processes the classification results obtained by deep learning by combining the relationships between all pixels in the original image to optimize coarse and uncertain labels in the classified image, correct fragmented misclassified regions, and obtain more detailed segmentation boundaries.

[0193] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0194] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for intelligent extraction of building information in mountainous cities based on terrain-adaptive PSPNet, characterized in that, The specific steps are as follows: Step 1: Topographic slope map generation. Optical remote sensing images and digital surface model (DSM) data are acquired simultaneously. Radiometric correction is performed on the optical image data, and noise reduction is applied to the DSM data. The resolution is unified to 0.2m using nearest neighbor interpolation. The topographic slope angle is calculated based on the processed DSM data, and the slope angle θ is linearly mapped to the [0, 255] grayscale range to generate a slope grayscale map with the same resolution as the DSM. Step 2: Dynamic receptive field adjustment mechanism. The expansion rate is dynamically adjusted according to the slope grayscale map to achieve dynamic receptive field adjustment and solve the problem of drastic changes in the scale of mountain buildings. Step 3: Dual-branch feature encoding. Feature extraction is performed on the optical image branch and the DSM branch to generate optical image feature maps and topographically enhanced DSM feature maps, enhancing the model's ability to jointly model topographic geometry and building spectral features. Step 4: Topographic constraint pyramid pooling captures multi-scale contextual information. Step 5: Cross-modal attention fusion. Non-local attention is used to calculate the similarity matrix between optical image features and the Digital Surface Model (DSM), and then feature weighting is performed to generate a cross-modal fusion feature map. This addresses the difference in feature modes between optical imagery and DSM, and strengthens the guiding role of terrain in building semantics. Step 6: Lightweight edge optimization. Based on the cross-modal fusion feature map, edge features are extracted, and then the cross-modal fusion features are dynamically weighted through a gating mechanism. After edge fusion, an edge-enhanced segmentation feature map is generated, thereby improving the accuracy of building boundary positioning and solving the problem of edge blurring. Step 7: Multi-task loss function optimization. The model parameters are optimized by calculating the main loss and edge loss, balancing the optimization objectives of building classification and edge positioning, and improving the robustness of the model under complex terrain. Step 8: Post-processing. The pixel-level segmentation results are converted into standardized vector data to meet the application requirements of geographic information systems.

2. The intelligent extraction method for building information in mountainous cities based on terrain-adaptive PSPNet according to claim 1, characterized in that: The terrain slope angle mentioned in step one is calculated using ArcGIS's Surface Parameters tool. The calculation formula is as follows: In the formula, θ is the terrain slope angle, Δh is the elevation difference between adjacent pixels, and x is the pixel spacing (0.5m); the method for generating the slope map is as follows: the slope angle θ [0°, 45°] is linearly mapped to the grayscale range [0, 255] to generate a slope grayscale map with the same resolution as the Digital Surface Model (DSM) and then normalized. The normalization formula is: In the formula, I slope Represents the grayscale of the slope, θ min θ mini This represents the minimum / maximum slope in the dataset.

3. The intelligent extraction method for building information in mountainous cities based on terrain-adaptive PSPNet according to claim 1, characterized in that: The dynamic receptive field adjustment mechanism described in step two is implemented as follows: input a grayscale image of the slope and a pre-trained ResNet50 model (encoder base network); dynamic adjustment calculation of the dilation rate: calculate the dilation rate of the dilated convolution based on the slope angle, with the formula: d=α·tan(θ) where d represents the dilation rate; α is an empirical coefficient; θ represents the terrain slope angle; Dilated convolution kernel initialization: In the encoder stage of PSPNet, the 3×3 convolutions of the Conv3, Conv4, and Conv5 layers of ResNet50 are replaced with dynamically dilated convolutions, with the initial dilation rate set to d0 = 1 and dynamically adjusted with θ; the output is a ResNet50 encoder initialized with dynamically dilated convolution.

4. The intelligent extraction method for building information in mountainous cities based on terrain-adaptive PSPNet according to claim 1, characterized in that: The implementation of the dual-branch feature encoding described in step three is as follows: Input optical image data, digital surface model (DSM) data, and a ResNet50 encoder initialized with dynamic dilated convolution; Optical image branch: Extracting 5-level feature maps using a ResNet50 encoder initialized with dynamic dilated convolution. (C1-C5), the number of channels doubles progressively, namely [64, 256, 512, 1024, 2048]; Digital Surface Model (DSM) branch: Design a DenseNet-121 variant (4 dense blocks, growth rate k = 32), insert a terrain slope encoding layer (1×1 convolution) after each dense block, embed θ into the feature channels, and enhance terrain geometric constraints: In the formula, Represents the first layer DSM features, Conv 1×1 Indicates channel splicing, I slope Indicates the grayscale value of the slope; Feature alignment: Affine transformation is performed on the bi-branch feature maps using a spatial transformation network to eliminate resolution differences between modalities. In the formula, T represents the simulation transformation matrix; s x s y Indicates the scaling factor; t x t y Indicates the amount of translation; Output: Optical image feature map (C1-C5); Topographically Enhanced Digital Surface Model (DSM) Feature Map F dsm (Same resolution as C5) 5. The intelligent extraction method for building information in mountainous cities based on terrain-adaptive PSPNet according to claim 1, characterized in that: The terrain-constrained pyramid pooling implementation method described in step four is as follows: Multi-scale pooling: Slope map channels are stitched before the pyramid pooling module to generate terrain-enhanced feature maps. Dynamic pooling operation: for F terrain Perform 4 levels of adaptive pooling, and after each pooling level, reduce the dimensionality to 512 channels using 1×1 convolution: Terrain condition fusion: Upsample the pooled feature map to the input size and compare it with the original F... terrain By stitching together channels, global features for terrain awareness are generated: F is obtained through 1×1 convolution. global The number of channels has been reduced to 1024; Output: Global feature map F for terrain awareness global (1 / 16 input resolution, 1024 channels).

6. The intelligent extraction method for building information in mountainous cities based on terrain-adaptive PSPNet according to claim 1, characterized in that: The cross-modal attention fusion implementation method described in step five is as follows: Input: Optical image feature map F opt and Digital Surface Model (DSM) Feature Map F dsm Attention mechanism: Non-local attention is used to compute optical image features F. opt With the digital surface model (DSM) feature F dsm Similarity matrix S i,j The formula is: In the formula, i represents the optical image feature map F. opt The spatial location index; j represents the spatial location index of the Digital Surface Model (DSM) feature map; k represents the channel dimension index (i.e., the channel number of the feature map); C(x) represents the normalization coefficient, denoted as C(x) = N. k (Number of channels); Feature weighting: Attention weight map A is generated using Softmax. i,j , For F dsm We perform a weighted summation to obtain F. att ; In the formula, N represents the vector dimension; fusion feature generation: F att optical image feature map (C1-C5) Add element by element: Output: Cross-modal fused feature map F fused .

7. The intelligent extraction method for building information in mountainous cities based on terrain-adaptive PSPNet according to claim 1, characterized in that: The lightweight edge optimization method described in step six is ​​as follows: Input cross-modal fusion feature map F fused ; Edge feature extraction: A Gated-SCNN branch is introduced at the end of the ResNet50 encoder, using a 3×3 depthwise separable convolution (DWConv). 3×3 Extracting edge features F edge :F edge =DWConv 3×3 (ReLU(BN(DWConv 3×3 (F fused Gating mechanism: An edge-gated signal G is generated using the Sigmoid function σ, and the fused feature F is then... fused Dynamic weighting is applied, and the formula is: G = σ(Conv) 1×1 (ReLU(BN(Conv 1×1 (F fused Edge blending: F edge With F fused Element-wise multiplication generates edge-enhanced segmentation features F. seg F seg =F fused ⊙G+F edge Output edge-enhanced segmentation feature map F seg .

8. The intelligent extraction method for building information in mountainous cities based on terrain-adaptive PSPNet according to claim 1, characterized in that: The multi-task loss function optimization implementation method described in step seven is as follows: Input: predicted segmentation map P; ground truth label G (building / non-building binary classification mask); predicted edge map E (generated from P by the Sobel operator); ground truth edge map G edge (Generated from G using the Canny operator); Calculation process: Main loss: Weighted cross-entropy loss L is used. ce Give higher weight to building categories: In the formula, the weight ω for the building category is... i =2.0; Non-building category weight ω i =1.0; Edge loss: Introduce edge loss L edge Strengthen boundary constraints, the formula is: The formula for calculating the total loss is: L total =L ce +λL edge In the formula, N represents the total number of pixels; i represents the pixel index (traversing all pixels or only edge pixels); p i This represents the probability predicted by the model that the i-th pixel belongs to the building edge; g i λ represents the true edge label of the i-th pixel; λ represents the weight hyperparameter of the edge loss; output the optimized model parameters.

9. The intelligent extraction method for building information in mountainous cities based on terrain-adaptive PSPNet according to claim 1, characterized in that: The specific post-processing flow described in step eight is as follows: Input the predicted segmentation map P; CRF optimization: refine the segmentation results using a fully connected conditional random field and set the spatial kernel parameter σ. α =3, Color kernel parameter σ β =10; Contour vectorization: Extract building contours using OpenCV's findContours function; Simplify contours using the Douglas-Peucker algorithm, setting a tolerance threshold of 0.5 pixels; Generate GeoJSON format vector data, including building contours, area, and terrain slope attributes; Output vectorized building contours (GeoJSON format).