Convolutional neural network-based building plane element recognition model construction method
By using a convolutional neural network-based architectural floor plan element recognition model, which employs vectorization and graph neural networks for classification and combines Siamese Network and triplet loss function to optimize feature extraction, the model addresses the issues of insufficient accuracy and robustness in architectural floor plan recognition, achieving efficient adaptation to irregular layouts and multiple styles.
Patent Information
- Application Number
- CN202511893925.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-02-13
AI Technical Summary
Existing technologies face difficulties in accurate identification and reconstruction of building floor plans, especially in adapting to irregular layouts, and their computational efficiency and robustness need to be improved.
A building plan element recognition model based on convolutional neural networks is adopted. The model is classified by vectorization technology and graph neural network. The feature extraction is optimized by combining the Siamese Network structure and triple loss function. Cross-modal data is used to enhance the generalization ability of the model. An anomaly detection and feedback learning mechanism is introduced in the inference stage.
It improves the accuracy and automation of building plan element detection, adapts to various plan styles, enhances classification accuracy and robustness, is scale and rotation invariant, and reduces computational complexity.
Smart Images

Figure CN121527802A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to a method for constructing a building planar element recognition model based on a convolutional neural network. Background Technology
[0002] Engineering drawings are an indispensable tool in the construction industry. Before the advent of Computer-Aided Design (CAD) technology, engineering drawings were mostly drawn by hand. However, with the continuous development of CAD technology, this design-aiding technique has gradually developed and been widely adopted in the field of architectural engineering design. But the lack of relatively fixed standards for the design of drawings in architectural engineering makes accurate identification and reconstruction of these drawings extremely difficult.
[0003] With the continuous development of deep learning, the Deep Graph Library (DGL) has been proposed, a high-efficiency computational library for Graph Neural Networks (GNNs). It refines the computational pattern of GNNs into sparse tensor operations. In multiple benchmark tests, DGL significantly outperforms other mainstream GNN frameworks in terms of speed and memory consumption, while its advantages for small-scale tasks remain unclear. To address a key task in automatic planar graph analysis—text information extraction—a dedicated data synthesis pipeline is proposed, capable of generating training images that simulate real-world data features, enhancing the model's generalization ability. A comprehensive comparison of various deep learning object detection architectures and OCR tools is presented, including: Object detection models: Tesseract, EAST, CRAFT, Faster R-CNN, YOLO series; OCR tools: PARSEq, MATRN, EasyOCR, Tesseract.
[0004] The experimental results summarize that YOLOv7 performs best in text detection (up to 97.5% wmAP), while PARSEq performs well in character recognition (85.2% CER). However, the datasets and methods mentioned above primarily focus on text extraction from floor plans, and their adaptability to specific floor plan styles is not discussed. Therefore, a new framework, RC-Net, is proposed to further leverage neural networks for floor plan parsing. This significantly simplifies the conversion of historical floor plan data (such as books or paper materials) into electronic resources; however, issues remain regarding robustness in text extraction and computational efficiency and complexity.
[0005] Existing methods are typically based on image learning frameworks, identifying planar graph elements by segmenting image pixels. This approach can have limitations in specific tasks. Therefore, a new framework has been proposed that utilizes vectorization techniques and Graph Neural Networks (GNNs) to classify planar graph elements and represent them in vector format. This approach, using a region adjacency graph representation, strongly supports regular spaces but may be less adaptable to irregular layouts (such as rooms with complex shapes or irregularly shaped elements). Summary of the Invention
[0006] To improve the accuracy, efficiency, and automation of building planar element detection, this invention provides a method for constructing a building planar element recognition model based on a convolutional neural network.
[0007] This invention provides a method for constructing a building planar element recognition model based on a convolutional neural network, employing the following technical solution: A method for constructing a building planar element recognition model based on a convolutional neural network includes the following steps: Obtain the input APN sample; Annotate the elements in the APN samples and generate annotation files; Convert the annotation file to the format required by YOLO and normalize it; Data augmentation is performed on the APN samples to expand the amount of training data, and the element detection results and feature vectors are output. Image features are extracted from image samples, and then aligned and fused with cross-membrane data. Install dependencies and configure data; Set command-line model parameters and customize the training script; Perform model training and model inference.
[0008] In a specific feasible implementation, the APN data sample includes architectural queries, positive sample architectural images, and other architectural images. These are crawled from architectural floor plan data using a web crawler, and the architectural queries, positive sample architectural images, and other architectural images are associated through methods such as manual annotation.
[0009] In a specific feasible implementation, the association of positive sample building images includes the following steps: The intersection-union ratio (IUU) of building queries and positive sample images is calculated using geometric feature matching. ,like A similarity score greater than or equal to the similarity threshold indicates a successful match. A unified label is assigned to the building element by semantic label matching. If the building query matches the semantic label of the positive sample image, the match is successful. If both the architectural query and the positive sample architectural image satisfy geometric feature matching and semantic label matching, the architectural query is associated as a positive sample; otherwise, it is marked as a negative sample. Different similarity thresholds are set to classify the matching results: This indicates that the elements highly overlap, indicating a strong match. This indicates the presence of overlapping or scaled / deformed elements, indicating a weak match. This indicates a mismatch and is classified as a negative sample.
[0010] In a specific feasible implementation, a manual review is triggered when a negative sample is found; Record the modification rate based on the results of manual review; Compare the modification rate with the modification rate threshold. If the modification rate is less than the modification rate threshold, it indicates that the similarity threshold is effective and the data is normal. If the modification rate is greater than or equal to the modification rate threshold, it indicates that the geometric feature matching needs further optimization and the similarity threshold needs to be adjusted.
[0011] In a specific feasible implementation, during model training, the HNSW algorithm is used to optimize the feature vector index, and a threshold dynamic adjustment method is used to dynamically optimize and determine the Euclidean distance threshold for the same building based on the retrieval results; training is accelerated through batch hard sample mining and gradient clipping.
[0012] In a specific feasible implementation, a Siamese Network structure with shared weights is used during model training, and the feature extraction capability is optimized through a triplet loss function.
[0013] In a specific feasible implementation, the triplet loss function for:
[0014] In the above formula, For mandatory constraints; Anchor vector; A positive sample vector; For negative sample vectors; That is, it exists If necessary, increase the number of negative samples or adjust the model parameters and retrain.
[0015] In a specific feasible implementation, model inference performs both single-image matching and batch detection of images within a folder.
[0016] In a specific feasible implementation, the inference phase includes an anomaly detection and feedback learning mechanism to mark anomalies and perform adaptive optimization; During the model reasoning stage, the element category, position, and functional attributes are output simultaneously to achieve joint reasoning of structure recognition and function recognition.
[0017] In one feasible implementation, after model inference, it is converted to ONNX format and then deployed to NVIDIA's TensorRT tool to convert the ONNX model and optimize inference speed.
[0018] In summary, the present invention has the following beneficial effects: 1. Data Conversion from Pixel-Level to Vectorized: A framework for vectorized processing is proposed, directly converting the input floor plan into vector data. By preserving the geometric shape and spatial characteristics of interior elements in the floor plan, the shape blurring problem caused by convolution in traditional methods is avoided.
[0019] 2. By recognizing indoor objects and capturing the spatial relationships between nodes, classification accuracy can be effectively improved.
[0020] 3. Improved robustness and versatility: It performs exceptionally well in terms of scale and rotation invariance, adapting to various planar graph styles. It is style-independent, overcoming the limitations of rule-based or pixel-based segmentation methods that are heavily reliant on specific datasets. Attached Figure Description
[0021] Figure 1 This is a flowchart of a method for constructing a building planar element recognition model based on convolutional neural networks.
[0022] Figure 2 This is a schematic diagram illustrating how training accuracy and validation accuracy change with the number of iterations.
[0023] Figure 3 This is a schematic diagram illustrating how the training metrics change with the number of iterations.
[0024] Figure 4 This is a schematic diagram illustrating how accuracy changes with the number of iterations.
[0025] Figure 5 This is a diagram comparing the test accuracy of different training models. Detailed Implementation
[0026] The following combination Figures 1-5 The present invention will be described in further detail below.
[0027] The method for constructing a building planar element recognition model based on convolutional neural networks includes the following steps: S100, Image preprocessing. This includes the following sub-steps: S101, Obtain APN data samples.
[0028] APN data samples include architectural queries, positive sample architectural images, and other architectural images. The formats supported include vectorized data (CAD files) and raster images (JPG / PNG) to ensure preservation of original geometric information. Architectural queries include user-provided partial images or descriptions of architectural plan elements, such as wall outlines, door and window shapes, and text descriptions. These are typically low-resolution or cropped partial plan views, cropped to the same size (640*640 in this embodiment), but can be adjusted as needed in other embodiments. By employing a hierarchical sample design and pairing local and global samples (i.e., query-complete plan view pairing), the model learning effect is improved by 40%.
[0029] Positive sample building images include complete building floor plans or elevations corresponding to the building query, such as complete design drawings containing the same walls or doors and windows.
[0030] Other architectural images, including distracting samples unrelated to the architectural query, such as stairwells with different structures and unusual wall layouts, are used as negative samples for comparative learning.
[0031] APN data samples can be crawled from building floor plan data and linked with building query images, positive sample building images and other building images through manual annotation and other methods.
[0032] Specifically, after the web crawler retrieves building floor plan data, it associates positive sample building images using methods such as geometric feature matching and semantic tag matching. Geometric feature matching involves calculating the intersection-union ratio (IU) between a building query (e.g., a partial wall outline) and a positive sample image (a complete floor plan). The similarity of key points (such as door and window corners) is used to determine whether to associate the building query as a positive sample by comparing the similarity with a preset similarity threshold. In this embodiment, the similarity threshold is 0.7, that is, if the similarity of APN data samples is greater than or equal to 0.7 and the semantic labels are consistent, it indicates a successful match; otherwise, it is marked as a negative sample and triggers manual review.
[0033] Among them, intersection and union ratio The calculation formula is:
[0034] In the formula, For query-based bounding boxes; These are positive sample bounding boxes. Furthermore, different similarity thresholds are set to classify the matching results: This indicates that the elements are highly overlapping, such as a complete wall outline, indicating a strong match; This indicates partially overlapping or scaled / deformed elements, a weak match. This indicates a mismatch and the sample needs to be classified as a negative sample.
[0035] Semantic tag matching assigns uniform tags to architectural elements (such as "L-shaped wall" or "double door") to ensure that the query and the positive sample images share the same tags. During matching, it verifies that the semantic tags of the query and the positive sample images must be consistent.
[0036] Negative sample selection employs both random sampling and hard negative sample mining. Random sampling involves randomly selecting dissimilar elements from other building images (e.g., using "stairwell" as a negative sample for "wall"). Hard negative sample mining dynamically selects samples similar to the query but of different categories during training (e.g., doors and windows of the same type with different layouts).
[0037] Understandably, when If the semantic tags do not match, i.e., the automatic matching fails, manual review is triggered. In special cases, such as irregularly shaped doors and windows, manual confirmation is required.
[0038] During the review process, the tool interface of the annotation platform integrates a visual comparison function, displaying query and candidate samples side by side; and includes at least three decision options: Confirm Match: Manual Adjustment After calculating the area, proceed (e.g., ignoring decorative lines); Marked as negative samples: elements with inconsistent functions (e.g., "sliding door" vs "hinged door"); New category tag: Discover undefined architectural elements.
[0039] Meanwhile, during manual review, the matching results are determined based on the consistency of element functions, and the determination criteria are recorded in the metadata file.
[0040] S102, label the elements in the APN sample and generate the label file.
[0041] Specifically, LabelImg is used to select and annotate elements in the APN samples, generating annotation files with target categories and bounding box coordinates. A data directory is then constructed to ensure that each generated annotation file corresponds one-to-one with an image.
[0042] S103, convert the annotation file to the format required by YOLO.
[0043] Convert the data in the annotation file to the format required by YOLO and normalize it to [0,1]. Convert the original bounding box coordinates in the annotation file... Transform into The formula is:
[0044]
[0045]
[0046]
[0047] In the above formula, The bottom right corner of the bounding box coordinate; The top left corner of the bounding box coordinate; Image width; Image height; The bottom right corner of the bounding box coordinate; The top left corner of the bounding box coordinate; This is the normalized bounding box width; This is the height of the normalized bounding box.
[0048] S104, Data Augmentation.
[0049] Dynamic enhancement strategies such as random flipping, cropping, and brightness adjustment are applied to all images in the APN data sample. Through 8 combinations of transformations, the amount of training data is expanded by 15 times, which significantly improves the robustness of the model to abnormal conditions such as blur and tilt.
[0050] The output data includes element detection results and feature vectors. The element detection results include categories and bounding box coordinates. Categories include walls, doors, and windows, etc., and the bounding box coordinates are... Feature vectors can be mapped to multidimensional features through fully connected layers for similarity detection and data transformation.
[0051] S105, cross-modal feature fusion.
[0052] To enhance the semantic understanding of architectural plan elements and robustness in complex scenarios, cross-modal data corresponding one-to-one or many-to-one with the images are introduced on the basis of image samples. This includes, but is not limited to: textual descriptions that accompany the drawings (such as room functions, material specifications, and standard construction practices), BIM or IFC structural data (component types, node connection relationships, and construction levels), and optional sensor data from the construction phase (such as displacement or vibration statistics).
[0053] Image features are extracted using an image encoder (a convolutional network with shared weights or a feature pyramid derived from the detection backbone); text encoders (Transformer or bidirectional encoder) are used to represent technical terms as context-related vectors; and BIM structure encoders are used to model the component-space relationship as a graph, and graph neural networks are used to obtain the embeddings of nodes and edges.
[0054] Image features and cross-modal data output from the image encoder are fed into a gated cross-modal fusion module for alignment and fusion. First, learnable projection aligns different modalities to the same feature dimension. Then, gated co-attention interacts at both the element-level and relation-level scales to output fused features. During training, in addition to the original detection or retrieval loss, a cross-modal alignment loss (such as contrastive learning loss or matching loss) is introduced to constrain the representations of the same object to be close in different modalities and to separate dissimilar objects.
[0055] Without altering the original detection / retrieval process, the model's ability to distinguish between "homomorphic and heterogeneous" scenarios is enhanced, significantly reducing ambiguity that can easily arise from relying solely on image features, and improving the recognition stability and generalization ability of complex structures, special symbols, and rare components.
[0056] S200, Environment Preparation. This includes the following sub-steps: S201, Install dependencies.
[0057] Clone YOLOv5 and install it locally, install the relevant dependency packages, define the model structure and hyperparameters, such as learning rate, batch size, anchor box settings, etc., to ensure that YOLOv5 runs normally.
[0058] S202, Data Configuration.
[0059] Create a data.yaml file and configure the data path and categories.
[0060] S300: Set model parameters and train the model. This includes the following sub-steps: S301, Set model parameters.
[0061] Specifically, this involves setting command-line model parameters and customizing the training script.
[0062] Command line: Configure the hyperparameters for the entire training process through command line parameters. In this embodiment, the input image size is set to 640, the number of images for each training session is 16, the number of training rounds is 50, and the weights are the YOLOv5 pre-trained weights for subsequent model training.
[0063] Custom training scripts: The configuration is explicitly specified through dictionary parameters. The configuration parameters are the same as those in the command line, so they will not be described again.
[0064] The command line allows for quick and easy model training; custom training scripts enable easy modification of parameters and loss functions, facilitating the integration of large models and dynamic adjustments to model training.
[0065] S302, Model Training.
[0066] During model training, a SiameseNetwork structure with shared weights is employed, and feature extraction capability is optimized through a triplet loss function. The shared weight mechanism reduces parameter redundancy by 30%, and combined with a dynamic negative sample appending strategy, achieves an accuracy rate exceeding 96% for identifying elements of the same type. Specifically: During feature extraction, shallow CNNs extract local structural features such as line trends and inflection points.
[0067] Deep CNN: Captures global structural features such as building category and style.
[0068] Siamese branch: Architectural query ( Positive sample building images ( ) and other architectural images ( They share the same CNN weights, ensuring consistency in feature extraction.
[0069] During feature mapping, a fully connected layer maps general features into architectural feature vectors, generating anchor vectors. Positive sample vector Negative sample vector .
[0070] Triple loss function for:
[0071] In the above formula, To enforce constraints, forcing and Distance less than and The distance is at least one interval .
[0072] If the loss does not converge during model training, then there exists... If necessary, increase the number of negative samples or adjust the model parameters and retrain.
[0073] Evaluate the model's ability to generalize to unknown data to prevent overfitting.
[0074] Through the model training process, the model learns to map similar building elements to neighboring locations in the feature space, while dissimilar building elements are moved away from them.
[0075] S303, Model Optimization.
[0076] The HNSW algorithm is used to optimize the feature vector index. By constructing a hierarchical graph index, the complexity of similarity search for high-dimensional feature vectors is reduced from... Reduce to It accelerates the matching process between building queries and database images by enabling fast navigation through local adjacency nodes.
[0077] A dynamic threshold adjustment method is adopted to dynamically optimize the Euclidean distance threshold for the same building based on the retrieval results, thereby improving the recognition accuracy.
[0078] Batch hard sample mining is employed to select the most difficult-to-distinguish negative samples in the batch, i.e., the negative samples closest to the anchor point, thereby enhancing the model's comparative ability. Gradient clipping and learning rate adjustment are also performed to prevent gradient explosion, and the learning rate is adaptively adjusted to balance convergence speed and stability.
[0079] S400, Model Inference.
[0080] Simply input the image to be processed into the trained model. This can be a single image or all images in a folder, and the model will automatically identify architectural elements in the image.
[0081] S401, a multi-task collaborative framework, performs parallel task inference on images to be processed.
[0082] A multi-task collaborative framework is introduced: the backbone network of the multi-task collaborative framework extracts backbone features from the image to be processed, and sets an element detection branch (outputting category and bounding box or polygon vector) and a functional attribute branch (outputting a set of configurable attributes such as load-bearing / non-load-bearing, opening and closing type, whether it is an escape door, fire resistance rating, etc.). The backbone features are shared with the element detection branch and the functional attribute branch.
[0083] Backbone features refer to the general, high-level visual representations extracted from the input image by the model's backbone network. In this embodiment, backbone features are not specific recognition results, but rather a set of multi-scale feature maps obtained after the image has been processed by a convolutional neural network (such as the CSPDarknet, FPN, or Transformer encoder part of YOLOv5).
[0084] The main features include: Low-level features: lines, edges, corners, geometric contours; Mid-level characteristics: element shape and spatial arrangement; High-level features: contextual information on category semantics and structural functions.
[0085] The extraction of core features is based on the following three main aspects: Network structure based on It has been confirmed that the backbone is derived from the backbone network structure of YOLOv5 (the backbone of detect.run()), which extracts multi-scale features through multi-layer convolution and residual connections. The YOLOv5 backbone (CSPDarknet53) can effectively capture the spatial continuity of linear structures (walls, doors, windows, etc.) in building floor plan recognition.
[0086] Based on task requirements The multi-task collaborative framework requires the simultaneous completion of "structure detection" and "functional attribute discrimination". Therefore, a shared intermediate feature representation is needed to enable the two tasks to be semantically aligned, reducing redundant computation and information fragmentation.
[0087] Training and optimization basis The extraction of backbone features has been optimized by triplet loss and Siamese shared weights in the previous training steps, giving it strong characteristics of "intra-class similarity and inter-class differentiation".
[0088] In other words, the main features of similar building elements are close together in the feature space, while elements of different types are far apart, which provides a stable basis for subsequent detection and attribute judgment.
[0089] The element detection branch is the branch of the YOLOv5 model used for image detection. It identifies and determines planar elements within an image using the YOLOv5 model. Specifically: The process of using the YOLOv5 model to perform object detection on a single image is as follows: The detect.run() function in the YOLOv5 model performs the object detection task, and its recognition process is as follows: the model is loaded using the weight file obtained after training; the test image is detected; the input image size is set to 640×640 pixels; a similarity threshold of 0.5 is set, that is, only the detection results with a similarity higher than this value are retained; and the detection results are saved as a text file, while recording the similarity information of each image.
[0090] The process of using the YOLOv5 model to perform object detection on all images in a folder is as follows: Run the detection script using pythondetect.py, specify the path to the trained model weight file using the --weights parameter, and point to the folder containing the images to be detected using the --source parameter, thereby achieving batch detection of all images in the folder.
[0091] The attribute branch takes the detected candidate regions as input, extracts deep semantic features at the region level through ROI alignment or Deformable attention, and combines them with text / BIM priors obtained through cross-modal fusion to output multi-label attribute predictions. Multi-label attributes are the specific attributes of planar elements. For example, the multi-label attribute of the planar element "door" can be "double-leaf fire door".
[0092] Joint loss is used during training:
[0093] in To detect loss (classification, localization, shape regression). For multi-label attribute binary cross-entropy or focus loss, For relational consistency regularization (consistency between constraint attributes and BIM / text priors). and These are the weighting coefficients.
[0094] The system has been upgraded from "geometric / category recognition" to "structure + function collaborative discrimination," directly addressing downstream tasks such as design verification, compliance checks, and energy consumption analysis. This reduces the cost of manual secondary classification and judgment, and improves the usability of the results.
[0095] S402, during model inference, anomaly detection and feedback learning loop are performed, and the matching result is output.
[0096] Same element determination: When the feature vector distance between an image and an image in the database is less than a set threshold, they are determined to be elements in the same plane; Candidate list (Top-K): When a match fails, return the K closest candidate elements; Optimized retrieval: The HNSW algorithm accelerates feature vector matching, reduces computational complexity, and shortens retrieval time from milliseconds to microseconds.
[0097] Inference optimization is achieved through feature vector caching and parallel computing. Feature vector caching pre-computes and caches the feature vectors of the database structure, requiring only the input query to be processed during real-time queries. Parallel computing utilizes GPUs to process multiple queries and extract features from the database image in parallel, improving throughput.
[0098] A two-level anomaly detection mechanism is introduced during the inference phase: (1) Data-driven anomalies: Model the distribution of normal samples in the element feature space using reconstructive autoencoders or deep single-class classification (Deep SVDD), and score and label anomalies such as size anomalies, morphological anomalies or low confidence results; (2) Rule consistency anomaly: Based on semantic graph or cross-modal prior, the design specifications are computable (such as "escape door should lead directly to the safety exit" and "load-bearing wall should not completely overlap with window opening"). When the detection result conflicts with the rule, an alarm is automatically triggered and an evidence chain is generated (conflict entry, trigger threshold, candidate alternative).
[0099] For the labeled abnormal samples, a feedback learning process is initiated: the system automatically summarizes high-uncertainty or high-value samples and provides an active learning interface for rapid manual correction; the corrected samples and labels are added to incremental training (or periodically retrained) in small batches, and the thresholds and index structures (such as HNSW) are updated synchronously.
[0100] By constructing a self-evolving closed loop of "identification-verification-correction-relearning", we can continuously reduce false detections / missed detections caused by long-tail scenarios and data distribution drift, and improve the reliability and maintainability of the system in real engineering environments.
[0101] S500, optimization and deployment.
[0102] The model can be converted to ONNX format and then deployed to TensorRT. NVIDIA's TensorRT tools are used to convert the ONNX model and optimize inference speed. After TensorRT optimization, the inference speed reaches 150 FPS, a 4x improvement over the original model, meeting the requirements of real-time engineering inspection.
[0103] S501: Lightweight edge-side design and real-time deployment.
[0104] To adapt to low-power scenarios such as construction sites and mobile inspections, model distillation and structured pruning (sparsening and pruning redundant channels and convolutional kernels) are performed on the server side, and Quantization-Aware Training (QAT) is used to obtain INT8 or FP16 friendly weights. Combined with operator fusion and tensor rearrangement of TensorRT, NNAPI, or NPU, an optimal execution graph for edge devices is generated. For storage and bandwidth constraints of drones, AR glasses, and mobile terminals, dynamic resolution / frame rate adaptation and hierarchical caching strategies are provided: historical feature maps are reused when scene changes are small, and sampling density is increased during rapid movement.
[0105] In terms of engineering implementation, it provides edge-cloud collaboration capabilities: the edge side completes rapid detection and the first round of attribute discrimination, and uploads the feature summary of uncertain samples to the cloud for refinement and retrieval; at the same time, it maintains compatibility with the existing ONNX or TensorRT deployment process of this invention, ensuring that a set of model weights can be reused in the cloud and at the edge.
[0106] While ensuring recognition accuracy, it significantly reduces latency and power consumption, meeting the real-time and stability requirements of construction sites and mobile inspections, thus expanding the application boundaries of this invention.
[0107] S600, Technical Verification and Recording.
[0108] At regular intervals, the matching results are sampled and checked. In this embodiment, this is set to 10%, meaning 10% of the matching results are randomly selected and reviewed by a third party to check the consistency between the reviewed results and the original matching results. Simultaneously, the modification rate of the manual review is recorded, and a modification rate threshold is set. The modification rate of the manual review is the proportion of negative samples that have been corrected to positive samples out of all negative samples. In this embodiment, it is set to 5%, meaning a modification rate less than 5% indicates that the automatic matching is accurate; otherwise, it indicates that the automatic matching needs further optimization. Furthermore, the scoring criteria are determined through cross-validation; when the manual review modification rate is less than 5%, the similarity threshold is considered valid.
[0109] Key training and optimization comparison: Table 1
[0110] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.
Claims
1. A method for constructing a building planar element recognition model based on a convolutional neural network, characterized in that: Includes the following steps: Obtain the input APN sample; Annotate the elements in the APN samples and generate annotation files; Convert the annotation file to the format required by YOLO and normalize it; Data augmentation is performed on the APN samples to expand the amount of training data, and the element detection results and feature vectors are output. Image features are extracted from image samples, and then aligned and fused with cross-membrane data. Install dependencies and configure data; Set command-line model parameters and customize the training script; Perform model training and model inference.
2. The method for constructing a building planar element recognition model based on a convolutional neural network according to claim 1, characterized in that: APN data samples include architectural queries, positive sample architectural images, and other architectural images. These are crawled from architectural floor plan data and then manually annotated to link the architectural queries, positive sample architectural images, and other architectural images.
3. The method for constructing a building planar element recognition model based on a convolutional neural network according to claim 2, characterized in that: The association of positive sample building images includes the following steps: The intersection-union ratio (IUU) of building queries and positive sample images is calculated using geometric feature matching. ,like A similarity score greater than or equal to the similarity threshold indicates a successful match. A unified label is assigned to the building element by semantic label matching. If the building query matches the semantic label of the positive sample image, the match is successful. If both the architectural query and the positive sample architectural image satisfy geometric feature matching and semantic label matching, the architectural query is associated as a positive sample; otherwise, it is marked as a negative sample. Different similarity thresholds are set to classify the matching results: This indicates that the elements highly overlap, indicating a strong match. This indicates the presence of overlapping or scaled / deformed elements, indicating a weak match. This indicates a mismatch and is classified as a negative sample.
4. The method for constructing a building planar element recognition model based on a convolutional neural network according to claim 3, characterized in that: When a negative sample is found, manual review is triggered. Record the modification rate based on the results of manual review; Compare the modification rate with the modification rate threshold. If the modification rate is less than the modification rate threshold, it indicates that the similarity threshold is effective and the data is normal. If the modification rate is greater than or equal to the modification rate threshold, it indicates that the geometric feature matching needs further optimization and the similarity threshold needs to be adjusted.
5. The method for constructing a building planar element recognition model based on a convolutional neural network according to claim 1, characterized in that: During model training, the HNSW algorithm is used to optimize the feature vector index, and a dynamic threshold adjustment method is used to dynamically optimize the Euclidean distance threshold for the same building based on the retrieval results; training is accelerated through batch hard sample mining and gradient clipping.
6. The method for constructing a building planar element recognition model based on a convolutional neural network according to claim 1, characterized in that: During model training, a Siamese Network structure with shared weights is used, and the feature extraction capability is optimized through a triplet loss function.
7. The method for constructing a building planar element recognition model based on a convolutional neural network according to claim 6, characterized in that: Triple loss function for: In the above formula, For mandatory constraints; Anchor vector; A positive sample vector; For negative sample vectors; That is, it exists If necessary, increase the number of negative samples or adjust the model parameters and retrain.
8. The method for constructing a building planar element recognition model based on a convolutional neural network according to claim 1, characterized in that: The model inference performs both single-image matching and batch detection of images within a folder.
9. The method for constructing a building planar element recognition model based on a convolutional neural network according to claim 1, characterized in that: The inference phase includes anomaly detection and feedback learning mechanisms, which are used to mark anomalies and perform adaptive optimization. During the model reasoning stage, the element category, position, and functional attributes are output simultaneously to achieve joint reasoning of structure recognition and function recognition.
10. The method for constructing a building planar element recognition model based on a convolutional neural network according to claim 1, characterized in that: After model inference, it is converted to ONNX format and then deployed to NVIDIA's TensorRT tool to convert the ONNX model and optimize inference speed.
Citation Information
Patent Citations
Building identification model establishing method and device and building identification method and device
CN110309727A
Intelligent geometric reasoning and semantic understanding method based on three-dimensional large language model
CN120542438A
Transformer substation defect identification method and system based on multi-mode open set associative reasoning
CN120765554A
Face verification method and apparatus based on triplet loss, and computer device and storage medium
WO2019128367A1
Cited By
A special-shaped building structure graph element intelligent identification and vectorization method
CN122244894A
A method for intelligent recognition and vectorization of irregular building structure primitives
CN122244894B