Building symbol identification method, electronic equipment and computer readable medium

By extracting vector polygons from architectural images and fusing raster, geometric, and semantic features, and utilizing a domain attention computation layer to construct local contextual features, the problem of inaccurate architectural symbol recognition in existing technologies is solved, thereby improving recognition accuracy and robustness.

CN121921809APending Publication Date: 2026-04-24GUANGWEI CREATIVE ARTIFICIAL INTELLIGENCE (XIAMEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGWEI CREATIVE ARTIFICIAL INTELLIGENCE (XIAMEN) CO LTD
Filing Date
2026-01-06
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing architectural symbol recognition technologies suffer from inaccurate results, particularly in complex scenarios where accuracy is low, and they fail to effectively utilize heterogeneous information and local contextual relationships within architectural images.

Method used

A method for architectural symbol recognition is proposed. The method extracts the initial contour of the architectural symbol through a vector polygon prediction model and optimizes the sub-contour. It combines raster features, geometric features and semantic features for feature fusion and uses a domain attention computing layer to construct local context features to achieve accurate classification of architectural symbols.

Benefits of technology

It improves the accuracy of architectural symbol recognition, reduces the risk of misidentification due to noise and complex scenes, and enhances the ability to distinguish architectural symbols that are similar in shape but different in function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121921809A_ABST
    Figure CN121921809A_ABST
Patent Text Reader

Abstract

The invention discloses a building symbol recognition method, electronic equipment and a computer readable medium, and relates to the technical field of building image vectorization and symbol recognition, and the method comprises the steps: obtaining a to-be-recognized building image; wherein the to-be-recognized building image comprises geometrical morphology information and text labeling information of building symbols; extracting a vector polygon corresponding to the building symbol from the building image to be identified; and inputting the to-be-recognized building image and the vector polygon into a symbol recognition model to obtain the category of the building symbol output by the symbol recognition model. According to the invention, the accuracy of building symbol identification can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of architectural symbol recognition technology, specifically to an architectural symbol recognition method, electronic device, and computer-readable medium. Background Technology

[0002] In the field of building technology, architectural images are the core carriers of architectural design, construction and operation, and accurately identifying architectural symbols such as walls, doors, windows and railings from architectural images is a key link in realizing the digitization of buildings.

[0003] However, there is a problem of inaccurate recognition results when identifying architectural symbols such as walls, doors, windows, and railings from architectural images. Summary of the Invention

[0004] This invention aims to address, to a certain extent, one of the technical problems in related technologies. To this end, this invention provides a method for recognizing architectural symbols, an electronic device, and a computer-readable medium, which have the advantage of improving the accuracy of architectural symbol recognition.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: A method for identifying architectural symbols, comprising: Acquire an image of the building to be identified; wherein the image of the building to be identified includes geometric morphological information and text annotation information of the building symbols; Extract the vector polygon corresponding to the building symbol from the image of the building to be identified; The building image to be identified and the vector polygon are input into a pre-trained symbol recognition model to obtain the category of the building symbol output by the symbol recognition model; The symbol recognition model includes a feature extraction layer, a feature fusion layer, a vector embedding layer, a neighborhood attention calculation layer, and a classification output layer. The feature extraction layer is connected to the feature fusion layer, the feature fusion layer is connected to the vector embedding layer, the vector embedding layer is connected to the neighborhood attention calculation layer, and the attention calculation layer is connected to the classification layer. The feature extraction layer extracts raster features, geometric features, and semantic features from the building image to be recognized and the vector polygon. The feature fusion module concatenates the raster features, the geometric features, and the semantic features to obtain fused features. The vector embedding layer maps the fused features to a shared feature space and normalizes the mapping results to obtain embedded features. The neighborhood attention calculation layer associates the embedded features with a preset number of nearest embedded features to obtain local context features. The classification output layer maps the local context features to the category space of each building symbol to obtain the spatial relationship of the building symbols, maps the spatial relationship to probability for symbol classification, and outputs the category of the building symbol.

[0006] Optionally, the step of extracting the vector polygon corresponding to the building symbol from the building image to be identified includes: The image of the building to be identified is preprocessed to obtain a preprocessed image of the building to be identified; The preprocessed building image to be identified is input into the vector polygon prediction model to obtain the vector polygons corresponding to each building symbol output by the vector polygon prediction model. The vector polygon prediction model includes an image encoder, an iterative decoder, a fine-grained contour distribution refinement layer, and an output layer. The image encoder is connected to the iterative decoder, which is connected to the fine-grained contour distribution refinement layer, which is connected to the output layer. The image encoder extracts the initial contours corresponding to each building symbol from the preprocessed image of the building to be identified. The iterative decoder splits the initial contours into multiple sub-contours to obtain optimized sub-contours. The fine-grained contour distribution refinement layer predicts the boundary point offsets of each optimized sub-contour using dual parallel heads and adjusts the boundary point offsets using the outer border size of each sub-contour as a scaling factor to obtain adjusted sub-contours. The output layer stitches together all adjusted sub-contours to obtain vector polygons corresponding to each building symbol and outputs the vector polygons corresponding to each building symbol.

[0007] Optionally, the feature extraction layer includes a raster extraction module, a geometric information extraction module, and a semantic extraction module. The feature extraction layer extracts raster features, geometric features, and semantic features from the building image to be identified based on the following steps: The raster extraction module extracts raster features from the building image to be identified and the vector polygon. The geometric information extraction module extracts geometric features from the vector polygon. The semantic extraction module extracts semantic features from the building image to be identified and the vector polygon.

[0008] Optionally, the step of extracting raster features from the building image to be identified and the vector polygon using the raster extraction module includes: The image of the building to be identified is converted into a 4-level multi-scale feature map using an image encoder; Using bilinear interpolation and the vector polygon, boundary points corresponding to the architectural symbols are extracted from the 4-level multi-scale feature map to obtain a set of boundary points. One-dimensional max pooling is performed on the set of boundary points to obtain a one-dimensional feature representation; A rotational region of interest for an architectural symbol is constructed based on the geometric information of the vector polygon; wherein, the geometric information includes the center coordinates, original width, original height, and rotation angle of the vector polygon corresponding to the architectural symbol; Using the region of interest of the architectural symbol, a region feature map corresponding to the architectural symbol is determined from the 4-level multi-scale feature map; The region feature map is converted into a one-dimensional feature vector; The grid feature is obtained by concatenating the one-dimensional feature vector with the one-dimensional feature representation.

[0009] Optionally, the step of extracting geometric features from the vector polygon using the geometric information extraction module includes: Based on the geometric information of the vector polygons of each architectural symbol, the outline features, orientation features, aspect ratio features, quantized area, and quantized perimeter of the architectural symbol are determined. The geometric feature is obtained by splicing the contour feature, the orientation feature, the aspect ratio feature, the quantized area, and the quantized perimeter.

[0010] Optionally, the step of extracting semantic features from the building image to be identified and the vector polygon through the semantic extraction module includes: Extract index text and functional text from the building image to be identified; wherein the index text is directly associated with the category of the building symbol, and the functional text is associated with the spatial function of the building symbol; Based on the center coordinates of the index text in the image of the building to be identified and the center coordinates of the vector polygon in the image of the building to be identified, calculate the Euclidean distance between the index text and the vector polygon; The index text with the smallest Euclidean distance is taken as the target index text of the vector polygon, and the target index text is converted into a OneHot vector; The functional text is bound to a polygonal region containing the functional text to obtain a region label; Map the region labels to the vector polygons that constitute the polygon regions to obtain the mapping relationship between the vector polygons and the functional text; The mapping relationship between the vector polygon and the functional text is converted into a MultiHot vector; The semantic features are obtained by concatenating the OneHot vector and the MultiHot vector.

[0011] Optionally, the domain attention calculation layer obtains local context features by associating the embedded features with a preset number of nearest embedded features based on the following steps: The embedded features are stacked with the preset number of nearest embedded features to obtain a local feature matrix; The local feature matrix is ​​projected through a projection matrix to generate a query matrix, key matrix, and value matrix for multi-head attention. Calculate the one-dimensional relative position offset between any two building symbols in the local feature matrix; Using the one-dimensional relative position offset, construct a relative position offset matrix; The output features of the corresponding attention head are determined using the relative position offset matrix, the query matrix, the key matrix, and the value matrix. The output features of all attention heads are concatenated to obtain the concatenated head output features; The head output features are projected onto the output space to obtain the local context features.

[0012] Optionally, before inputting the building image to be identified and the vector polygon into a pre-trained symbol recognition model to obtain the symbol category of the building symbol output by the symbol recognition model, the method further includes: Obtain a training dataset; wherein the training dataset includes sample building images and their corresponding labels, and the labels corresponding to the sample building images include the categories of building symbols in the sample building images; The training data samples are input into the initial symbol recognition model to obtain the recognition results of the building symbol categories output by the initial symbol recognition model; The loss between the recognition result and the label is quantified using balanced cross-entropy loss. The model parameters of the initial symbol recognition model are updated using the loss until the loss is less than a preset threshold, and the initial symbol recognition model with a loss less than the preset threshold is used as the symbol recognition model.

[0013] In a second aspect, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the architectural symbol recognition method described in any of the preceding claims.

[0014] Thirdly, the present invention also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the architectural symbol recognition method described in any of the preceding claims.

[0015] In this invention, raster features can represent the visual texture and edge details of architectural symbols, geometric features can characterize the shape, size, and spatial outline of architectural symbols, and semantic features can extract the category attributes of architectural symbols from text annotation information. A feature extraction layer simultaneously extracts raster features, geometric features, and semantic features from the architectural image to be identified and vector polygons. A feature fusion layer concatenates raster features, geometric features, and semantic features, achieving deep integration of heterogeneous features through concatenation. This allows for complementary representation of architectural symbols from different dimensions, compensating for the limitations of single-modal information and providing a comprehensive basis for classifying architectural symbols. For the embedded features of the fused features, a domain attention calculation layer associates the embedded features with a preset number of nearest fused features, constructing a local contextual relationship between the current architectural symbol and surrounding architectural symbols. This provides additional constraints for architectural symbol recognition, reduces the confusion rate of similar symbols, and makes the recognition results more consistent with the actual design logic of architectural floor plans, thereby improving the accuracy of architectural symbol recognition.

[0016] These features and advantages of the present invention will be disclosed in detail in the following specific embodiments and accompanying drawings. The preferred embodiments or means of the present invention will be shown in detail in conjunction with the accompanying drawings, but are not intended to limit the technical solutions of the present invention. In addition, each of these features, elements and components appearing in the following text and drawings is a plurality of, and different symbols or numbers are used for convenience of representation, but all represent parts with the same or similar construction or function. Attached Figure Description

[0017] The present invention will be further described below with reference to the accompanying drawings: Figure 1 A flowchart illustrating one embodiment of the architectural symbol recognition method provided by the present invention; Figure 2 This is a schematic diagram of the process for extracting vector polygons corresponding to architectural symbols from an image of a building to be identified, as provided by the present invention. Figure 3 A schematic diagram of the internal structure of the vector polygon prediction model provided in this invention; Figure 4 This is a schematic diagram of the internal structure of the symbol recognition model provided by the present invention; Figure 5 This is a schematic diagram illustrating the setting of sampling points at the midpoint and the center of a vector polygon, as provided by the present invention. Figure 6 This is a schematic diagram of the process for extracting raster features from an image of a building to be identified and a vector polygon, as provided by the present invention. Figure 7 This is a schematic diagram of the raster feature extraction process provided by the present invention; Figure 8A schematic diagram of dense boundary point sampling provided by the present invention; Figure 9 This is a schematic diagram illustrating the supplementary coarse-grained region sampling provided by the present invention; Figure 10 This is a schematic diagram of the process for extracting geometric features from a vector polygon provided by the present invention; Figure 11 This is a schematic diagram of the process for acquiring geometric features provided by the present invention; Figure 12 This is a schematic diagram of the process for extracting semantic features from an image of a building to be identified and a vector polygon, as provided by the present invention. Figure 13 This is a schematic diagram of text information in a building image to be identified provided by the present invention. Figure 14 The flowchart illustrates how the domain attention computation layer provided by this invention associates embedded features with a preset number of nearest embedded features to obtain local context features; Figure 15 This is a schematic diagram illustrating the determination of a preset number of the nearest embedded features provided by the present invention; Figure 16 This is a schematic diagram of the training process for the symbol recognition model provided by the present invention; Figure 17 A schematic diagram showing the geometric degradation comparison between the predicted polygon vector and the reference polygon vector provided in this invention; Figure 18 A schematic diagram comparing baseline failure under high visual similarity provided by the present invention with the output of the method proposed in this embodiment; Figure 19 A block diagram illustrating one embodiment of the electronic device provided by the present invention; Figure 20 This is a schematic diagram of a computer-readable medium provided by the present invention.

[0018] Explanation of reference numerals in the attached figures: 101: Processor; 102: Memory; 103: I / O interface; 104: Bus. Detailed Implementation

[0019] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described are intended to explain the present invention and should not be construed as limiting the invention.

[0020] The terms "an embodiment," "example," or "trademark" used in this specification refer to a particular feature, structure, or characteristic described in connection with the embodiment itself that may be included in at least one embodiment disclosed in this invention. The phrase "in an embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment.

[0021] In the field of architectural symbol recognition technology, architectural images are the core carriers of architectural design, construction and operation. The automatic recognition of architectural symbols such as walls, doors, windows and railings is a key link in realizing the digitalization of buildings.

[0022] Currently, architectural symbol recognition technologies in architectural images are mainly divided into three categories, all of which have significant technical shortcomings: Traditional image processing methods rely on manually designed feature operators (such as edge detection, Hough transform, and template matching) and a fixed multi-stage pipeline to achieve architectural symbol recognition through steps such as binarization, denoising, text separation, and contour extraction. The effectiveness of these methods depends entirely on manually designed rules, resulting in extremely poor adaptability to different drawing styles, line thicknesses, and scanning artifacts (such as creases and smudges). They also have weak generalization ability, cannot cope with the diverse scenarios of complex architectural images, and their performance drops sharply under non-ideal input conditions.

[0023] Raster-based recognition methods directly process scanned architectural images, using image feature extractors such as convolutional neural networks and deep learning models such as encoder-decoder pairs to predict pixel-level masks or target bounding boxes for architectural symbols, thereby achieving symbol recognition. This type of method has inherent drawbacks: First, pixel-level processing easily leads to blurred boundary details, resulting in low recognition accuracy for thin architectural symbols (such as narrow windows or thin railings) and low-texture areas (such as blank walls); second, the lack of explicit modeling of geometric structures easily leads to topological distortion (such as gaps or overlaps) during subsequent vectorization of the architectural image; third, relying solely on visual features and failing to utilize semantic information such as text annotations in the architectural image makes it difficult to distinguish architectural symbols with similar shapes but different functions (such as sliding doors and windows).

[0024] Vector-based recognition methods assume the availability of native CAD vector files (containing explicit coordinates and primitive connections), and classify and recognize vector architectural symbols using models such as graph convolutional networks. While these methods can preserve geometric fidelity, they suffer from severe limitations: native vector files are difficult to obtain due to confidentiality restrictions and inconsistent archiving standards. In practical applications, architectural symbols obtained through "raster-to-vector conversion" must be used for recognition. However, registration errors, vertex offsets, fragmented geometry, and other noise generated during the conversion process can drastically degrade the performance of these methods, resulting in insufficient robustness.

[0025] Based on the shortcomings of existing technologies, there are five core technical problems in the field of architectural symbol recognition: (1) Single modality dependence: Existing methods rely only on single modalities of raster images or vector data, which cannot integrate heterogeneous information such as boundary features, geometric structures, and text annotations that exist simultaneously in the plan view. They have weak anti-interference capabilities and are difficult to adapt to noise, artifacts, and other interference in real scenes; (2) Contradiction between geometric fidelity and robustness: Raster-based methods are difficult to preserve accurate boundaries, and vector-based methods are sensitive to noise in architectural symbols. Neither can balance recognition accuracy and environmental adaptability in real scenes; (3) Lack of semantic information: Text annotations in architectural images, such as the "W-1" wall sign and "Bedroom", are not effectively utilized. (4) Class imbalance problem: The number of high-frequency building symbols such as walls and windows in building images differs significantly from that of low-frequency building symbols such as railings and special openings. Traditional loss functions make the model biased to learn the features of high-frequency building symbols, resulting in the recognition accuracy of low-frequency building symbols being much lower than that of high-frequency building symbols, and the overall recognition balance is poor. (5) Lack of local interaction modeling: The local correlation of building symbols in building images is not considered, such as the spatial constraints between doors and windows and adjacent walls. Using full-image feature interaction leads to high computational complexity and cannot use local context to optimize the symbol classification results, which easily leads to inconsistent labels for the same type of building symbols.

[0026] Therefore, there is a problem of inaccurate recognition results when identifying architectural symbols such as walls, doors, windows, and railings from architectural images.

[0027] In view of this, this embodiment provides a method for recognizing architectural symbols, such as... Figure 1 As shown, the method includes: In step S110, an image of the building to be identified is acquired.

[0028] The building image to be identified includes geometric morphological information of the building symbols and text annotation information.

[0029] In step S120, a vector polygon corresponding to the building symbol is extracted from the building image to be identified.

[0030] In this embodiment, the building image to be identified can be a rendered or scanned bitmap. The building image to be identified can be vectorized to obtain a vectorized building image to be identified. The vectorized building image to be identified includes vector polygons corresponding to each building symbol.

[0031] Specifically, the building image to be identified can be stored locally on the electronic device, and the planar image to be identified can be read from the local storage of the electronic device during step S110.

[0032] Understandably, the core value of architectural images lies in their precise spatial distribution, dimensional proportions, and topological relationships, such as wall lengths, door and window positions, and connections between buildings. In practical applications, original architectural floor plans are often exported as bitmaps for distribution and printing. Rasterized architectural images contain rich pixel-level visual information, such as edge textures, grayscale differences, and local contrast. This pixel-level visual information is crucial for identifying architectural symbols; for example, load-bearing walls have coarse lines. Furthermore, exporting original architectural floor plans as bitmaps strips away key structured data such as vertex coordinates, centroid coordinates, and layer information of architectural symbols. Therefore, to convert the pixel information in the architectural floor plan to be identified into precise structural information and to achieve high accuracy in architectural symbol recognition, further, as an optional implementation method, refer to... Figure 2 As shown, Figure 2 A flowchart illustrating the process of extracting vector polygons corresponding to architectural symbols from an image of a building to be identified. Step S120 specifically includes: In step S210, the building image to be identified is preprocessed to obtain a preprocessed building image to be identified.

[0033] In step S220, the preprocessed building image to be identified is input into the vector polygon prediction model to obtain the vector polygons corresponding to each building symbol output by the vector polygon prediction model. The vector polygon prediction model includes an image encoder, an iterative decoder, a fine-grained contour distribution refinement layer, and an output layer. The image encoder is connected to the iterative decoder, which is connected to the fine-grained contour distribution refinement layer, which is connected to the output layer. The image encoder extracts the initial contours corresponding to each building symbol from the preprocessed image of the building to be identified. The iterative decoder splits the initial contours into multiple sub-contours to obtain optimized sub-contours. The fine-grained contour distribution refinement layer predicts the boundary point offsets of each optimized sub-contour using dual parallel heads and adjusts the boundary point offsets using the outer border size of each sub-contour as a scaling factor to obtain adjusted sub-contours. The output layer stitches together all adjusted sub-contours to obtain vector polygons corresponding to each building symbol and outputs the vector polygons corresponding to each building symbol.

[0034] In this embodiment, the preprocessing of the building image to be identified can be performed sequentially on the building image to be identified by Gaussian filtering for noise reduction, Otsu thresholding for binarization to separate the building symbol region from the background, and Laplacian operator edge enhancement operation, to obtain a preprocessed image that highlights the outline of the building symbol, i.e., the preprocessed building image to be identified.

[0035] Reference Figure 3 As shown, Figure 3 This is a schematic diagram of the internal structure of the vector polygon prediction model. After obtaining the preprocessed building image to be identified, the preprocessed building image is input into the vector polygon prediction model. Upon receiving the preprocessed building image, the backbone network of the vector polygon prediction model first extracts the edge features of each building symbol from the building image. Based on the edge features extracted by the backbone network, the image encoder aggregates the global context information of the building symbols through the self-attention mechanism of the encoder layer, generating high-dimensional features. Based on the high-dimensional features of each building symbol, the approximate range of each building symbol is determined from the building image to obtain the initial contour and sub-contour embedding of each building symbol. That is, through 300 instance queries combined with a cross-attention mechanism, the position of the building symbol is determined from the preprocessed building image to be identified, and the initial bounding box of the building symbol is predicted. After determining the initial bounding box of the building symbol, the center of the initial bounding box is used as the center of the ellipse, the major axis is equal to the width of the initial bounding box, and the minor axis is equal to the height of the initial bounding box. Samples are uniformly taken along the circumference of the ellipse. An ordered set of boundary points forms a closed initial contour. Sub-contour embeddings are used to provide a feature base for subsequent sub-contour segmentation.

[0036] After obtaining the initial outline of the architectural symbol, for the high-dimensional features in the image encoder, the instance-level query and sub-outline-level query that are strongly related to the initial outline of the architectural symbol can be filtered out by intersection-union ratio perceptual query, and combined with position embedding to obtain a query vector of fixed dimension.

[0037] The features of the noisy initial contour are then fed into the denoising module to obtain the features of the denoised initial contour. The features of the denoised initial contour, the query vector, and the sub-contour embeddings are then input into the iterative decoder. The iterative decoder can extract the features from the initial contour using the sub-contour embeddings. An ordered boundary point is uniformly divided into a preset number of sub-contours. Each sub-contour corresponds to a local structure of the architectural symbol, and each sub-contour includes a preset number of ordered boundary points. For example, 64 ordered boundary points are uniformly sampled along the circumference of an ellipse, and the 64 ordered boundary points in the initial contour are uniformly divided into 8 sub-contours, each sub-contour including 8 ordered boundary points. When further dividing the sub-contours, the curvature variation of the contour can be used as the basis for division. For example, if the curvature variance exceeds a threshold, the architectural symbol is determined to be an irregular symbol such as a fan-shaped door or a curved wall. To reduce the difficulty of optimizing the sub-contours, the ordered boundary points in the initial contour can be uniformly divided into more sub-contours, such as dividing the 64 ordered boundary points uniformly into 16 sub-contours.

[0038] For each sub-contour, the stacked decoder layers in the iterative decoder can update the sub-contour query by decoupling self-attention and multi-scale deformable attention. For example, 300 instance-level query vectors and 8 sub-contour-level query vectors can be initialized for two-level queries. The instance-level query vectors represent the global information of each architectural symbol, while the sub-contour-level query vectors represent the local information of the sub-contour, i.e., through the formula... , Indicates the first The first instance level The query vector for each sub-contour. Indicates the first Instance-level query vectors Indicates the first Sub-contour level query vector.

[0039] After performing a two-level query, decoupled self-attention computation is then performed. In the first stage, self-attention computation is performed only between sub-contour-level query vectors to learn local relationships between sub-contours, such as the connection between adjacent sub-contours. In the second stage, self-attention computation is performed only between instance-level query vectors to learn global relationships between architectural symbols, such as the positional relationship between doors, windows, and walls. Finally, deformable cross-attention computation is performed. Based on the outer bounding boxes of the sub-contours predicted in the previous layer, sampling offsets are generated. Local features are adaptively sampled from the preprocessed building image to be identified according to the offsets, and the sub-contour query vectors are updated based on the extracted local features to optimize the boundary point positions of the sub-contours, thus obtaining the optimized sub-contours. In other words, the iterative decoder performs sub-contour decomposition through curvature, the two-level query merges global and local information, and attention computation optimizes feature representation, resulting in more accurate sub-contours.

[0040] After obtaining the optimized sub-contour, a dual-parallel head prediction is performed on the sub-contour through a contour fine-grained distribution refinement layer to obtain the boundary point offsets of the optimized sub-contour. That is, the boundary point offsets of the optimized sub-contour are predicted using a single head. This refers to the positional correction of each sub-contour boundary point in the x and y directions. Another head generates the probability distribution of boundary point offsets to model the uncertainty of boundary point positions, such as the boundary offset probability of blurred wall lines. Specifically, a decoder is first used to perform coordinate regression processing on the optimized sub-contours to generate a base contour. For each boundary point in the base contour, the distribution over a discrete offset interval is predicted. and That is, the boundary point offset of the optimized sub-contour. This represents the distribution of the x-coordinates of the boundary points across the discrete offset interval. This represents the distribution of the ordinates of the boundary points across the discrete offset interval. This represents the offset interval index. Then, the residual distribution is updated, i.e., using the formula... Gradually sharpen the offset distribution. This represents the log-odds ratio estimated from the distribution of the previous layer. This indicates the residual adjustment for the current layer. This represents the log-odds ratio of the distribution estimate for the current layer. This represents a differentiable weighted function.

[0041] Finally, the optimized sub-contours undergo geometrically aware adaptation. This involves using the outer bounding box size of the sub-contour as a scaling factor to specifically adjust the boundary point offsets. For example, large-sized architectural symbols are adapted to larger offset ratios, and small-sized architectural symbols to smaller offset ratios, resulting in adjusted sub-contours. After obtaining the adjusted sub-contours, the output layer can stitch all the adjusted sub-contours together according to the original splitting order, forming a complete contour with N ordered boundary points. The layer then verifies the contour's closure, removes outliers, and generates vector polygons corresponding to each architectural symbol, along with their information. The vector polygon information includes boundary point coordinates, centroid coordinates, area, and other geometric information. N can be adaptively adjusted based on the complexity of the actual architectural symbols; this embodiment does not impose any limitations on this.

[0042] In this embodiment, the initial contour of the architectural symbol is accurately extracted by the image encoder in the vector polygon prediction model. The iterative decoder breaks down the complex contour into multiple sub-contours for independent optimization, which can specifically correct local contour defects. Combined with the dual-parallel head prediction of the boundary point offset in the fine-grained contour distribution refinement layer, and using the size of the sub-contour's bounding box as a scaling factor to adaptively adjust the offset, this effectively solves the geometric error problems such as rough contour boundaries, vertex offsets, and local deformations in existing vectorization techniques. This allows the output vector polygon to accurately match the true contour of the architectural symbol, providing high-fidelity input for the downstream symbol recognition model and significantly reducing the risk of misidentification due to input errors. Furthermore, for complex scenarios such as creases, smudges, blurred edges in scanned images, and non-orthogonal or curved irregular architectural symbols, the image encoder has powerful feature extraction capabilities, effectively filtering noise interference from the architectural image to be recognized. The independent sub-contour optimization mechanism focuses on the detailed features of each local contour, avoiding local distortion caused by overall contour optimization. The adaptive offset adjustment strategy of the fine-grained contour distribution refinement layer further reduces the positioning error in blurred boundary areas, solving the shortcomings of traditional vectorization methods in processing low-quality architectural images and complex-shaped symbols.

[0043] In step S130, the building image to be identified and the vector polygon are input into a pre-trained symbol recognition model to obtain the category of the building symbol output by the symbol recognition model.

[0044] The symbol recognition model includes a feature extraction layer, a feature fusion layer, a vector embedding layer, a neighborhood attention calculation layer, and a classification output layer. The feature extraction layer is connected to the feature fusion layer, the feature fusion layer is connected to the vector embedding layer, the vector embedding layer is connected to the neighborhood attention calculation layer, and the attention calculation layer is connected to the classification layer. The feature extraction layer extracts raster features, geometric features, and semantic features from the building image to be recognized and the vector polygon. The feature fusion module concatenates the raster features, the geometric features, and the semantic features to obtain fused features. The vector embedding layer maps the fused features to a shared feature space and normalizes the mapping results to obtain embedded features. The neighborhood attention calculation layer associates the embedded features with a preset number of nearest embedded features to obtain local context features. The classification output layer maps the local context features to the category space of each building symbol to obtain the spatial relationship of the building symbols, maps the spatial relationship to probability for symbol classification, and outputs the category of the building symbol.

[0045] In this embodiment, refer to Figure 4 As shown, Figure 4 This is a schematic diagram of the internal structure of a symbol recognition model. In a preferred embodiment, the feature extraction layer includes a raster extraction module, a geometric information extraction module, and a semantic extraction module. Therefore, further, as an optional implementation, the feature extraction layer can adaptively extract raster features, geometric features, and semantic features from the building image and vector polygon to be recognized as follows: the raster extraction module extracts raster features from the building image and vector polygon to be recognized; the geometric information extraction module extracts geometric features from the vector polygon; and the semantic extraction module extracts semantic features from the building image and vector polygon to be recognized.

[0046] Specifically, in Figure 3 In this model, after receiving the input vector polygon and the building image to be identified, the symbol recognition model transmits the vector polygon and the building image to the feature extraction layer. The raster extraction module in the feature extraction layer combines raster modalities through convolutional components, layer normalization components, downsampling components, and convolutional blocks to gradually extract high-rise visual features from the building image and vector polygon. Combined with hybrid sampling, the model accurately samples the area where the building symbol is located in the building image to be identified. The geometric multi-scale and multi-position sampling method ensures that the features corresponding to the building symbol are completely captured, avoiding the omission of key visual details, so as to provide high-quality raster features for subsequent multimodal feature fusion.

[0047] The geometric feature extraction module extracts structural features from vector polygons through the geometric modality component and extracts geometric features from the polygons corresponding to architectural symbols through the geometric attribute component. These two methods provide structural dimension feature support, i.e., geometric features, for subsequent multimodal feature fusion.

[0048] The semantic modality in the semantic extraction module is a component that processes the semantic information of architectural symbols in the building image to be identified. It is responsible for associating the correspondence between text and architectural symbols, and spatially associating the text information with the vector polygons of the corresponding architectural symbols through the text matching component. This enables the matching of text descriptions with architectural symbols, thereby obtaining semantic features such as the category and instance of architectural symbols, and helping to distinguish architectural symbols that are similar in shape but different in category.

[0049] After extracting raster, geometric, and semantic features, a feature fusion module concatenates these features to obtain fused features. Subsequently, a linear layer in the vector embedding layer performs dimensionality transformation on the fused features, mapping them to a shared feature space for format unification. After mapping the fused features to the shared feature space, layer normalization standardizes the mapping results output by the linear layer to stabilize the numerical range, prevent feature fluctuations from affecting ordered computation, and accelerate training convergence. Layer normalization of the mapping results yields element embeddings, which are multimodal comprehensive feature representations of individual architectural symbols. Position embeddings are added to these element embeddings to obtain fusion tokens, adding spatial location information corresponding to the coordinates of the architectural symbol in the architectural image, resulting in embedded features. This facilitates subsequent auxiliary neighborhood mechanisms to accurately select spatially adjacent architectural symbols.

[0050] The domain attention computation layer, based on the embedding features output by the vector embedding layer, combines the hyperparameters of the domain mechanism and the neighborhood mechanism (k=2, k=4, k=8, or k16) to select the k nearest embedding features corresponding to the embedding features, according to the geometric center of the vector polygon of the architectural symbol. Then, using the attention module of the domain mechanism, it calculates the attention weights of the k nearest embedding features, aggregating their feature information to obtain local context features. Finally, the local context features are transmitted to the classification output layer. The classification output layer maps the local context features to the category space of each architectural symbol to obtain the spatial relationship of the architectural symbols, maps the spatial relationship to probabilities for symbol classification, and outputs the symbol category of the architectural symbol.

[0051] It should be noted that there is a fundamental difference between the building images to be identified and natural images. In the planar images to be identified, the effective visual information such as building boundaries and outlines is almost entirely distributed along the boundary lines, the foreground building symbols only account for about 8% of the pixels in the building planar image, and a large area is a meaningless background.

[0052] Based on this, existing sampling methods mostly adopt a strategy of placing sampling points only at the center of building symbols or graphic elements, referring to Figure 5 As shown, Figure 5 This diagram illustrates setting sampling points at the midpoint and center of a vector polygon. The strategy of placing sampling points at the center of architectural symbols or primitives suffers from the problem of failing to cover local set variations within the architectural symbol boundary. Therefore, it struggles to capture detailed features of thin structures like railings and irregular contours like fan-shaped doors, leading to a decrease in the accuracy of downstream architectural symbol recognition. Therefore, to improve the accuracy of downstream architectural symbol recognition, further, as an optional implementation method, refer to... Figure 6 As shown, Figure 6 This is a flowchart illustrating the process of extracting raster features from an image of a building to be identified and a vector polygon, specifically including: In step S610, the image of the building to be identified is converted into a 4-level multi-scale feature map using an image encoder.

[0053] In step S620, using bilinear interpolation and the vector polygon, boundary points corresponding to the building symbols are extracted from the 4-level multi-scale feature map to obtain a set of boundary points.

[0054] In step S630, the boundary point set is subjected to one-dimensional max pooling to obtain a one-dimensional feature representation.

[0055] In step S640, a rotational region of interest for the architectural symbol is constructed based on the geometric information of the vector polygon.

[0056] The geometric information includes the center coordinates, original width, original height, and rotation angle of the vector polygon corresponding to the architectural symbol.

[0057] In step S650, the region feature map corresponding to the building symbol is determined from the 4-level multi-scale feature map using the region of interest of the building symbol.

[0058] In step S660, the region feature map is converted into a one-dimensional feature vector.

[0059] In step S670, the one-dimensional feature vector and the one-dimensional feature representation are concatenated to obtain the raster feature.

[0060] In this embodiment, HRNet can be used as the image encoder. The image encoder is designed with four cascaded branches, each corresponding to a fixed downsampling factor. The channel widths corresponding to the four fixed downsampling factors are respectively That is, for example, the downsampling factor This means that the width and height of the building image to be identified are both reduced to 1 / 4 of their original values.

[0061] Specifically, after acquiring the building image to be identified back, This indicates the width of the building image to be identified. This indicates the height of the building image to be identified. Input the image encoder to obtain a 4-level multi-scale feature map output by the image encoder, where each scale feature map... , Indicates the first Multi-scale feature maps of different levels, with spatial dimensions of each level being [missing information]. , , Indicates the first The height of the multi-scale feature map. Indicates the first The width of the multi-scale feature map.

[0062] After obtaining the 4-level multi-scale feature map of the building image to be identified, the architectural symbols are targeted. , refer to Figure 7 and Figure 8 As shown, Figure 7 A flowchart illustrating the raster feature extraction process. Figure 8 This diagram illustrates the process of dense boundary point sampling. First, the outline of the building symbol in the level 4 multi-scale feature map is determined using the vector polygon of the building symbol. Boundary sampling is then performed along this outline to obtain the boundary points of the building symbol. Finally, a boundary point set is constructed using these boundary points. , This represents the total number of boundary points. Indicates the first A boundary point, This represents the set of boundary points. After obtaining the set of boundary points for the architectural symbol, bilinear interpolation can be used to calculate the boundary point features of each boundary point, and these features can be used to construct a boundary point feature set. , , Indicates the first Boundary point features of each boundary point Indicates step size is Scale feature map, This represents the feature set of boundary points.

[0063] After obtaining the boundary point feature set, the boundary points can be evenly divided into M groups, with each group containing N / M boundary point features. Then, one-dimensional max pooling is performed on the boundary point features in each group to obtain the aggregated features for each group. , , Indicates the first Group aggregation characteristics Indicates the first The set of boundary point features of the group express Features of individual boundary points in a group This represents the global boundary aggregated feature matrix, i.e., the aggregated features of all groups. A one-dimensional feature representation formed by splicing.

[0064] After obtaining the one-dimensional feature representation of each architectural symbol, to provide supplementary internal context, rotational RolAlign can be applied to perform region sampling on the rotated region of interest of each architectural symbol to extract fixed-resolution features of that region, referring to... Figure 9 As shown, Figure 9 This is a schematic diagram illustrating supplementary coarse-grained region sampling. First, the original width and height of the vector polygon corresponding to the architectural symbol are increased by a factor of 1.1 along the X and Y axes, respectively, resulting in new widths and heights. Then, the region of interest is constructed using the center coordinates of the vector polygon corresponding to the architectural symbol, the new width, the new height, and the rotation angle. , Indicates the region of interest to be rotated. Indicates the center coordinates, Indicates the new width. This signifies a new level of achievement. This represents the rotation angle. The rotation angle can be the angle between the longer side of the minimum area bounding rectangle of the architectural symbol and the horizontal axis of the image of the building to be identified.

[0065] After obtaining the rotational region of interest for the architectural symbol, the corresponding multi-scale feature map can be selected based on the symbol's size. For example, for architectural symbols corresponding to narrow windows and thin railings, a low-resolution feature map can be selected. Value format feature map, select the architectural symbol height corresponding to the entire wall and large balcony opening. Value grid feature map. After determining the corresponding multi-scale feature map, it can be called... function based on Sampling is performed on the grid feature map, i.e., using the rotation angle. By selecting the tilted sampling region and performing pooling on the region, a region feature map is obtained. , Represents the feature map of the region. Indicates the pooling space range. The fixed spatial resolution is The channel dimension is , .

[0066] The region feature map is then flattened, expanding it along the spatial dimension (7×7) into a 49×D one-dimensional feature vector. Finally, the one-dimensional feature representation and the one-dimensional feature vector are concatenated to obtain the raster feature. , Represents raster features, It can simultaneously encode the boundary details and global information of architectural symbols. This represents a one-dimensional eigenvector.

[0067] In this embodiment, the raster feature extraction module, when extracting raster features, leverages the precise contour guidance of vector polygons and uses bilinear interpolation to densely extract the set of boundary points of architectural symbols from the 4-level multi-scale feature map. This effectively compensates for the insufficient coverage of local geometric changes at the boundaries of architectural symbols by traditional center sampling or sparse sampling, thereby accurately capturing the fine texture and contour features of architectural symbol boundaries. One-dimensional max pooling is then applied to the boundary point set to aggregate key boundary information and filter redundant noise, resulting in a compact one-dimensional boundary feature representation, providing a core basis for distinguishing architectural symbols with similar shapes. Simultaneously, a rotational region of interest (ROI) is constructed based on the geometric information of the vector polygons, ensuring that the ROI accurately fits the contour of the architectural symbol in its rotated state. This addresses the shortcomings of traditional axis-aligned ROIs, which often contain background noise or fail to cover the entire rotated symbol, thus ensuring that subsequent extraction of higher purity and more targeted regional feature maps from the 4-level multi-scale feature map. After extracting the regional feature map, the regional feature map is converted into a one-dimensional feature vector and concatenated with the one-dimensional feature representation of the boundary features. This achieves a deep fusion of the local details of the boundary and the global context of the region. It not only preserves the fine visual cues that distinguish the categories of architectural symbols, but also has the support to resist local blurring and artifacts, which significantly improves the representational integrity and discriminative power of the raster features.

[0068] Furthermore, as an optional implementation method, refer to Figure 10 As shown, Figure 10 This is a flowchart illustrating the process of extracting geometric features from a vector polygon. The specific steps include: In step S1010, based on the geometric information of the vector polygons of each building symbol, the outline features, orientation features, aspect ratio features, quantized area, and quantized perimeter of the building symbol are determined. In step S1020, the contour feature, the orientation feature, the aspect ratio feature, the quantized area, and the quantized perimeter are spliced ​​together to obtain the geometric feature.

[0069] Specifically, refer to Figure 11 As shown, Figure 11This is a flowchart illustrating the process of acquiring geometric features, focusing on the vector coordinates of the geometric information of a vector polygon, specifically the coordinates of the boundary points that constitute the vector polygon. , Indicates the first The coordinates of the boundary points Represents the set of boundary points. This represents the total number of boundary points. The area of ​​the vector polygon can be calculated using the coordinates of the boundary points. Then, using the center coordinates, area, and coordinates of each boundary point, the boundary points are centered and their scale normalized to eliminate positional and scale differences, thus obtaining the contour features of the vector polygon. , , This indicates the result after centering and scale normalization. The coordinates of the boundary points Indicates the first The original coordinates of the boundary points Represents the area of ​​a vector polygon. Represents contour features.

[0070] Furthermore, to facilitate the distinction between narrow openings and wide spans in architectural symbols and to provide a compact measurement of shape, the area and perimeter of vector polygons can be quantified to obtain quantified area and quantified perimeter, i.e. , , Indicates the quantified area. This represents the average area of ​​architectural symbols belonging to the same category as architectural symbols. This represents the quantized perimeter. Indicates the perimeter of the architectural symbol. This represents the average perimeter of architectural symbols belonging to the same category as architectural symbols.

[0071] To supplement the geometric information of the vector polygon outline and improve the accuracy of subsequent architectural symbol category recognition, the tangent angle of each boundary point in the vector polygon outline of the architectural symbol can be calculated, and the tangent angle of each boundary point can be mapped to a unit interval to obtain the directional features of the boundary points. , Indicates the first The directional characteristics of each boundary point , A set representing the directional characteristics of boundary points.

[0072] In geometric features, the anisotropy of vector polygon shapes can be quantified using ratios to distinguish between slender architectural symbols and those closer to isodimensional shapes. This involves fitting the minimum area boundary rectangle of the architectural symbol, calculating the ratio of its horizontal to vertical extent, and obtaining the aspect ratio of the architectural symbol. , Indicates the aspect ratio. This represents the larger of the horizontal and vertical ranges of the minimum area boundary rectangle. This represents the smaller of the horizontal and vertical ranges of the minimum area bounding rectangle. For example, walls are typically represented by slender rectangular symbols with a high aspect ratio, while doors tend to have a fan-shaped geometry with an aspect ratio close to 1.

[0073] Finally, the geometric properties of the vector polygon are combined, namely, contour features, orientation features, aspect ratio features, quantized area, and quantized perimeter, to obtain the geometric features. , Representing geometric features, Among them, geometric features, as a discriminative morphological measurement representation, can provide richer geometric information for downstream architectural symbol recognition, and can be used to distinguish heterogeneous architectural symbols.

[0074] In this embodiment, based on the vector polygon of the architectural symbol, five core dimensions of features are accurately extracted: contour features, orientation features, aspect ratio features, quantized area, and quantized perimeter. Contour features, through centering and area standardization of the boundary point coordinates of the vector polygon, preserve the essential morphological clues of the architectural symbol, unaffected by drawing scale. Orientation features, by encoding the tangent direction of the boundary points and mapping it to a unit interval, generate dimensionless features, effectively supplementing the information on the directional changes of the contour geometry, helping to distinguish symbols of different shapes such as rectangles and sectors. Aspect ratio features quantify the shape anisotropy of the architectural symbol, quickly distinguishing between categories such as slender walls and near-isodimensional shapes like doors. Quantized area and quantized perimeter, calculated as ratios to the average area and average perimeter of the corresponding category of architectural symbols, eliminate scale interference from different drawing specifications, providing a stable measure of shape compactness. Subsequently, the five types of features are spliced ​​and fused to form a comprehensive morphological measurement representation, which can comprehensively cover the geometric attributes of the architectural symbol, overcoming the shortcomings of existing technologies that rely on single geometric features for limited representation. This ensures that geometric features include not only position and shape information but also key discriminative clues such as orientation and scale. Meanwhile, all features are standardized to generate dimensionless representations, which ensures that subsequent geometric features, raster features, and semantic features can be efficiently fused into the shared embedding space, avoiding fusion failure caused by feature dimension or unit difference.

[0075] Furthermore, as an optional implementation method, refer to Figure 12 As shown, Figure 12 This is a flowchart illustrating the process of extracting semantic features from images of buildings to be identified and vector polygons, specifically including: In step S1210, index text and functional text are extracted from the building image to be identified.

[0076] The index text is directly associated with the category of the architectural symbol, and the functional text is associated with the spatial function of the architectural symbol.

[0077] In step S1220, the Euclidean distance between the index text and the vector polygon is calculated based on the center coordinates of the index text in the image of the building to be identified and the center coordinates of the vector polygon in the image of the building to be identified.

[0078] In step S1230, the index text with the smallest Euclidean distance is taken as the target index text of the vector polygon, and the target index text is converted into a OneHot vector.

[0079] In step S1240, the functional text is bound to the polygonal region containing the functional text to obtain a region label.

[0080] In step S1250, the region label is mapped to the vector polygon constituting the polygon region to obtain the mapping relationship between the vector polygon and the functional text.

[0081] In step S1260, the mapping relationship between the vector polygon and the functional text is converted into a MultiHot vector.

[0082] In step S1270, the OneHot vector and the MultiHot vector are concatenated to obtain the semantic features.

[0083] Specifically, the semantic extraction module can extract all visible text content from the building image to be identified using the open-source PaddleLeOCR detector, referring to... Figure 13 As shown, Figure 13 This is a schematic diagram of the text information in the building image to be identified, recording the original string and center coordinates of each text content. Then, based on the format and function of the original strings, they are classified into functional text and index text. Index text consists of letter data strings conforming to the category-ID pattern, such as W-1, D-2, used to uniquely identify individual building symbols; functional text consists of descriptive terms describing the use of space, such as bedroom, kitchen, which need to be matched and confirmed against a predefined functional vocabulary.

[0084] For each indexed text, iterate through the text and calculate the Euclidean distance between it and the vector polygon in the image of the building to be identified, based on the indexed text's center coordinates and the vector polygon's center coordinates in the same image. , This represents the Euclidean distance between the indexed text and the vector polygon. Represents the Euclidean norm. Indicates the first The center coordinates of the indexed text Indicates the first The center coordinates of a vector polygon are used to find the coordinates relative to the index text using Euclidean distance. Recent vector polygons Establish a one-to-one matching relationship between indexed text and vector polygons, and encode the matching results as OneHot vectors, i.e. When the index text matches the vector polygon, the corresponding vector polygon component is set to 1, and the other components are all 0. If the vector polygon does not have a corresponding index text, the vector is all 0.

[0085] For each function text, The region is associated with the polygonal region containing the functional text to obtain a region label, which determines whether the functional text is inside the polygonal region. The region label is then propagated to all vector polygons contained within or adjacent to the polygonal region's boundary, mapping the region label to the vector polygons constituting the polygonal region, thus obtaining a mapping relationship between vector polygons and functional text. The correspondence between a single vector polygon and functional text is one-to-many. This mapping relationship between vector polygons and functional text is then converted into a MultiHot vector. , This indicates an indicator function, meaning it returns 1 if the condition within the parentheses is true, and 0 otherwise. The first item in the functional vocabulary A tag, Representation of vector polygons The associated set of area labels, if the building symbol If there is no corresponding functional text, the corresponding subvector is an all-zero vector.

[0086] Finally, the OneHot vector and MultiHot vector of each vector polygon are concatenated to obtain the semantic features, i.e. , Represents semantic features, , This indicates the size of the indexed text's vocabulary. Indicates the size of the vocabulary for the functional text.

[0087] In this embodiment, index text and functional text are accurately separated from the building image to be identified, and the category identification attribute of the index text and the spatial functional attribute of the functional text are clearly defined, avoiding semantic misleading caused by the confusion of text types in traditional methods. Simultaneously, the Euclidean distance between the center coordinates of the index text and the vector polygon is calculated, and the index text with the smallest distance is used as the target index text of the vector polygon, establishing a one-to-one precise matching relationship between text and vector. This completely solves the problems of existing methods relying on empirical rules for text matching and being easily interfered with by the dense distribution of architectural symbols, ensuring accurate binding between category identification and architectural symbols. Furthermore, functional text is bound to the polygon region containing it to generate region labels, and then the region labels are mapped to the vector polygons constituting the polygon regions, constructing a mapping relationship between vector polygons and functional text. This can cover the spatial functional association of architectural symbols, making up for the deficiency that a single text type can only represent local semantics. Finally, the OneHot vector and MultiHot vector are concatenated to obtain complete semantic features that combine category identification and spatial function, ensuring the unique category clue of the vector polygon of a single architectural symbol while incorporating the spatial functional context, making the semantic feature representation more comprehensive.

[0088] After obtaining the raster features, geometric features, and semantic features, the feature fusion module concatenates the raster features, geometric features, and semantic features along the feature dimensions to obtain the fused feature, i.e. ,in, Indicates fusion characteristics, , , Subsequently, for the fused features, the vector embedding layer can use a learnable linear projection. The fused features are mapped to a shared feature space, and layer normalization (LN) is performed to eliminate numerical differences between features, resulting in embedded features, i.e. , Represents embedded features, Representation layer normalization, This indicates a learnable linear projection.

[0089] It is worth noting that the core structural relationships in architectural images are concentrated in local neighborhoods. For example, doors and windows are necessarily bound to adjacent walls, and architectural symbols within a room have functional relationships with architectural symbols within the same area. However, architectural symbols located far apart, such as doors and windows in the living room and walls in the bedroom, have almost no interactive value. Therefore, to avoid indiscriminately calculating the relationships between all architectural symbols, which would lead to irrelevant information interfering with effective feature learning, and to allow the model to focus on meaningful spatial relationships, further, as an optional implementation method, refer to... Figure 14 As shown, Figure 14 The flowchart for the domain attention computation layer, which associates embedded features with a preset number of nearest embedded features to obtain local context features, specifically includes: In step S1410, the embedded features are stacked with the preset number of nearest embedded features to obtain a local feature matrix.

[0090] In step S1420, the local feature matrix is ​​projected to generate a query matrix, a key matrix, and a value matrix for multi-head attention.

[0091] In step S1430, the one-dimensional relative position offset between any two building symbols in the local feature matrix is ​​calculated.

[0092] In step S1440, a relative position offset matrix is ​​constructed using the one-dimensional relative position offset.

[0093] In step S1450, the output features of the corresponding attention head are determined using the relative position offset matrix, the query matrix, the key matrix, and the value matrix.

[0094] In step S1460, the output features of all attention heads are spliced ​​together to obtain the spliced ​​head output features.

[0095] In step S1470, the head output features are projected onto the output space to obtain the local context features.

[0096] Specifically, refer to Figure 15 As shown, Figure 15 To determine the preset number of nearest embedded features, for each building symbol, it iterates through each building symbol, calculates the Euclidean distance between the geometric center of the vector polygon of that building symbol and the geometric centers of the vector polygons of all other building symbols, and sorts all other building symbols in ascending order based on the Euclidean distance. Then, it selects the preset number of building symbols with the smallest distance. For example, it selects the building symbols with the smallest distance... Each building symbol is represented by a nearest neighbor index set. , , Represents the nearest neighbor index set of architectural symbols. This represents the total number of architectural symbols in an architectural image. This means iterating through all non-contained elements. And the base number is fixed. A subset of candidate indices architectural symbols The geometric center, architectural symbols The geometric center.

[0097] Subsequently, regarding architectural symbols Embedding features This can be used as a query vector for a local set, and will be related to architectural symbols. The embedding features of the corresponding building symbols in the nearest neighbor search set are used as neighborhood vectors. The query vector and the neighborhood vectors are stacked along the dimension of the building symbols to form a local feature matrix, i.e. , architectural symbols The local feature matrix, Indicates the first A building symbol , This represents the set of embedded features of the nearest neighbor search set. Represents the potential spatial dimension.

[0098] After obtaining the local feature matrices, initialize H groups of learnable projection matrices, with each group having a dimension of 1. , , This represents the feature dimension of a single head. This represents the total feature dimension in the self-attention mechanism, which is the sum of the dimensions of all attention heads in multi-head self-attention. , This represents the total number of attention heads. For the local feature matrix of each architectural symbol, projection can be performed head-by-head to obtain the query matrix, key matrix, and value matrix of the multi-head attention mechanism. , , , It is the first Projection matrix of each head, Indicates the first Each head dimension is Query matrix Indicates the first Each head dimension is The key matrix Indicates the first Each head dimension is The value matrix.

[0099] Furthermore, for each architectural symbol in the local feature matrix, based on the geometric center of the vector polygon of each architectural symbol, the one-dimensional relative positional offset between any two architectural symbols is determined, i.e. , , Indicates the first The architectural symbol and the first The relative positional offset between the architectural symbols Represents a local row index Mapped to the global building symbol index, Represents a local row index Mapped to the global building symbol index, Represents a global index The geometric center of the corresponding architectural symbol Represents a global index The geometric center corresponding to the architectural symbol, and Indicates linear projection. Indicates will The conversion from two-dimensional to one-dimensional scalar bias, i.e., one-dimensional relative position offset, and according to Build , The dimension is Relative position offset matrix.

[0100] Subsequently, using the relative position offset matrix, the first... Attention score of the first head and the first head The normalized weights corresponding to each head, i.e. , , Indicates the first Normalized attention weights for each head, Indicates the first The unnormalized attention score of each head, for The transpose of the matrix, This represents the scaling factor, from which the attention weights of each head are obtained, and the output features of each attention head are determined using these attention weights. , Indicates the first The output features of each attention head are then processed. Finally, the output features of all heads are concatenated to obtain the concatenated head output features. A linear transformation is then performed on the concatenated head output features using a projection matrix to obtain the local context features, i.e. , This represents the output features of the concatenated header. Represents the global projection matrix. Represents local contextual features.

[0101] The local context features include the target core features corresponding to the architectural symbols and the auxiliary features corresponding to the embedding features of the k nearest neighbors. The target core features are the fusion features of the multimodal basic attributes and local association information of the architectural symbols, and the auxiliary features are the key association clue features of the k nearest neighbor architectural symbols of the architectural symbols.

[0102] Finally, the classification output layer maps local contextual features to the category space of each architectural symbol, obtaining the spatial relationships between the architectural symbols, and then performs linear transformation and... The activation maps spatial relationships to probabilities for symbol classification and outputs the category of architectural symbols.

[0103] In this embodiment, the embedded features of architectural symbols are stacked with the embedded features of a preset number of nearest neighbors to form a local feature matrix. By constraining the attention interaction range to spatially adjacent architectural symbols, it accurately matches the local topological dominant structural features in the architectural image, such as the dependency relationship between doors / windows and adjacent walls. This avoids the interference of irrelevant information caused by the indiscriminate calculation of all architectural symbols by traditional self-attention mechanisms, and reduces the computational complexity from... Down to , The total number of architectural symbols, First, by increasing the number of nearest neighbors, the efficiency of subsequent processing is improved. Second, by constructing a local feature matrix through embedded feature stacking, rather than fine-grained primitive-level processing, the label inconsistency caused by segmenting the same architectural symbol into multiple primitives can be effectively avoided, balancing sampling density and semantic expressiveness, and ensuring feature consistency for the same architectural symbol. Third, by calculating the one-dimensional relative position offset between any two architectural symbols in the local feature matrix and constructing a relative position offset matrix, the spatial orientation relationship of architectural symbols within the local area is explicitly modeled. This avoids the shortcomings of traditional attention mechanisms that rely solely on similarity and ignore positional information, making attention allocation more aligned with the spatial layout logic of architectural symbols and significantly improving the discriminative power of features. For example, relative position offset can accurately distinguish the scene difference between a door on the left side of a wall and a door on the right side of a wall. Finally, the local feature matrix is ​​used to generate a query matrix, key matrix, and value matrix for multi-head attention through a projection matrix. The outputs of each attention head are calculated and concatenated by combining the relative position offset matrix, and then projected onto the output space. This not only captures the multi-dimensional correlation information of the local context through multi-head attention, but also enables efficient collaboration of the embedded features after multimodal fusion by projecting the same feature dimension, avoiding fusion failure due to feature differences.

[0104] It should be noted that the frequency of different categories of architectural symbols varies significantly in architectural images, exhibiting severe category discrepancies. For example, basic architectural symbols such as walls and windows have a very high proportion, while architectural symbols such as railings and special openings have a very low proportion. To avoid the symbol recognition model biasing towards high-frequency categories, further, as an optional implementation method, refer to... Figure 16 As shown, Figure 16 This is a schematic diagram of the training process for the symbol recognition model. Before step S130, the following steps are also included: In step S1610, the training dataset is obtained.

[0105] The training dataset includes sample building images and their corresponding labels, and the labels corresponding to the sample building images include the categories of building symbols in the sample building images.

[0106] In step S1620, the training data samples are input into the initial symbol recognition model to obtain the recognition results of the building symbol categories output by the initial symbol recognition model.

[0107] In step S1630, the loss between the recognition result and the label is quantified using balanced cross-entropy loss.

[0108] In step S1640, the model parameters of the initial symbol recognition model are updated using the loss until the loss is less than a preset threshold, and the initial symbol recognition model with a loss less than the preset threshold is used as the symbol recognition model.

[0109] Specifically, the training dataset can be stored locally on the electronic device so that, during step S1510, the electronic device can directly access the training dataset from the local storage and input the training data samples from the training dataset into the initial symbol recognition model to obtain the recognition results of the architectural symbol categories output by the initial symbol recognition model. Subsequently, the loss between the recognition results and the labels is quantified using balanced cross-entropy loss, i.e. , Indicates losses within the batch. This indicates the total number of building symbols in the batch. This represents the total number of categories for symbol recognition. Indicates the first Class weight factor Labels indicate architectural symbols Category The value is 1 if it is 1, otherwise it is 0. architectural symbols Category Predicted probability, loss It's the command stick for parameter adjustment— The larger the value, the greater the deviation between the prediction and the actual value, requiring a larger adjustment of the parameters. Finally, the probability of the symbol recognition model is adjusted using the loss until the loss is less than the preset threshold, and the initial symbol recognition model with a loss less than the preset threshold is used as the symbol recognition model.

[0110] In this embodiment, using architectural images and their corresponding architectural symbol categories as labels provides accurate supervision signals for the initial symbol recognition model, ensuring direct alignment between the training objective and the symbol recognition task. Simultaneously, training data is input into the initial symbol recognition model to obtain its output recognition results. The loss between the recognition results and labels is quantified using balanced cross-entropy loss. Furthermore, a category weight factor is introduced into the balanced cross-entropy loss, which is essentially the inverse frequency set for each category in the training data. This enhances the loss contribution of minority class symbols, addressing the problem of traditional cross-entropy loss's over-biasing towards majority class architectural symbols, leading to low recognition efficiency for minority class symbols. This ensures that the initial symbol recognition model equally focuses on feature learning for each category of architectural symbols during training, achieving accurate recognition with balanced architectural symbol categories.

[0111] In addition, the raster features in this embodiment can represent the visual texture and edge details of architectural symbols, the geometric features can characterize the shape, size, and spatial outline of architectural symbols, and the semantic features can extract the category attributes of architectural symbols from text annotation information. A feature extraction layer simultaneously extracts raster features, geometric features, and semantic features from the architectural image to be identified and the vector polygon. A feature fusion layer splices the raster features, geometric features, and semantic features, achieving deep integration of heterogeneous features through splicing. This allows for complementary representation of architectural symbols from different dimensions, compensating for the limitations of single-modal information and providing a comprehensive basis for classifying architectural symbols. For the embedded features of the fused features, a domain attention calculation layer associates the embedded features with a preset number of nearest fused features, constructing a local contextual relationship between the current architectural symbol and surrounding architectural symbols. This provides additional constraints for architectural symbol recognition, reduces the confusion rate of similar symbols, and makes the recognition results more consistent with the actual design logic of the architectural floor plan, thereby improving the accuracy of architectural symbol recognition.

[0112] To verify the performance of the symbol recognition model in this embodiment, it was evaluated on two datasets and benchmarked against CADTransformer and SymPoint, two mainstream paradigms for panoramic architectural symbol recognition. The former embeds instances through neighborhood inference of visual features, while the latter discards the original image and trains and infers based solely on instance geometry. Compared to these methods, the proposed method in this embodiment has three significant features: First, it shifts architectural symbols from decomposed primitives to vector polygons, enabling the handling of complex shapes while avoiding the oversegmentation and label conflicts inherent in primitive-level representations; functionally, vector polygons can also be naturally integrated with existing vectorization pipelines. Second, inspired by SymPoint, it adds geometric features in addition to sampled raster features, and polygon-level operations allow for a richer set of shapes, enhancing shape perception capabilities for heterogeneous drawing styles. Finally, raster features, geometric features, and semantic features extracted from text annotations form fused features, providing richer evidence for panoramic architectural symbol recognition. The design retains the neighborhood reasoning and appearance cues unique to CADTransformer, while inheriting the geometric robustness of SymPoint and aligning the representation with the polygon-centric downstream workflow.

[0113] In terms of implementation details, the evaluation mainly considers two recognition scenarios: the first is a pure architectural symbol recognition pipeline that predicts the category of architectural symbols from vector polygon inputs; the second is a vector polygonization pipeline that integrates the architectural symbol recognition network with a polygon regression model to form an end-to-end workflow, thereby enabling evaluation under predicted geometric conditions that may contain noise.

[0114] At the level of the auxiliary vector polygonization model, in order to evaluate the performance in predicting vector polygon scenes, the building symbol recognition network is integrated into the PolySnake framework, which directly regresses the boundary polygons, thus eliminating the need for a segmentation-vectorization conversion step.

[0115] For the datasets used, refer to Table 1. Table 1 summarizes the two datasets used in this embodiment and lists the number of samples, the total number of architectural symbols, the range of spatial dimensions, the density of architectural symbols, and the irregularity rate reflecting the proportion of non-orthogonal or curved elements.

[0116] Table 1

[0117] The CubiCasa5K dataset contains architectural images of 5,000 residences, stored in a scalable vector graphics format. The dataset is divided into 4,200 training images, 400 validation images, and 400 test images. Due to its source and density of architectural symbols, the irregularity rate is relatively moderate at 24%.

[0118] To evaluate performance under more complex and realistic conditions, the Comprehensive Floor Plan (CFP) dataset was also used. The CFP dataset contains 1,062 scanned floor plans sourced from complex architectural projects such as villas, shopping malls, and public facilities. The dataset is divided into 800 training images, 100 validation images, and 162 test images. Compared to CubiCasa5K, CFP has a higher density of architectural symbols and contains artifacts introduced during physical processing and digitization (such as creases, smudges, slight tilting, and local geometric distortions). These factors increase the overall geometric complexity, with the irregularity rate rising to 32%, reflecting the greater prevalence of challenging non-orthogonal structures in this dataset.

[0119] When assessing the accuracy of architectural symbol recognition, quantitative evaluation follows the Panoramic Quality (PQ) index to evaluate the accuracy of architectural symbol recognition.

[0120] When evaluating the accuracy of architectural symbol recognition, predefined real vector polygons are used to compare the proposed method with CADTransformer and SymPoint. In the ideal scenario where architectural symbol boundaries are perfectly aligned, the SQ (Score Quotient) of all methods is 100%. Therefore, the PQ (Proportional Quotient) of all reported scores equals the RQ (Representative Quotient), making PQ a direct measure of the accuracy of successfully classifying architectural symbols.

[0121] Quantitative results on the CubiCasa5K and CFP datasets are summarized in Table 2. In the CubiCasa5K evaluation, the proposed method achieved a PQ of 98.68%, which is 0.81 percentage points higher than CADTransformer and 17.37 percentage points higher than SymPoint. This dataset has a uniform drawing specification and relatively low complexity, so raster feature-aware methods, including the proposed method in this embodiment and CADTransformer, achieved similar high accuracy. In contrast, SymPoint relies solely on geometric features, resulting in significantly lower performance because some architectural symbols may have similar shapes but different textures and functions. The CFP dataset is more challenging, with larger floor plans, higher symbol density, and wider style variation, leading to a decrease in scores for all methods. Even under these conditions, the proposed method in this embodiment maintains a significant advantage, achieving a PQ of 93.59%, which is 12.48 percentage points higher than CADTransformer and 13.67 percentage points higher than SymPoint. This comparison shows that the symbol recognition model in this embodiment is highly robust to artifacts in real-world scenes such as creases and scanning distortion, highlighting the advantages of integrating raster features, geometric features, and semantic features.

[0122] Table 2

[0123] At the benchmark level on predicted vectors, in order to evaluate the method of this embodiment in real-world scenarios using predicted vector polygons, a cascaded pipeline integrating planar graph vectorization and symbol recognition modules is used to evaluate their overall effectiveness.

[0124] See Figure 17 As shown, Figure 17 This is a schematic diagram comparing the geometric degradation of the predicted polygon vector and the reference polygon vector. Figure 17 The differences in predicted vector polygons are visually demonstrated. Although the vector polygons generated by PolySnake are generally correct, subtle degradation is observed at the boundaries. These boundary defects pose an additional challenge to downstream symbol recognition algorithms, potentially leading to misclassification and decreased accuracy.

[0125] Table 3 presents a comparative analysis of the three methods on these vector polygons. To establish a performance benchmark, the Upper Bound metric is defined as the theoretically maximum performance achievable under the polygon prediction conditions of the PolySnake model. This metric assumes 100% classification accuracy for the detected polygons, providing a relative reference for evaluating downstream symbol recognition methods. On the CubiCasa5K dataset, the PQ of the method in this embodiment reaches 74.99%, only 2.2 percentage points away from the theoretical maximum performance. This result significantly outperforms SymPoint (18.45 percentage points higher) and surpasses the competing method CADTransformer (0.83 percentage points higher). Although the vectorization quality of the CubiCasa5K dataset is high, SymPoint appears to be susceptible to perturbations. In contrast, both CADTransformer and the proposed method in this embodiment incorporate raster features, providing crucial context for category inference. As the scene shifts to the more complex CFP dataset, the Upper Bound PQ score drops to 66.23%, indicating that noise and perturbations pose a greater challenge. Nevertheless, the proposed method in this implementation demonstrates robustness, achieving a PQ of 65.32%, close to the upper limit, with a difference of only 0.91 percentage points. This result outperforms CADTransformer by 9.47 percentage points and SymPoint by 13.22 percentage points on this more challenging benchmark.

[0126] Table 3

[0127] At the ablation study level, CADTransformer was used as the baseline because it has the same backbone network, facilitating controlled and fair comparisons. When all modal channels and sampling mechanisms were disabled, the architecture degraded to the baseline configuration. Gradually enabling modalities resulted in continuous performance improvements in both predefined vector and predicted vector scenarios, as shown in Table 6.

[0128] Table 6

[0129] First, the effectiveness of raster hybrid sampling was evaluated by integrating dense boundary features and coarse-grained regional context. On predefined vectors, PQ improved from 81.11% to 84.19%; on predicted vectors, PQ improved from 55.85% to 58.53%. The gains were more significant on predicted vectors where coordinate noise and topological inconsistencies were prevalent, supporting the intuition that architectural image evidence tends to concentrate on boundaries. Dense boundary sampling preserves the fine geometry required for narrow structures, while regional information provides stable priors, mitigating the effects of local jitter and small gaps.

[0130] Introducing geometric features into the raster representation further improves the PQ (Problem-to-Q) ratio on predefined vector polygons from 84.19% to 87.78%; in the prediction scene, the PQ ratio increases from 58.53% to 60.67%. Although the predicted geometry may contain noise, the aggregated geometric descriptors still contain information and continue to improve classification accuracy.

[0131] Finally, by incorporating semantic features into raster and geometric features, the PQ on predefined vector polygons was improved from 87.78% to 93.59%, and the PQ on predicted vector polygons was improved from 60.67% to 64.68%. In modern, well-formatted plots, semantic cues are relatively stable and are particularly helpful in eliminating ambiguity in shape similarity categories by providing intuitive, textual evidence, thus informing the decision-making process.

[0132] See Figure 18 As shown, Figure 18 This diagram illustrates a comparison between (a) baseline failure under high visual similarity and (b) the output of the method proposed in this embodiment. Figure 18 A typical case is illustrated. Despite a simple layout, the baseline misclassifies a sliding door as a window. This error stems from contour similarity and shared local evidence within the wall-defined opening. The proposed model in this embodiment assigns the correct label by fusing additional textual annotations with geometric cues from the polygonal neighborhood. Semantic signals provide a strong category prior and resolve ambiguities remaining after geometric and relational reasoning.

[0133] Meanwhile, this embodiment also provides an electronic device, referring to Figure 19As shown, Figure 19 This is a schematic diagram of the structure of an electronic device, which includes: One or more processors; A memory having stored one or more computer programs that, when executed by one or more processors, cause the one or more processors to implement the architectural symbol recognition method according to the first aspect of the invention.

[0134] The electronic device may also include one or more I / O interfaces connected between the processor and the memory, configured to enable information interaction between the processor and the memory.

[0135] Among them, the processor is a device with data processing capabilities, including but not limited to the central processing unit (CPU); the first memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically such as SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, enabling information exchange between the processor and the memory, including but not limited to the data bus (Bus).

[0136] In some embodiments, the processor, memory, and I / O interfaces are interconnected via a bus, and thus connected to other components of the computing device.

[0137] As a third aspect of the present invention, a computer-readable medium is provided, with reference to... Figure 20 As shown, Figure 20 This is a schematic diagram of the structure of a computer-readable medium on which a computer program is stored. When the computer program is executed by a processor, it implements the architectural symbol recognition method provided in the first aspect of this disclosure.

[0138] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. Accordingly, the computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can implement the methods of any of the above embodiments. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0139] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes, but is not limited to, the contents described in the accompanying drawings and the specific embodiments above. Any modifications that do not depart from the functional and structural principles of the present invention will be included within the scope of the claims.

Claims

1. A method for recognizing architectural symbols, characterized in that, include: Acquire an image of the building to be identified; wherein the image of the building to be identified includes geometric morphological information and text annotation information of the building symbols; Extract the vector polygon corresponding to the building symbol from the image of the building to be identified; The image of the building to be identified and the vector polygon are input into the symbol recognition model to obtain the category of the building symbol output by the symbol recognition model; The symbol recognition model includes a feature extraction layer, a feature fusion layer, a vector embedding layer, a neighborhood attention calculation layer, and a classification output layer. The feature extraction layer is connected to the feature fusion layer, the feature fusion layer is connected to the vector embedding layer, the vector embedding layer is connected to the neighborhood attention calculation layer, and the attention calculation layer is connected to the classification layer. The feature extraction layer extracts raster features, geometric features, and semantic features from the building image to be recognized and the vector polygon. The feature fusion module concatenates the raster features, the geometric features, and the semantic features to obtain fused features. The vector embedding layer maps the fused features to a shared feature space and normalizes the mapping results to obtain embedded features. The neighborhood attention calculation layer associates the embedded features with a preset number of nearest embedded features to obtain local context features. The classification output layer maps the local context features to the category space of each building symbol to obtain the spatial relationship of the building symbols, maps the spatial relationship to probability for symbol classification, and outputs the category of the building symbol.

2. The architectural symbol recognition method according to claim 1, characterized in that, The step of extracting the vector polygon corresponding to the architectural symbol from the image of the building to be identified includes: The image of the building to be identified is preprocessed to obtain a preprocessed image of the building to be identified; The preprocessed building image to be identified is input into the vector polygon prediction model to obtain the vector polygons output by the vector polygon prediction model corresponding to each building symbol. The vector polygon prediction model includes an image encoder, an iterative decoder, a fine-grained contour distribution refinement layer, and an output layer. The image encoder is connected to the iterative decoder, which is connected to the fine-grained contour distribution refinement layer, which is connected to the output layer. The image encoder extracts the initial contours corresponding to each building symbol from the preprocessed image of the building to be identified. The iterative decoder splits the initial contours into multiple sub-contours to obtain optimized sub-contours. The fine-grained contour distribution refinement layer predicts the boundary point offsets of each optimized sub-contour using dual parallel heads and adjusts the boundary point offsets using the outer border size of each sub-contour as a scaling factor to obtain adjusted sub-contours. The output layer stitches together all adjusted sub-contours to obtain vector polygons corresponding to each building symbol and outputs the vector polygons corresponding to each building symbol.

3. The architectural symbol recognition method according to claim 1, characterized in that, The feature extraction layer includes a raster extraction module, a geometric information extraction module, and a semantic extraction module. The feature extraction layer extracts raster features, geometric features, and semantic features from the building image to be identified based on the following steps: The raster extraction module extracts raster features from the building image to be identified and the vector polygon. The geometric information extraction module extracts geometric features from the vector polygon. The semantic extraction module extracts semantic features from the building image to be identified and the vector polygon.

4. The architectural symbol recognition method according to claim 3, characterized in that, The step of extracting raster features from the building image to be identified and the vector polygon using the raster extraction module includes: The image of the building to be identified is converted into a 4-level multi-scale feature map using an image encoder; Using bilinear interpolation and the vector polygon, boundary points corresponding to the architectural symbols are extracted from the 4-level multi-scale feature map to obtain a set of boundary points. One-dimensional max pooling is performed on the set of boundary points to obtain a one-dimensional feature representation; A rotational region of interest for an architectural symbol is constructed based on the geometric information of the vector polygon; wherein, the geometric information includes the center coordinates, original width, original height, and rotation angle of the vector polygon corresponding to the architectural symbol; Using the region of interest of the architectural symbol, a region feature map corresponding to the architectural symbol is determined from the 4-level multi-scale feature map; The region feature map is converted into a one-dimensional feature vector; The grid feature is obtained by concatenating the one-dimensional feature vector with the one-dimensional feature representation.

5. The architectural symbol recognition method according to claim 3, characterized in that, The step of extracting geometric features from the vector polygon using the geometric information extraction module includes: Based on the geometric information of the vector polygons of each architectural symbol, the outline features, orientation features, aspect ratio features, quantized area, and quantized perimeter of the architectural symbol are determined. The geometric feature is obtained by splicing the contour feature, the orientation feature, the aspect ratio feature, the quantized area, and the quantized perimeter.

6. The architectural symbol recognition method according to claim 3, characterized in that, The step of extracting semantic features from the building image to be identified and the vector polygon through the semantic extraction module includes: Extract index text and functional text from the building image to be identified; wherein the index text is directly associated with the category of the building symbol, and the functional text is associated with the spatial function of the building symbol; Based on the center coordinates of the index text in the image of the building to be identified and the center coordinates of the vector polygon in the image of the building to be identified, calculate the Euclidean distance between the index text and the vector polygon; The index text with the smallest Euclidean distance is taken as the target index text of the vector polygon, and the target index text is converted into a OneHot vector; The functional text is bound to a polygonal region containing the functional text to obtain a region label; Map the region labels to the vector polygons that constitute the polygon regions to obtain the mapping relationship between the vector polygons and the functional text; The mapping relationship between the vector polygon and the functional text is converted into a MultiHot vector; The semantic features are obtained by concatenating the OneHot vector and the MultiHot vector.

7. The architectural symbol recognition method according to claim 1, characterized in that, The domain attention calculation layer obtains local context features by associating the embedded features with a preset number of nearest embedded features based on the following steps: The embedded features are stacked with the preset number of nearest embedded features to obtain a local feature matrix; The local feature matrix is ​​projected through a projection matrix to generate a query matrix, key matrix, and value matrix for multi-head attention. Calculate the one-dimensional relative position offset between any two building symbols in the local feature matrix; Using the one-dimensional relative position offset, construct a relative position offset matrix; The output features of the corresponding attention head are determined using the relative position offset matrix, the query matrix, the key matrix, and the value matrix. The output features of all attention heads are concatenated to obtain the concatenated head output features; The head output features are projected onto the output space to obtain the local context features.

8. The architectural symbol recognition method according to claim 1, characterized in that, Before inputting the building image to be identified and the vector polygon into the pre-trained symbol recognition model to obtain the symbol category of the building symbol output by the symbol recognition model, the method further includes: Obtain a training dataset; wherein the training dataset includes sample building images and their corresponding labels, and the labels corresponding to the sample building images include the categories of building symbols in the sample building images; The training data samples are input into the initial symbol recognition model to obtain the recognition results of the building symbol categories output by the initial symbol recognition model; The loss between the recognition result and the label is quantified using balanced cross-entropy loss. The model parameters of the initial symbol recognition model are updated using the loss until the loss is less than a preset threshold, and the initial symbol recognition model with a loss less than the preset threshold is used as the symbol recognition model.

9. An electronic device, characterized in that, include: One or more processors; A memory having stored one or more computer programs that, when executed by one or more processors, cause the one or more processors to implement the architectural symbol recognition method according to any one of claims 1 to 8.

10. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the architectural symbol recognition method according to any one of claims 1 to 8.