A method and system for rapid extraction of houses along railway lines

By optimizing the extraction of houses along railway lines using the PyramidMamba network and the Mamba state-space model, the problems of confusion and low efficiency in the extraction of houses along railway lines are solved. This achieves high-precision and automated extraction and vectorization of houses along railway lines, meeting the mapping requirements of railway engineering topographic maps.

CN123071833APending Publication Date: 2026-11-10CHINA RAILWAY FIRST SURVEY & DESIGN INST GRP +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611336427.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing technologies are prone to confusion with railway ancillary facilities when extracting houses along railway lines, resulting in low accuracy and low mapping efficiency. Furthermore, traditional methods rely on manual experience, leading to inefficiency and high costs.

Method used

The PyramidMamba semantic segmentation network is combined with the Mamba state space model. Multi-scale contextual features are generated through pyramid pooling. The model is optimized using a joint loss function and automatically vectorized and geometrically regularized to output building vector data that conforms to railway engineering drawing standards.

Benefits of technology

It significantly improves the accuracy and efficiency of extracting houses along railway lines, reduces the false detection rate and the missed detection rate, and outputs a regular and smooth vector profile with fewer nodes, which conforms to engineering drawing specifications and reduces the workload of manual boundary measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123071833A_ABST
    Figure CN123071833A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for rapid extraction of houses along railway lines, belonging to the field of intelligent interpretation of remote sensing images and automatic topographic mapping technology. The method includes: acquiring orthophoto data of the railway line to be processed; inputting the orthophoto data into a pre-trained semantic segmentation model to obtain a house prediction probability map; the semantic segmentation model is a PyramidMamba semantic segmentation network, which generates multi-scale contextual features through pyramid pooling and models long-distance dependencies between pixels using the Mamba state space model, with the house segmentation result as the output; during the training phase, the semantic segmentation model is optimized using a joint loss function based on a pre-built sample library of houses along the railway line; the house prediction probability map is automatically vectorized and geometrically regularized, outputting house vector data that conforms to railway engineering mapping standards. This method enables rapid extraction and vectorization of house elements along railway lines, improving the efficiency of feature acquisition and mapping, and reducing manual editing workload.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent interpretation of remote sensing images and automatic topographic mapping technology, specifically relating to a method and system for rapid extraction of houses along railway lines. Background Technology

[0002] In recent years, with the continuous improvement of my country's high-speed railway network, the demand for high-precision and up-to-date topographic maps along railway lines has surged due to railway operation, maintenance, and expansion projects. As one of the most significant geographical features along railway lines, the distribution of buildings directly impacts railway clearance analysis, demolition assessments, and noise control. Traditional railway topographic map production methods primarily rely on manual stereoscopic data acquisition on digital photogrammetry workstations or manual drawing based on orthophotos. This approach is labor-intensive and time-consuming, making it difficult to meet the demands of rapid updates to massive amounts of geographic information for railway digitalization.

[0003] With breakthroughs in deep learning technology in remote sensing image processing, automatic extraction of ground features using semantic segmentation models has become a research hotspot. However, railway engineering scenarios exhibit a wide-span, strip-shaped distribution, with complex terrain along the lines. Residential / factory buildings are often mixed with bare land, making them prone to false positives and false negatives under conditions of significant light and shadow, dense vegetation, and complex roof structures. This poses a significant challenge to the accuracy and generalization ability of automatic extraction algorithms.

[0004] Currently, the mainstream technology in industry and academia utilizes advanced semantic segmentation models such as DeepLabV3+ or HRNet to process remote sensing images. Compared to the traditional U-Net, these methods significantly expand the effective receptive field of the neural network and enhance its ability to capture multi-scale ground objects by introducing the Hollow Spatial Pyramid Pooling (ASPP) module or maintaining a parallel branch structure that preserves high-resolution feature maps. Some existing patents and technical solutions use such models to extract city-level buildings, supplemented by morphological post-processing methods, attempting to solve the problems of misclassification and omission of buildings, and to segment the approximate outlines of buildings relatively well. Alternatively, semi-automatic extraction based on remote sensing image analysis can be used. Combining image spectral, texture, and shape features, multi-scale segmentation and rule set classification are employed, and image objects are classified into buildings and non-buildings by setting thresholds. These methods primarily rely on manually designed feature rules, heavily depending on expert experience and prior knowledge. Feature design and threshold selection often have limitations. In densely built-up areas or urban-rural fringe locations, buildings, roads, vegetation, and other features often exhibit mixed spectral and textural characteristics. Object classification based on simple rules is prone to unclear boundaries or incorrect object merging. This also applies to traditional manual stereoscopic mapping and vectorization. The current mainstream production method in railway surveying and design institutes still relies on operators manually collecting building corner points and outlines in a stereoscopic environment. While this method offers high accuracy, it is essentially a production method highly dependent on personal experience and repetitive labor, leading to low efficiency, high costs, and difficulties in standardizing results due to differences in human judgment.

[0005] However, existing segmentation models are limited by the local receptive field of convolutional kernels, making it difficult to capture long-range contextual dependencies. Along railway lines, buildings often exhibit irregular features due to shooting angles or occlusions, and are easily confused with railway ancillary facilities, leading to a large number of missed and false detections in the extraction results. Furthermore, the building boundaries output by existing segmentation models typically appear jagged or have excessively smooth rounded corners, lacking the geometric regularity expected of buildings. This results in redundant and distorted vector polygon nodes during subsequent automatic vectorization, requiring significant manual adjustments and failing to truly achieve "automatic vectorization" to improve mapping efficiency. Simultaneously, railways traverse vast regions with significant differences in architectural styles along the route. Models based on single features or shallow networks struggle to adapt to this substantial intra-class variation, leading to significant discrepancies in mapping accuracy across different railway sections.

[0006] In summary, existing segmentation and extraction models suffer from problems such as easy confusion with railway ancillary facilities, low accuracy, and low mapping efficiency. Summary of the Invention

[0007] To address the problems of existing segmentation and extraction models being easily confused with railway ancillary facilities, having low accuracy, and low mapping efficiency.

[0008] In a first aspect, the present invention proposes a method for rapid extraction of houses along railway lines, comprising:

[0009] Acquire orthophoto data of the railway line to be processed;

[0010] The orthophoto data is input into a pre-trained semantic segmentation model to obtain a house prediction probability map. The semantic segmentation model is a PyramidMamba semantic segmentation network, which generates multi-scale contextual features through pyramid pooling, combines the Mamba state space model to model long-distance dependencies between pixels, and uses the house segmentation result as the output. During the training phase, the semantic segmentation model is optimized using a joint loss function based on a pre-built sample database of houses along the railway line.

[0011] The predicted probability map of the houses is automatically vectorized and geometrically regularized to output house vector data that conforms to railway engineering drawing standards.

[0012] Preferably, acquiring the orthophoto data along the railway line to be processed includes:

[0013] Using drone aerial photography to obtain original images of both sides of the strip-shaped area along the railway line;

[0014] The original image is processed through orientation modeling, image correction, light and color homogenization, and mosaicking and cropping to generate a digital orthophoto with a ground resolution that meets preset conditions.

[0015] Preferably, the backbone of the PyramidMamba semantic segmentation network adopts a 4-level pyramid structure of the Swin Transformer, with each level implementing downsampling and channel expansion through a patch merging layer; the decoder adopts a high-low level feature fusion structure, which adds the upsampled high-level features to the preprocessed low-level features and then inputs the sum to the segmentation head to output the segmentation result.

[0016] Preferably, the step of generating multi-scale contextual features through pyramid pooling and modeling long-distance dependencies between pixels using the Mamba state space model includes:

[0017] The input features are used to generate multi-scale contextual features through adaptive average pooling at different scales;

[0018] After reducing the channel dimension of the multi-scale context features by using 1×1 convolution, they are concatenated with the original input features;

[0019] The concatenated features are input into the Mamba state space model for long-distance dependency modeling, and the processed features with the original spatial dimensions are output.

[0020] Preferably, the expression for the joint loss function is:

[0021]

[0022] Wherein, MainLoss is the main loss function, CE is the cross-entropy loss, Dice is the Dice loss, EdgeLoss is the edge loss, and EdgeFactor is the preset edge weight factor.

[0023] Preferably, the construction process of the railway line housing sample database includes:

[0024] The cropped railway line image is labeled along the outer contour of the houses to generate closed polygons, and corresponding binary mask labels are generated, in which the pixel value of the house area is marked as 1 and the pixel value of the background area is marked as 0.

[0025] Data augmentation processing is performed on the samples by random rotation, flipping, and color jittering;

[0026] The sample library is divided into training set, validation set and test set in a ratio of 8:1:1.

[0027] Preferably, the automatic vectorization and geometric regularization processing of the house prediction probability map includes:

[0028] The predicted probability map of the house is vectorized using a contour tracing algorithm to generate an initial vector polygon;

[0029] Redundant nodes in the initial vector polygon are simplified, and a geometric regularization algorithm is used to reshape it, correcting irregular quadrilaterals or polygons into regular polygons with the geometric characteristics of houses, thus obtaining house vector data with regular outlines.

[0030] Preferably, the step of vectorizing the house prediction probability map using a contour tracing algorithm to generate an initial vector polygon includes:

[0031] An adaptive thresholding method is used to convert the predicted probability map of the houses into a binary mask. An edge-tracking-based raster vectorization algorithm is then applied to extract the outer contour of the houses from the binary mask and generate an initial vector polygon.

[0032] Preferably, before performing automatic vectorization and geometric regularization processing on the house segmentation results, the method further includes:

[0033] The house prediction probability map output by the PyramidMamba network is denoised. The denoising process includes adaptive threshold segmentation, hole filling, and morphological filtering.

[0034] Secondly, this invention proposes a rapid extraction system for houses along railway lines, comprising:

[0035] The image acquisition module is used to acquire orthophoto data of the railway line to be processed;

[0036] The segmentation processing module is used to input the orthophoto data into a pre-trained semantic segmentation model to obtain a house prediction probability map.

[0037] The model building and optimization module is used to generate multi-scale contextual features through pyramid pooling using the PyramidMamba semantic segmentation network, and to model long-distance dependencies between pixels using the Mamba state space model, with the house segmentation results as the output; and during the training phase, the semantic segmentation model is optimized using a joint loss function based on a pre-built sample database of houses along railway lines.

[0038] The vectorization output module is used to automatically vectorize and geometrically regularize the predicted probability map of the houses, and output house vector data that conforms to railway engineering drawing standards.

[0039] In another aspect, the present invention also provides a computing device, comprising: one or more processors;

[0040] A processor is used to execute one or more programs;

[0041] When the one or more programs are executed by the one or more processors, a method for rapid extraction of houses along a railway line as described above is implemented.

[0042] In another aspect, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the method for rapid extraction of houses along a railway line as described above.

[0043] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0044] This invention provides a method and system for rapid extraction of buildings along railway lines. Utilizing the high-precision automatic extraction capabilities of PyramidMamba, it transforms the previously entirely manual process of building vectorization into an "automatic extraction + manual verification" model, significantly improving the efficiency of topographic mapping and shortening the railway survey and design cycle. Thanks to the MambaLayer module's ability to capture long-distance dependencies and multi-scale contextual information, this invention effectively identifies buildings along railway lines that are shaded or have complex textures, significantly reducing false positives and false negatives. It is particularly effective at recognizing small, ancillary buildings unique to railways, significantly improving extraction accuracy in complex scenarios. By introducing a joint loss function and rule-based vectorization post-processing, the extracted building vector contours are regular and smooth with fewer nodes and obvious straight-line features. The output results better conform to engineering drawing standards, meeting the requirements for railway engineering topographic maps, reducing the workload of subsequent manual boundary adjustments, and significantly saving labor costs. This invention primarily serves railway topographic mapping, aiming to achieve rapid and accurate extraction and vectorization of building elements along railway lines using high-resolution UAV imagery, improving the efficiency of feature acquisition and mapping, and reducing manual editing workload. Attached Figure Description

[0045] Figure 1 This is a flowchart of the rapid extraction and vectorization process of houses along railway lines based on PyramidMamba in Embodiment 1 of the present invention.

[0046] Figure 2 This is a schematic diagram of the PyramidMamba network architecture in Embodiment 1 of the present invention;

[0047] Figure 3 This is a schematic diagram of the electronic device structure in Embodiment 3 of the present invention. Detailed Implementation

[0048] Example 1:

[0049] This invention provides a method for rapid extraction of houses along railway lines, such as... Figure 1 As shown, it includes:

[0050] Step S1: Obtain orthophoto data of the railway line to be processed;

[0051] Step S2: Input the orthophoto data into a pre-trained semantic segmentation model to obtain a house prediction probability map; the semantic segmentation model is a PyramidMamba semantic segmentation network, which generates multi-scale contextual features through pyramid pooling, combines the Mamba state space model to model long-distance dependencies between pixels, and uses the house segmentation result as the output; and during the training phase, the semantic segmentation model is optimized using a joint loss function based on a pre-built sample library of houses along the railway line.

[0052] Step S3: The predicted probability map of the houses is automatically vectorized and geometrically regularized to output house vector data that conforms to railway engineering drawing standards.

[0053] This invention provides a rapid method for extracting buildings along railway lines. Utilizing the high-precision automatic extraction capabilities of PyramidMamba, it transforms the previously entirely manual process of building vectorization into an "automatic extraction + manual verification" model, significantly improving the efficiency of topographic mapping and shortening the railway survey and design cycle. Thanks to the MambaLayer module's ability to capture long-distance dependencies and multi-scale contextual information, this invention effectively identifies buildings along railway lines that are shaded or have complex textures, significantly reducing false positives and false negatives. It is particularly effective at recognizing small, ancillary buildings unique to railways, significantly improving extraction accuracy in complex scenarios. By introducing a joint loss function and rule-based vectorization post-processing, the extracted building vector contours are regular and smooth with fewer nodes and obvious straight-line features. The output results better conform to engineering drawing standards, meeting the requirements for railway engineering topographic maps, reducing the workload of subsequent manual boundary adjustments, and significantly saving labor costs. This invention primarily serves railway topographic mapping, aiming to achieve rapid and accurate extraction and vectorization of building elements along railway lines using high-resolution UAV imagery, improving the efficiency of feature acquisition and mapping, and reducing manual editing workload.

[0054] Specifically, in this embodiment of the invention, step S1, acquiring the orthophoto data along the railway line to be processed, includes:

[0055] Using drone aerial photography to obtain original images of both sides of the strip-shaped area along the railway line;

[0056] The original image is processed through orientation modeling, image correction, light and color homogenization, and mosaicking and cropping to generate a digital orthophoto with a ground resolution that meets preset conditions.

[0057] Further explanation is needed regarding the acquisition and preprocessing of high-resolution image data along the railway line in step S1. This involves using UAV aerial photography to acquire raw images within a 500-meter radius on both sides of the railway centerline, followed by image post-processing to ultimately obtain digital orthophotos (DOMs) with a ground resolution better than 5cm.

[0058] Specifically, in this embodiment of the invention, the backbone of the PyramidMamba semantic segmentation network in step S2 adopts a 4-level pyramid structure of the Swin Transformer. Each level achieves downsampling and channel expansion through patch merging layers. The decoder adopts a multi-level feature fusion structure, which adds the upsampled high-level features to the preprocessed low-level features and then inputs the result into the segmentation head.

[0059] Specifically, in this embodiment of the invention, step S2, which involves generating multi-scale contextual features through pyramid pooling and modeling long-distance dependencies between pixels using the Mamba state space model, includes:

[0060] The input features are used to generate multi-scale contextual features through adaptive average pooling at different scales;

[0061] After reducing the channel dimension of the multi-scale context features by using 1×1 convolution, they are concatenated with the original input features;

[0062] The concatenated features are input into the Mamba state space model for long-distance dependency modeling, and the processed features with the original spatial dimensions are output.

[0063] Further explanation is needed: this invention constructs a house extraction model based on the PyramidMamba semantic segmentation network. It combines pyramid pooling with the Mamba state-space model, generating multi-scale context for the complex railway background through adaptive average pooling at different scales. 1*1 convolutions are applied to reduce channel dimensionality. The pooled features are concatenated with the original input, and the Mamba state-space model is used to process the concatenated features, ultimately returning transformed features with the original spatial dimensions. This effectively distinguishes houses from similar backgrounds while ensuring the precision of the house outlines. The PyramidMamba network is iteratively trained and its parameters are tuned using a pre-built sample library. A joint loss function, including cross-entropy loss, Dice loss, and edge loss, is designed to enable the PyramidMamba network to focus on extracting clear and accurate house outlines from the complex railway background.

[0064] This invention innovatively introduces the PyramidMamba architecture to solve the perception problem in railway strip scenes. Addressing the characteristics of large-span distribution of features and complex backgrounds along railway lines, it abandons traditional semantic segmentation architectures and adopts a PyramidMamba network model that combines the Mamba state-space model with a pyramid pooling structure. By utilizing Mamba layers to establish long-distance relationships between pixels in the feature space, it solves the problems of missed building detection and incomplete detection caused by the limited receptive field in traditional models within railway strip areas.

[0065] It should be further noted that the PyramidMamba architecture in the embodiments of the present invention can be replaced by other semantic segmentation models, such as UNetFormer or DCSwin, by providing different attention mechanisms and backbone networks to adapt to different aerial and satellite remote sensing image datasets.

[0066] It should be further explained that the data source in the embodiments of the present invention can be expanded to include: LiDAR assistance: in addition to optical images, airborne LiDAR point cloud data can be fused. Using the digital elevation model generated by the 3D laser point cloud as an additional input channel can solve the problem of misjudgment caused by the similarity between ground texture and roof color, and improve the differentiation between high-rise buildings and low-rise sheds.

[0067] Oblique photogrammetry model: It can extract the true radiometric image (TDOM) generated by oblique photogrammetry real scene 3D model, eliminating the interference of dense vegetation projection occlusion and light and shadow on the extraction of building features.

[0068] Specifically, the construction process of the railway-line housing sample database in this embodiment of the invention includes:

[0069] The cropped railway line image is labeled along the outer contour of the houses to generate closed polygons, and corresponding binary mask labels are generated, in which the pixel value of the house area is marked as 1 and the pixel value of the background area is marked as 0.

[0070] Data augmentation processing is performed on the samples by random rotation, flipping, and color jittering;

[0071] The sample library is divided into training set, validation set and test set in a ratio of 8:1:1.

[0072] Further explanation is needed regarding the construction of a semantic segmentation sample library for houses along railway lines. Specifically, this involves selecting representative sections along the railway line (covering different landforms such as cities, villages, and mountains), combining historical vector map data with manual visual interpretation to accurately mark the outer contours of houses, creating high-precision binary mask labels for houses, and constructing a dedicated sample library.

[0073] Specifically, step S3 of this embodiment of the invention, which involves automatically vectorizing and geometrically regularizing the house prediction probability map, includes:

[0074] The predicted probability map of the house is vectorized using a contour tracing algorithm to generate an initial vector polygon;

[0075] Redundant nodes in the initial vector polygon are simplified, and a geometric regularization algorithm is used to reshape it, correcting irregular quadrilaterals or polygons into regular polygons with the geometric characteristics of houses, thus obtaining house vector data with regular outlines.

[0076] Specifically, in this embodiment of the invention, the vectorization of the house prediction probability map using a contour tracing algorithm to generate an initial vector polygon includes:

[0077] An adaptive thresholding method is used to convert the predicted probability map of the houses into a binary mask. An edge-tracking-based raster vectorization algorithm is then applied to extract the outer contour of the houses from the binary mask and generate an initial vector polygon.

[0078] Specifically, before performing automatic vectorization and geometric regularization processing on the house segmentation results in this embodiment of the invention, the method further includes:

[0079] The house prediction probability map output by the PyramidMamba network is denoised. The denoising process includes adaptive threshold segmentation, hole filling, and morphological filtering.

[0080] Further explanation is needed regarding the post-processing and automatic vectorization of the extracted results in this embodiment of the invention. A trained model is used to infer the newly acquired railway imagery, outputting a probability map of predicted buildings. Noise is removed through threshold segmentation, hole filling, and morphological filtering. Subsequently, a contour tracking algorithm is applied to convert the raster mask into vector polygons, and rectangularization and regularization algorithms are introduced to shape the vector boundaries, outputting vector data in a format conforming to railway topographic map mapping standards.

[0081] It should be further explained that in the post-processing algorithm of this embodiment, the vector regularization algorithm can be replaced by a polygon fitting algorithm based on the least squares method or a contour optimization algorithm based on graph theory to adapt to the house extraction requirements of irregularly shaped buildings (such as irregular structures).

[0082] This invention presents a boundary constraint mechanism for vectorization applications. Unlike conventional semantic segmentation, which only pursues pixel accuracy, this invention introduces a dedicated boundary loss function during model training and integrates a geometric feature-based regularization algorithm in the post-processing stage. This ensures that the model output is not merely a binary image, but a vector result with high geometric regularity, breaking through the key bottleneck from "image segmentation" to "map creation".

[0083] This invention establishes a sample database of houses along railway lines and an automated mapping process. Targeting the characteristics of railway engineering, a sample database of houses along railway lines containing data from different time periods and regions has been established, and an end-to-end automated workflow has been formed, from digital orthophoto input to building boundary vector map output, thus addressing the technical shortcomings in the industry for automated mapping of houses in linear railway engineering projects.

[0084] It should be further explained that, in the specific implementation process, the method for rapid extraction of houses along railway lines based on the PyramidMamba architecture of the present invention includes the following steps:

[0085] Step S1: UAV Image Acquisition and Preprocessing. Using a multi-rotor UAV equipped with a full-frame camera, aerial photography is conducted within a 500m range on both sides of the railway line, with a forward overlap rate of no less than 70% and a lateral overlap rate of no less than 30%. After obtaining the original images, they undergo directional modeling, image correction, light and color equalization, mosaicking and cropping, etc., to finally generate a digital orthophoto image (DOM) with a ground resolution better than 5cm. The DOM image is then slidably cropped into 1024*1024 pixel windows and subjected to data enhancement operations such as random rotation, flipping, and color dithering to prevent model overfitting.

[0086] Step S2: Construction of a sample database of buildings along the railway line. First, images covering different terrains along the railway line, including urban areas, rural areas, and mountainous regions, are selected. Based on self-developed sample annotation software, the pre-cropped images of the railway line areas are meticulously manually annotated. During the annotation process, annotators must accurately delineate all types of buildings (including but not limited to residential buildings, various factories, warehouses, and railway station buildings) along their outer contours to form closed polygonal regions. The annotation software automatically generates corresponding binary mask label files, where pixel values ​​corresponding to building areas are marked as 1, and pixel values ​​of non-building background areas are marked as 0. The dataset is divided into training, validation, and test sets in an 8:1:1 ratio.

[0087] Step S3, PyramidMamba network model construction. (e.g.) Figure 2 As shown, it includes:

[0088] (1) Backbone network: The Swin Transformer architecture is adopted, which adopts a 4-stage pyramid structure similar to CNN. Each stage achieves downsampling and channel expansion through patch merging layer, and combines the shift window strategy to achieve cross-window information interaction to form multi-scale feature representation.

[0089] (2) Mamba layer: Combine pyramid pooling with Mamba state space model, generate multi-scale context by adaptive average pooling of different scales from the original features, apply 1×1 convolution to reduce channel dimension, concatenate pooled features with original input, then use Mamba state space model to process concatenated features, and finally return transformed features with original space dimension.

[0090] (3) Block structure: The Mamba layer is combined with ConvFFN (convolutional feedforward network, i.e., a 3×3 convolutional fully connected network using the GELU activation function) to form a complete processing unit and output the final features.

[0091] (4) Decoder: On the one hand, it processes the high-level features from the backbone network and upsamples them to improve the spatial resolution. On the other hand, it uses the preprocessing convolution module with adaptive channels to process the low-level features. Then, the processed high-level features and low-level features are added together, and finally the segmentation mask is output through the segmentation head.

[0092] Step S4, Model Training and Optimization Strategy. The PyTorch deep learning framework was used for training on an NVIDIA RTX 4090 GPU. The optimizer was AdamW, with a base learning rate of 6e-4, weight decay of 0.01, a batch size of 8, and training for 300 epochs. The weights with the highest IoU on the validation set were selected and saved. A joint loss function was designed, incorporating cross-entropy loss, Dice loss, and edge loss.

[0093] ,

[0094] The PyramidMamba network is designed to extract clear and accurate building outlines from the complex background of railways. MainLoss is the principal loss function, combining the advantages of SoftCrossEntropyLoss and DiceLoss. CE (Cross-Entropy Loss) improves overall segmentation consistency and model generalization ability. Dice loss addresses imbalanced samples (especially for special buildings around railways, such as station buildings, signal towers, and trackside equipment rooms). EdgeLoss constrains the edge fit of the prediction results, forcing the model to focus on the geometric outlines of the buildings. EdgeFactor is the edge factor.

[0095] Step S5: Post-processing and automatic vectorization of extracted results. The model trained in S4 is used to infer the newly acquired UAV imagery along the railway line, outputting a probability distribution map of predicted houses. An adaptive thresholding method is used to convert the probability map into a binary mask. An edge-tracking-based raster vectorization algorithm is applied to extract the outer contours of the houses from the binary mask, generating initial vector polygons. Then, morphological post-processing is performed on the initial contours. While maintaining the basic shape of the contours, redundant nodes are significantly reduced, jagged features are eliminated, and overly complex edges are smoothed to obtain simplified vector polygons. Considering that houses along the railway line are mostly regular rectangular or right-angled structures, a specialized geometric regularization algorithm is designed to reshape the simplified vector polygons, correcting irregular quadrilaterals or polygons into regular polygons with the geometric characteristics of houses. Finally, the output is a Shapefile (.shp) format file, following spatial data standard formats and railway engineering drawing standards.

[0096] This invention provides a PyramidMamba network architecture that integrates pyramid pooling mechanism and Mamba State Space Model (SSM). It captures long-range dependencies and multi-scale contextual information to address the limitations of traditional semantic segmentation in complex, linear railway scenes, such as limited receptive fields and difficulty in distinguishing features with significant scale differences, thereby improving the semantic consistency of building extraction.

[0097] This invention proposes a boundary optimization and regularization strategy for vectorization applications. By improving the joint loss function and geometric regularization algorithm, the edge quality of the segmentation results is improved, jagged edges and adhesion are reduced, and the output binary image can be directly converted into vector polygons with regular contours and simplified nodes that meet cartographic specifications through an automatic vectorization algorithm, significantly reducing the amount of manual editing work.

[0098] This invention establishes a complete automated production process for topographic maps and feature elements along railway lines. From image input to vector data output, the entire process is automated, significantly improving the efficiency of topographic map production during the railway survey and design phase.

[0099] Example 2:

[0100] Based on the same inventive concept, the present invention also provides a rapid retrieval system for houses along railway lines, comprising:

[0101] The image acquisition module is used to acquire orthophoto data of the railway line to be processed;

[0102] The segmentation processing module is used to input the orthophoto data into a pre-trained semantic segmentation model to obtain a house prediction probability map.

[0103] The model building and optimization module is used to generate multi-scale contextual features through pyramid pooling using the PyramidMamba semantic segmentation network, and to model long-distance dependencies between pixels using the Mamba state space model, with the house segmentation results as the output; and during the training phase, the semantic segmentation model is optimized using a joint loss function based on a pre-built sample database of houses along railway lines.

[0104] The vectorization output module is used to automatically vectorize and geometrically regularize the predicted probability map of the houses, and output house vector data that conforms to railway engineering drawing standards.

[0105] This invention utilizes PyramidMamba's high-precision automatic extraction capabilities to significantly improve the efficiency of topographic map production. It transforms the vectorization of buildings, which originally relied entirely on manual data collection, into an "automatic extraction + manual verification" mode, increasing overall mapping efficiency by more than 50% and significantly shortening the railway survey and design cycle.

[0106] Based on the ability of the MambaLayer module to capture long-distance dependencies and multi-scale contextual information, this invention can effectively identify houses along railway lines that are occluded by shadows or have complex textures, significantly reducing the false detection rate and false negative rate. In particular, it has a better recognition effect on small auxiliary buildings and facilities unique to railways, and significantly improves the extraction accuracy in complex scenes.

[0107] This invention, by introducing a joint loss function and rule-based vectorization post-processing, extracts a smooth and regular building vector outline with fewer nodes and obvious straight-line features. The output results are more in line with engineering drawing specifications and meet the mapping requirements of railway engineering topographic maps. This reduces the workload of manual boundary re-surveying in the later stage and greatly saves labor costs.

[0108] Example 3:

[0109] Based on the same inventive concept, such as Figure 3 As shown, the present invention also provides an electronic device, which may be a computer device, a microcontroller device, a smart mobile device, etc. The electronic device in this embodiment may include a processor, a memory, a transceiver component, etc. The memory, processor, and transceiver component are connected via a bus; the memory can be used to store executable programs, and an exemplary executable program may include instructions; the processor is used to execute the instructions stored in the memory. The memory can also be used to store data, which can be accessed and / or modified when instructions are executed.

[0110] The processor may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, and it is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions in the storage medium to realize the corresponding method flow or corresponding function, so as to realize the steps of the method for rapid extraction of houses along railway lines in the above embodiments.

[0111] Example 4:

[0112] Based on the same inventive concept, this invention also provides a readable storage medium, specifically an electronic device readable storage medium (Memory). This readable storage medium is a memory device within an electronic device used to store programs and data. It is understood that the storage medium here can include both built-in storage media within the electronic device and extended storage media supported by the electronic device. The storage medium provides storage space, which stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more executable programs (including program code). It should be noted that the storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. Loading and executing one or more instructions stored in the storage medium by the processor can implement the steps of the method for quickly extracting houses along a railway line in the above embodiments.

[0113] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0114] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0115] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0116] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0117] The above are merely embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of the claims of the present invention pending approval.

Claims

1. A method for rapid extraction of houses along a railway line, characterized in that, include: Acquire orthophoto data of the railway line to be processed; The orthophoto data is input into a pre-trained semantic segmentation model to obtain a house prediction probability map. The semantic segmentation model is a PyramidMamba semantic segmentation network, which generates multi-scale contextual features through pyramid pooling, combines the Mamba state space model to model long-distance dependencies between pixels, and uses the house segmentation result as the output. During the training phase, the semantic segmentation model is optimized using a joint loss function based on a pre-built sample database of houses along the railway line. The predicted probability map of the houses is automatically vectorized and geometrically regularized to output house vector data that conforms to railway engineering drawing standards.

2. The method for rapid extraction of houses along a railway line according to claim 1, characterized in that, The acquisition of orthophoto data along the railway line to be processed includes: Using drone aerial photography to obtain original images of both sides of the strip-shaped area along the railway line; The original image is processed through orientation modeling, image correction, light and color homogenization, and mosaicking and cropping to generate a digital orthophoto with a ground resolution that meets preset conditions.

3. The method for rapid extraction of houses along a railway line according to claim 1, characterized in that, The backbone of the PyramidMamba semantic segmentation network adopts a 4-level pyramid structure of the Swin Transformer. Each level achieves downsampling and channel expansion through patch merging layers. The decoder adopts a high-low level feature fusion structure, which adds the upsampled high-level features to the preprocessed low-level features and then inputs the sum to the segmentation head to output the segmentation result.

4. The method for rapid extraction of houses along a railway line according to claim 1, characterized in that, The process of generating multi-scale contextual features through pyramid pooling and modeling long-distance dependencies between pixels using the Mamba state-space model includes: The input features are used to generate multi-scale contextual features through adaptive average pooling at different scales; After reducing the channel dimension of the multi-scale context features by using 1×1 convolution, they are concatenated with the original input features; The concatenated features are input into the Mamba state space model for long-distance dependency modeling, and the processed features with the original spatial dimensions are output.

5. The method for rapid extraction of houses along a railway line according to claim 1, characterized in that, The expression for the joint loss function is: Wherein, MainLoss is the main loss function, CE is the cross-entropy loss, Dice is the Dice loss, EdgeLoss is the edge loss, and EdgeFactor is the preset edge weight factor.

6. The method for rapid extraction of houses along a railway line according to claim 1, characterized in that, The process of constructing the sample database of houses along the railway line includes: The cropped railway line image is labeled along the outer contour of the houses to generate closed polygons, and corresponding binary mask labels are generated, in which the pixel value of the house area is marked as 1 and the pixel value of the background area is marked as 0. Data augmentation processing is performed on the samples by random rotation, flipping, and color jittering; The sample library is divided into training set, validation set and test set in a ratio of 8:1:

1.

7. The method for rapid extraction of houses along a railway line according to claim 1, characterized in that, The automatic vectorization and geometric regularization processing of the predicted probability map of the houses includes: The predicted probability map of the house is vectorized using a contour tracing algorithm to generate an initial vector polygon; Redundant nodes in the initial vector polygon are simplified, and a geometric regularization algorithm is used to reshape it, correcting irregular quadrilaterals or polygons into regular polygons with the geometric characteristics of houses, thus obtaining house vector data with regular outlines.

8. The method for rapid extraction of houses along a railway line according to claim 1, characterized in that, The process of vectorizing the predicted probability map of the house using a contour tracing algorithm to generate an initial vector polygon includes: An adaptive thresholding method is used to convert the predicted probability map of the houses into a binary mask. An edge-tracking-based raster vectorization algorithm is then applied to extract the outer contour of the houses from the binary mask and generate an initial vector polygon.

9. A method for rapid extraction of houses along a railway line according to claim 1, characterized in that, Before performing automatic vectorization and geometric regularization on the house segmentation results, the process also includes: The house prediction probability map output by the PyramidMamba network is denoised. The denoising process includes adaptive threshold segmentation, hole filling, and morphological filtering.

10. A rapid retrieval system for houses along a railway line, characterized in that, include: The image acquisition module is used to acquire orthophoto data of the railway line to be processed; The segmentation processing module is used to input the orthophoto data into a pre-trained semantic segmentation model to obtain a house prediction probability map. The model building and optimization module is used to generate multi-scale contextual features through pyramid pooling using the PyramidMamba semantic segmentation network, and to model long-distance dependencies between pixels using the Mamba state space model, with the house segmentation results as the output; and during the training phase, the semantic segmentation model is optimized using a joint loss function based on a pre-built sample database of houses along railway lines. The vectorization output module is used to automatically vectorize and geometrically regularize the predicted probability map of the houses, and output house vector data that conforms to railway engineering drawing standards.