Method for extracting urban building outlines based on spatial data

Automatically extracting contours through deep learning models, the problem of inefficient contour extraction in the prior art is solved, and fast and accurate contour information processing is achieved, which is suitable for various geographic information data.

CN118608800BActive Publication Date: 2024-11-05SHENZHEN EMAP INFORMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411081949.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-11-05
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

Contour extraction is inefficient in the prior art, especially when processing large-scale data, and it is difficult for professionals to complete all operations within a limited time, resulting in inefficiency.

Method used

Using a deep learning model-based method, the contour is automatically extracted through convolutional operations, activation functions, pooling operations and full connection layers, and the extracted results are superimposed and displayed with spatial data to reduce manual operations.

Benefits of technology

It improves the efficiency and accuracy of contour extraction, can quickly process large-scale data, saves manual processing time and cost, and is suitable for geographic information data in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118608800B_ABST
    Figure CN118608800B_ABST
Patent Text Reader

Abstract

The present application discloses a method for extracting urban building outlines based on spatial data, which relates to the field of data processing technology, and includes: obtaining spatial data to be extracted; determining the outline extraction result corresponding to the spatial data according to a trained deep learning model; superimposing the outline extraction result and the spatial data, and displaying the superimposed data, in order to improve the efficiency of outline extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data processing, and in particular to a method for extracting urban building outlines based on spatial data. Background Art

[0002] Contour extraction has a wide range of applications in urban planning, geographic information systems, environmental monitoring and other fields. It can help accurately measure the area, height, shape and other information of buildings, thereby supporting various spatial analysis and decision-making processes.

[0003] In related technologies, Geographic Information System (GIS) is usually used to pre-process the input spatial data, and then professionals perform single-band extraction and image reclassification on the data to obtain the corresponding contours, and finally manually edit it to correct errors or supplement missing parts.

[0004] However, the entire process, from data processing to feedback modification, relies on manual operations by professionals. Especially when processing large-scale data, it is difficult for professionals to complete all operations within a limited time, resulting in inefficient contour extraction.

[0005] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0006] The main purpose of this application is to provide a method for extracting urban building outlines based on spatial data, aiming to solve the technical problem of low efficiency in extracting outlines.

[0007] To achieve the above objectives, the present application proposes a method for extracting urban building outlines based on spatial data, the method comprising:

[0008] Obtain the spatial data to be extracted;

[0009] Determine a contour extraction result corresponding to the spatial data according to the trained deep learning model;

[0010] The contour extraction result and the spatial data are superimposed, and the superimposed data is displayed.

[0011] In one embodiment, the step of determining the contour extraction result corresponding to the spatial data according to the trained deep learning model includes:

[0012] Performing a convolution operation on the spatial data to extract the corresponding convolution layer result;

[0013] Performing a nonlinear transformation on the convolutional layer result according to the activation function to obtain a corresponding activation layer result;

[0014] Performing a pooling operation on the activation layer result according to the sliding window and the compensation to obtain a corresponding pooling layer result;

[0015] Flatten the pooling layer result into a one-dimensional vector, multiply the one-dimensional vector by the weight matrix and add a bias term to obtain a fully connected layer result;

[0016] According to the normalized exponential function, the contour extraction result corresponding to the fully connected layer result is determined.

[0017] In one embodiment, the step of superimposing the contour extraction result and the spatial data and displaying the superimposed data comprises:

[0018] Determine first coordinate data of the contour extraction result and second coordinate data corresponding to the spatial data;

[0019] According to the matching result of the first coordinate data and the second coordinate data, the contour extraction result is superimposed with the spatial data, and the superimposed data is displayed.

[0020] In one embodiment, before the step of obtaining the spatial data to be extracted, the method further includes:

[0021] Obtaining the environment information of the current environment, creating a new environment based on the environment information and activating it;

[0022] In the new environment, installing a deep learning framework according to the framework information;

[0023] Load the trained deep learning model into the deep learning framework.

[0024] In one embodiment, before the step of obtaining the spatial data to be extracted, the method further includes:

[0025] Display the data to be labeled, and obtain training samples drawn by the user based on the data to be labeled, or obtain existing training samples;

[0026] Determine the untrained deep learning model, model parameters, and training framework in the framework information;

[0027] In the training framework, the untrained deep learning model is trained according to the model parameters and the training samples to obtain the trained deep learning model.

[0028] In one embodiment, after the step of training the untrained deep learning model according to the model parameters and the training samples in the training framework to obtain the trained deep learning model, the method further includes:

[0029] Combine the object detection tool, the pixel classification tool and the object classification tool with the trained deep learning model, and output corresponding object detection results, pixel classification results and object classification results;

[0030] If the detected object result, the classified pixel result and the classified object result meet the training termination condition in the model parameters, the trained deep learning model is output.

[0031] In one embodiment, if the detected object result, the classified pixel result, and the classified object result satisfy the training termination condition in the model parameters, the step of outputting the trained deep learning model comprises:

[0032] Calculating a first matching rate between the detected object result and the classified pixel result, and a second matching rate between the detected object result and the classified object result;

[0033] If both the first matching rate and the second matching rate are greater than the preset matching rate, the trained deep learning model is output.

[0034] In one embodiment, after the step of superimposing the contour extraction result and the spatial data and displaying the superimposed data, the method further includes:

[0035] Determining edge features and shape features in the contour extraction result;

[0036] Determine, according to the trained deep learning model, the element classification results corresponding to the edge features and the shape features;

[0037] The classification result of the element is displayed.

[0038] One or more technical solutions proposed in this application have at least the following technical effects:

[0039] This application integrates a trained deep learning model in GIS. Since the deep learning model has strong adaptability for automatic contour extraction, it can be applied in different scenarios, whether it is crops, buildings, vehicles or other types of geographic information data. This adaptability can help users process large quantities of data. Moreover, the deep learning model can quickly and accurately identify and extract contour information during the contour extraction process, thereby saving the time and cost of manual processing and improving the efficiency of data processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] Figure 1 A flow chart of a method for extracting urban building outlines based on spatial data provided in Embodiment 1 of the present application;

[0043] Figure 2 A flow chart of a method for extracting urban building outlines based on spatial data provided in Embodiment 1 of the present application;

[0044] Figure 3 A flow chart of a method for extracting urban building outlines based on spatial data provided in Embodiment 1 of the present application;

[0045] Figure 4 A flow chart of the second embodiment of the method for extracting urban building outlines based on spatial data provided by the present application;

[0046] Figure 5 A flowchart diagram of a third embodiment of the method for extracting urban building outlines based on spatial data provided in this application;

[0047] Figure 6 A flowchart diagram of a third embodiment of the method for extracting urban building outlines based on spatial data provided in this application;

[0048] Figure 7 A flowchart diagram of a third embodiment of the method for extracting urban building outlines based on spatial data provided in this application;

[0049] Figure 8 A flowchart diagram of a fourth embodiment of the method for extracting urban building outlines based on spatial data provided by the present application;

[0050] Fig. 9 A brief flowchart of the method for extracting urban building outlines based on spatial data is provided for this application.

[0051] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0052] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0053] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0054] The main solution of the embodiment of the present application is: obtaining the spatial data to be extracted; determining the contour extraction result corresponding to the spatial data according to the trained deep learning model; superimposing the contour extraction result and the spatial data, and displaying the superimposed data.

[0055] In the prior art, GIS is usually used to extract contours. For example, users can use Arcmap, a user desktop component in GIS, to complete contour extraction. However, the entire process from data processing to feedback modification relies on manual operations by professionals. Especially when processing large-scale data, it is difficult for professionals to complete all operations within a limited time, that is, the efficiency of contour extraction is low.

[0056] To solve the above problems, this application provides a solution that combines GIS and a trained deep learning model to achieve automatic extraction of contours without relying on manual operations. In this way, large-scale data can be processed quickly and the efficiency of contour extraction can be improved.

[0057] It should be noted that the execution subject of this solution can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a contour extraction device capable of realizing the above functions, etc. The following embodiments are described below taking the contour extraction device as an example.

[0058] Based on this, the embodiment of the present application provides a method for extracting urban building outlines based on spatial data, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for extracting urban building outlines based on spatial data in this application.

[0059] In this embodiment, the method for extracting urban building outlines based on spatial data includes steps S10 to S30:

[0060] Step S10, obtaining the spatial data to be extracted;

[0061] It should be noted that the Geographic Information System, or GIS, is a professional software system that integrates spatial data, map information, and geographic analysis functions. It is used to store, manage, analyze, and display geospatial data. Specifically, Arc GisPro can be used. A trained deep learning model refers to a neural network model that has been trained and optimized with a large amount of data. These models can perform specific tasks, such as identifying and extracting building outlines, object classification, etc. Specifically, the models provided by Arc GisPro can be used.

[0062] Optionally, the spatial data may be data directly input by a user through an interface such as a graphical user interface, a command line interface, or a mobile application, or may be data obtained from an application programming interface (API) on the Internet through a hypertext transfer protocol, etc., which is not specifically limited in this embodiment.

[0063] Step S20, determining the contour extraction result corresponding to the spatial data according to the trained deep learning model;

[0064] After the spatial data is input into the trained deep learning model, the spatial data will first be preprocessed, including but not limited to format conversion, data cleaning, data standardization, data encoding, data enhancement, etc.

[0065] Optionally, detect and process missing values, outliers, and duplicate values ​​in the data to ensure the integrity and accuracy of the data quality; standardize the data, such as using Z-score standardization or Min-Max standardization methods, to ensure that data with different features have the same scale and distribution; encode categorical data and convert categorical variables into digital form, using methods such as one-hot encoding or label encoding; perform data enhancement operations on image data, including rotation, flipping, scaling, translation, etc., to increase the diversity of data samples and the generalization ability of the model.

[0066] Deep learning models usually contain multiple layers, each of which has its own specific processing process and function. According to training requirements, you can selectively configure fully connected layers, convolutional layers, pooling layers, regularization layers, activation layers, embedding layers, etc.

[0067] In one possible implementation, refer to Figure 2 , step S20 may include steps S21 to S25:

[0068] Step S21, performing a convolution operation on the spatial data to extract the corresponding convolution layer result;

[0069] Step S22, performing a nonlinear transformation on the convolutional layer result according to the activation function to obtain a corresponding activation layer result;

[0070] Step S23, performing a pooling operation on the activation layer result according to the sliding window and compensation to obtain a corresponding pooling layer result;

[0071] Step S24, flattening the pooling layer result into a one-dimensional vector, multiplying the one-dimensional vector with the weight matrix and adding a bias term to obtain a fully connected layer result;

[0072] Step S25, determining the contour extraction result corresponding to the fully connected layer result according to the normalized exponential function.

[0073] In the convolution layer, the convolution kernel, stride, and padding parameters are determined. The convolution kernel is used to perform sliding calculations on the input data, the stride defines the distance the convolution kernel moves each time, and the padding can be filled at the edge of the input data, which helps to maintain the size of the output feature map. The defined convolution kernel is applied to the spatial data, and the convolution operation can be used to calculate the sliding operation of the convolution kernel on the data. In this process, the convolution kernel performs element-by-element multiplication on the input data, and the multiplication results are added to obtain the convolution layer result.

[0074] In the activation layer, determine a suitable activation function, such as the Rectified Linear Unit (ReLU), apply the activation function to the result of the convolutional layer, and perform a nonlinear transformation on each value element by element. This operation will convert negative values ​​to zero while retaining positive values, and finally summarize the activation layer result.

[0075] In the pooling layer, the size of the sliding window and the offset size are determined. The sliding window defines the size of the area moved on the activation layer, and the offset defines the step size of each move, and determines the pooling type, such as Max Pooling, Average Pooling, etc. Then, the sliding window is moved on the activation layer result with a certain offset, and the pooling operation is applied within each window. For example, for max pooling, the maximum value in the window is selected as the pooling layer result; for average pooling, the average value of the elements in the window is calculated as the pooling layer result. These pooling layer results are usually smaller than the activation layer results while retaining important feature information, which helps to reduce the number of parameters, reduce computational complexity, and enhance the translation invariance of the network.

[0076] In the fully connected layer, if the output of the pooling layer is a three-dimensional tensor, such as a shape of (batch_size, height, width, channels), it needs to be converted into a one-dimensional vector, usually flattened into a shape of (batch_size, height * width * channels). Then, multiply the flattened one-dimensional vector by the weight matrix, and then add the bias term to get the result of the fully connected layer, that is, complete the following calculation: Fully connected layer result = pooling layer flattened one-dimensional vector x weight matrix + bias term. In addition, after obtaining the fully connected layer result, you can also apply an activation function to perform a nonlinear transformation on the result to introduce nonlinear factors and enhance the expressiveness of the model.

[0077] Finally, a normalized exponential function (hereinafter referred to as the Softmax function) is applied to the output of the fully connected layer, which converts the output of the fully connected layer into a probability distribution. In this way, the output of the fully connected layer can be interpreted as the probability of belonging to each category, and then the category with the highest probability is selected as the final contour extraction result.

[0078] This solution combines convolutional layers, activation layers, pooling layers, fully connected layers, and Softmax functions to form a powerful deep learning model. The convolutional layer can automatically extract useful features from spatial data; the activation layer introduces nonlinearity, allowing the network to learn complex nonlinear mapping relationships, thereby improving the model's expressiveness; the pooling layer reduces the size and number of parameters of the feature map, thereby reducing computational complexity and controlling overfitting to a certain extent; the fully connected layer helps reduce the loss of feature information and extracts higher-level feature representations by refitting the features; the Softmax function converts the output into probability, which can more clearly understand the network's confidence in different categories, thereby better understanding the model's prediction results.

[0079] Step S30, superimposing the contour extraction result and the spatial data, and displaying the superimposed data.

[0080] The format of the contour extraction results output by the deep learning model is identified. If the model outputs non-standard formats, such as PNG, JPG and other image formats, it can be converted and saved into a standard format, such as vector data format. Then, the saved contour extraction results are imported into the GIS system, and the contour extraction results are displayed by setting appropriate styles and symbols to ensure that they are clearly visible.

[0081] Optionally, the contour extraction result and the spatial data are directly adjusted to the same size, and then the two are superimposed and displayed.

[0082] Or, refer to Figure 3 , step S30 may include steps S31-S32:

[0083] Step S31, determining the first coordinate data of the contour extraction result and the second coordinate data corresponding to the spatial data;

[0084] Step S32: superimpose the contour extraction result with the spatial data according to the matching result of the first coordinate data and the second coordinate data, and display the superimposed data.

[0085] Different coordinate extraction methods are required for different types of data.

[0086] The coordinates of geometric objects in known vector data represent real positions in geographic space. Therefore, for vector data, the coordinate data of geometric objects can be directly extracted, such as the coordinates of points, the node coordinates of lines, the boundary coordinates of polygons, etc.

[0087] It is known that each pixel in the raster data has a position, which can be represented by coordinates. However, these coordinates are usually pixel coordinates relative to the image itself, not geographic coordinates. Therefore, for raster data, geo-registration is required, and the steps are as follows: select several points with known geographic locations on the image as control points. These points can be obvious geographic features, such as road intersections, building corners, etc.; for each control point, enter its corresponding geographic coordinates, which can be obtained from other geospatial data sources; use the pixel coordinates and geographic coordinates of the control points to calculate the transformation parameters from the image to the geographic coordinate system; use the calculated transformation parameters to convert the coordinates of each pixel in the image from pixel coordinates to geographic coordinates.

[0088] Based on the above principle, the first coordinate data of the contour extraction result and the second coordinate data corresponding to the spatial data are determined.

[0089] Furthermore, through the nearest neighbor algorithm, spatial relationship judgment and other spatial analysis algorithms, the coordinate data of the contour extraction result is matched with the coordinate data of the spatial data to ensure that the spatial position relationship of the contour corresponding to the spatial data is found. In this way, a new layer or data source is created in the geographic information system to store and display the superimposed data. In addition, the symbolization style can be set according to user needs, such as different colors, line widths, etc. to distinguish the contour extraction results and spatial data.

[0090] For example, the distance between each coordinate point of the contour extraction result and each coordinate point in the spatial data is calculated according to distance measurement methods such as Euclidean distance and Manhattan distance, and the nearest point is selected as the matching point. The spatial relationship of the matched point pairs is judged, and the matching points that meet the conditions are screened out according to specific spatial relationships such as inclusion relationship and intersection relationship. Finally, the successfully matched points are matched to establish a matching relationship between the contour data and the spatial data.

[0091] It is understandable that the comprehensive display of contour extraction results and spatial data can improve the effect of data visualization, strengthen the connection and understanding between data, and help to analyze and use spatial data more deeply. Moreover, by determining the correspondence between contour extraction results and spatial data in their respective coordinate systems, it can be ensured that each point of the contour accurately corresponds to the corresponding position of the spatial data, avoiding the loss of accuracy that may be caused by size adjustment, and making the superimposed data more accurate and reliable.

[0092] This embodiment provides a method for extracting urban building outlines based on spatial data, integrating a trained deep learning model in GIS. Since the deep learning model has strong adaptability to automatic outline extraction, it can be applied in different scenarios, whether it is crops, buildings, vehicles or other types of geographic information data, and this adaptability can help users process large quantities of data. Moreover, the deep learning model can quickly and accurately identify and extract outline information during the outline extraction process, thereby saving the time and cost of manual processing and improving the efficiency of data processing.

[0093] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 4 Before step S10, the method for extracting urban building outlines based on spatial data further includes steps A10 to A30:

[0094] Step A10, obtaining the environment information of the current environment, creating a new environment according to the environment information and activating it;

[0095] It should be noted that the current environment in the geographic information system defaults to the Python environment. Environmental information refers to various properties and configurations of the current environment, including but not limited to the operating system version, installed GIS software version, available hardware resources, network configuration, etc. This information can be obtained by using management tools such as Windows Task Manager, Linux top, free, uname-a and other commands, or the built-in environment check function of the GIS software.

[0096] When a request to clone an environment is detected through the package manager interface, or a request to automatically clone an environment is triggered, virtualization technology is used to create and activate a new environment. The specific process is as follows:

[0097] First, use a virtual environment tool such as virtualenv or venv to create an initialized new environment, activate the new environment, and make it the working environment for the current session. Then, use commands in the new environment to install the same dependency packages and versions as in the original environment. For example, you can run "pip freeze>requirements.txt" to generate a dependency list file in the original environment, and then run "pip install-requirements.txt" in the new environment to install these dependency packages. Finally, you can verify by running a script in the command line or using a virtual environment management tool.

[0098] Step A20, installing a deep learning framework in the new environment according to the framework information;

[0099] Step A30, loading the trained deep learning model into the deep learning framework.

[0100] It should be noted that a framework is a reusable design component that clarifies the dependencies, responsibilities, and control flows of the entire design and collaboration. The framework provides a context for component reuse, so that specific functions can be quickly implemented on its basis. Accordingly, framework information usually includes tools, libraries, templates, installation packages, etc., which together constitute the ecosystem of the framework. Framework information can be read directly from the local file system or actively input by the user through the user interface, which is not limited here.

[0101] Optionally, read the installation package information from the framework information, which usually includes the version number of the framework, dependent libraries, and other information. Then, use this information in the new environment to determine the installation package of the deep learning framework that needs to be downloaded. After the download is complete, install the deep learning framework in the new environment through the corresponding installation command or script. After the installation is complete, some verification steps can be performed, such as running test code or sample code, to ensure that the deep learning framework has been correctly installed and can run normally.

[0102] Furthermore, after reading the deep learning model from the framework information, the deep learning model is loaded using a corresponding function or API provided by the deep learning framework.

[0103] This solution uses a direct integration approach to allow deep learning models to run inside the GIS, reducing data transmission and communication overhead, thereby improving processing speed and efficiency. Moreover, compared to integrating in the current environment, this solution clones the environment and integrates the deep learning model in the new environment, which can more accurately control and manage resource usage, which helps optimize performance and reduce resource contention, thereby improving model processing speed and efficiency.

[0104] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. Figure 5 Before step S10, the method for extracting urban building outlines based on spatial data further includes steps B10 to B30:

[0105] Step B10, displaying the data to be labeled, and obtaining a training sample drawn by a user based on the data to be labeled, or obtaining an existing training sample;

[0106] Load and display the data to be labeled in the display interface to ensure that the user can clearly see the data content. Guide the user to draw training samples on the GIS interface based on the data to be labeled, such as marking the boundaries of geographic entities, classification labels, etc. Alternatively, if there are ready-made training samples, these samples can be loaded directly from the database or file.

[0107] Step B20, determining the untrained deep learning model, model parameters, and training framework in the framework information;

[0108] Parse the framework information to obtain the untrained deep learning model, model parameters and training framework. Among them, the untrained deep learning model has not been trained with any data; the model parameters include the number of network layers, the number of neurons in each layer, the activation function, the loss function, the optimizer, the training termination condition, etc. In the subsequent training process, these parameters will be gradually adjusted by the optimizer according to the feedback of the loss function, so that the model can achieve better performance; the training framework refers to the software framework used to implement deep learning model training, such as PyTorch or a third-party deep learning framework that supports use outside GIS.

[0109] Step B30: In the training framework, the untrained deep learning model is trained according to the model parameters and the training samples to obtain the trained deep learning model.

[0110] In the training framework, the untrained deep learning model is trained according to the model parameters and training samples, and the specific process is similar to the first embodiment. During the training process, the difference between the predicted result and the true label in the training sample is calculated using the loss function, and the model parameters are updated by the back propagation algorithm. The training process is repeated until the training termination condition is met, such as reaching a preset number of iterations or the loss value converges, to obtain a trained deep learning model.

[0111] In one possible implementation, refer to Figure 6 , step B30 may include steps B31-B32:

[0112] Step B31, combining the object detection tool, the pixel classification tool and the object classification tool with the trained deep learning model, and outputting the corresponding object detection results, pixel classification results and object classification results;

[0113] Step B32: If the detection object result, the classification pixel result and the classification object result meet the training termination condition in the model parameters, the trained deep learning model is output.

[0114] It is important to note that the Detect Objects tool is used to identify and locate specific objects or entities in geospatial imagery. The Classify Pixels tool is used to classify each pixel in a geospatial image into different categories or labels. The Classify Objects tool further classifies the identified objects based on the Detect Objects tool.

[0115] It can be understood that by combining the model with three different tools in GIS, the performance of the model on different tasks can be comprehensively evaluated, which helps to improve the generalization ability of the model and ensure that the model can better adapt to various complex situations in actual application.

[0116] Optionally, the trained deep learning model is integrated with the object detection tool in GIS through an API or plug-in to ensure that they can cooperate and work together. Then the data in the validation set is input into the integrated object detection tool to obtain the corresponding object detection results. Similarly, the classified pixel results corresponding to the classified pixel tool and the classified object results corresponding to the classified object tool are obtained. Among them, the object detection results usually include information such as the bounding box coordinates and confidence scores of the detected objects; the classified pixel results usually include the predicted category labels for each pixel, which can be used for pixel-level semantic segmentation; the classified object results usually include the category labels for each object, which can be used to classify and identify different objects.

[0117] Furthermore, it is analyzed whether the detection object results, classification pixel results, and classification object results meet the training termination conditions in the model parameters, wherein the training termination conditions can be set from the dimensions of accuracy, recall rate, loss function, number of training times, etc. For example, when the detection object results, classification pixel results, and classification object results all meet a specific loss function, it means that the current deep learning model performs well in all aspects, and the deep learning model can be output at this time.

[0118] In one possible implementation, refer to Figure 7 , step B32 may include steps B321~B322:

[0119] Step B321, calculating a first matching rate between the detected object result and the classified pixel result, and a second matching rate between the detected object result and the classified object result;

[0120] Step B322: If the first matching rate and the second matching rate are both greater than the preset matching rate, the trained deep learning model is output.

[0121] It is understandable that for the same input data, if the performance of the deep learning model is good, then the output results of the integrated detection object tool, classification pixel tool, and classification object tool should be consistent. Therefore, this solution determines whether to end the training based on the mutual verification of the output results. In this way, the error and inaccuracy caused by a single tool can be reduced and the robustness of the overall model can be improved. Moreover, mutual verification can reduce the overfitting of the model to the training data instead of just remembering the detailed features of the training data.

[0122] On the one hand, for each object boundary and the pixels in the corresponding area in the object detection tool and the classification pixel results, the consistency of the pixel categories in the boundary is calculated. Specifically, the first matching rate can be calculated using indicators such as pixel accuracy or intersection over union (IoU). For example, IoU is the intersection of the bounding box and the corresponding pixel area over their union, which can be used to measure the overlap between the detected object and the actual object position.

[0123] For example, given the detected object result: bounding box A, coordinates: (0, 0, 10, 10)

[0124] Known classification pixel result: pixel area B, coordinates: (5, 5, 15, 15)

[0125] Calculate the intersection area: The intersection of the two areas is a square with a side length of 5, so the intersection area is 5*5=25

[0126] Calculate the union area: According to the position and size of the two regions, the overall union is the entire area covered by the two regions, that is, the rectangular area (0, 0, 15, 15), and the union area is 15*15=225

[0127] Calculate the first match rate of intersection over union: IoU = intersection area / union area = 25 / 225 = 0.1111

[0128] On the other hand, the object category label output by the detection object tool is compared with the category label output by the classification object tool to calculate the consistency of the category label. Specifically, the second matching rate can be calculated using indicators such as Category Accuracy.

[0129] For example, assuming that the number of objects in category A, category B, and category C in the classified object result are 10, 15, and 20 respectively, and there are 30 objects in the detection object result, 15 of which match the classified objects, then the second matching rate is 15 / 30=0.5, indicating that half of the objects in the detection object result match the classified object result.

[0130] If both the first matching rate and the second matching rate are greater than the preset matching rate, it is considered that the model performance is good and there is consistency between the output results. At this time, the deep learning model can be output.

[0131] This embodiment provides a method for extracting urban building outlines based on spatial data. Different from directly obtaining a trained deep learning model, this solution can customize the model according to the actual scenario and data characteristics to meet the needs of specific tasks and improve the performance of the model on specific tasks. Moreover, considering that GIS can provide powerful spatial data management and analysis capabilities, users can accurately annotate geographic spatial data in it. This GIS-based annotation method can ensure the accuracy and consistency of the data and provide high-quality training data for subsequent deep learning model training.

[0132] Based on the first embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the first embodiment can refer to the above description, and will not be described in detail later. Figure 8 After step S30, the method for extracting urban building outlines based on spatial data further includes steps C10 to C30:

[0133] Step C10, determining edge features and shape features in the contour extraction result;

[0134] Step C20, determining the element classification results corresponding to the edge features and the shape features according to the trained deep learning model;

[0135] Step C30, displaying the element classification result.

[0136] Optionally, an edge detection algorithm, such as the Canny edge detection algorithm, is used to detect the edge of the object from the contour extraction result to capture the overall shape of the object. Then, shape features can be extracted by feature extraction algorithms, such as Hough transform, shape descriptor, etc. These shape features can include geometric information of the object, such as perimeter, area, aspect ratio, etc.

[0137] Exemplarily, the contour extraction result is converted into a grayscale image; the image is Gaussian smoothed to reduce the influence of noise; the gradient amplitude and direction of the image are calculated using the Sobel operator or other methods; whether it is an edge point is determined by comparing the gradient direction, and the edge is refined in the non-maximum suppression process; the edge point is classified as a strong edge, a weak edge or a non-edge point according to the set high and low thresholds; and a complete edge line is formed by connecting strong edge and weak edge pixels.

[0138] Exemplarily, edge points are converted into Hough parameter space, for example, the parameter space of a straight line is polar coordinates (ρ, θ); in the Hough parameter space, information of edge points is accumulated to find collinear edge points and straight line parameters; by setting a threshold or other methods, straight line parameters whose accumulated amount exceeds the threshold are screened out, thereby detecting straight lines in the image.

[0139] Furthermore, the trained deep learning model of shape features and edge features is input into the trained deep learning model to obtain the corresponding element classification results. The specific process is the same as the first embodiment and will not be repeated here.

[0140] Furthermore, the feature classification results can be displayed in the geographic information system either individually or by superimposing the spatial data and the contour extraction results. The principle is the same as that of the first embodiment and will not be elaborated here.

[0141] Based on the contour extraction, this embodiment first extracts the contour through the deep learning model to extract the lower-level feature representation. Then, based on these low-level features, the deep learning model is used again to classify the elements. By using the multi-level feature extraction capability of the deep learning model, more abstract and advanced features can be further extracted to represent the elements.

[0142] For example, in order to help understand the implementation process of the method for extracting urban building outlines based on spatial data obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Fig. 9 , Fig. 9 A brief flowchart of a method for extracting urban building outlines based on spatial data is provided. Specifically:

[0143] (1) Building the Arc GIS Pro Deep Learning Framework:

[0144] ① Use the Task Manager to determine whether the terminal is equipped with a specific graphics card model. If so, activate the corresponding graphics card driver installation.

[0145] ②According to the version of ArcGisPro, obtain the corresponding deep learning framework from the official website.

[0146] ③ According to the ArcGisPro package manager, clone and activate the new environment.

[0147] (2) Draw training samples:

[0148] ① Display the data to be labeled, and obtain training samples through user labeling operations.

[0149] ②If existing training samples are detected, they can be added in batches.

[0150] ③Export training samples. If the export is incorrect, you can solve it according to the corresponding solution.

[0151] (3) Model training:

[0152] ① Setting model parameters. Select the model provided by ArcGisPro as the model type; set the Graphics Processing Unit (GPU) and the Central Processing Unit (CPU) in the environment, giving priority to the GPU; train the deep learning model through PyTorch or a third-party deep learning framework that supports use outside of ArcGIS Pro.

[0153] ②Errors may occur during model training. Solve the problems according to the corresponding solutions.

[0154] (4) Model verification: Combine the deep learning model with the Detect Objects tool, Classify Pixels tool, and Learn to Classify Objects tool, and verify all output results.

[0155] (5) Model application: Use the trained deep learning model to realize image classification and vector drawing of raster data.

[0156] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the method of extracting urban building outlines based on spatial data in the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0157] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for extracting urban building outlines based on spatial data, characterized in that: The method is applied to a geographic information system, and the method comprises: Obtain the spatial data to be extracted; According to the trained deep learning model, a convolution operation is performed on the spatial data to extract the corresponding convolution layer result; Performing a nonlinear transformation on the convolutional layer result according to the activation function to obtain a corresponding activation layer result; Performing a pooling operation on the activation layer result according to the sliding window and the compensation to obtain a corresponding pooling layer result; Flatten the pooling layer result into a one-dimensional vector, multiply the one-dimensional vector by the weight matrix and add a bias term to obtain a fully connected layer result; Determine the contour extraction result corresponding to the fully connected layer result according to the normalized exponential function; Determine first coordinate data of the contour extraction result and second coordinate data corresponding to the spatial data; Matching the first coordinate data with the second coordinate data by a spatial analysis algorithm to determine a spatial position relationship between the contour and the spatial data; According to the matching result of the first coordinate data and the second coordinate data, the contour extraction result is superimposed with the spatial data, and the superimposed data is displayed.

2. The method according to claim 1, characterized in that Before the step of obtaining the spatial data to be extracted, the method further includes: Obtaining the environment information of the current environment, creating a new environment based on the environment information and activating it; In the new environment, installing a deep learning framework according to the framework information; Load the trained deep learning model into the deep learning framework.

3. The method according to claim 1, characterized in that Before the step of obtaining the spatial data to be extracted, the method further includes: Display the data to be labeled, and obtain training samples drawn by the user based on the data to be labeled, or obtain existing training samples; Determine the untrained deep learning model, model parameters, and training framework in the framework information; In the training framework, the untrained deep learning model is trained according to the model parameters and the training samples to obtain the trained deep learning model.

4. The method according to claim 3, characterized in that After the step of training the untrained deep learning model according to the model parameters and the training samples in the training framework to obtain the trained deep learning model, the method further includes: Combine the object detection tool, the pixel classification tool and the object classification tool with the trained deep learning model, and output corresponding object detection results, pixel classification results and object classification results; If the detected object result, the classified pixel result and the classified object result meet the training termination condition in the model parameters, the trained deep learning model is output.

5. The method according to claim 4, characterized in that If the detected object result, the classified pixel result, and the classified object result satisfy the training termination condition in the model parameters, the step of outputting the trained deep learning model comprises: Calculating a first matching rate between the detected object result and the classified pixel result, and a second matching rate between the detected object result and the classified object result; If both the first matching rate and the second matching rate are greater than the preset matching rate, the trained deep learning model is output.

6. The method according to claim 1, characterized in that After the step of superimposing the contour extraction result and the spatial data and displaying the superimposed data, the method further includes: Determining edge features and shape features in the contour extraction result; Determine, according to the trained deep learning model, the element classification results corresponding to the edge features and the shape features; The classification result of the element is displayed.