A two-dimensional engineering drawing element identification method and system based on time-spectrum joint diffusion

By employing a time-series-spectrum joint diffusion method, the problems of insufficient global context utilization and noise sensitivity in the feature recognition of 2D engineering drawings are solved, achieving efficient and robust feature recognition and improving recognition accuracy and robustness.

CN121686508BActive Publication Date: 2026-05-12BEIJING INST OF ARCHITECTURAL DESIGN
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING INST OF ARCHITECTURAL DESIGN
Filing Date
2025-12-25
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies for feature recognition in 2D engineering drawings lack sufficient utilization of global context, are sensitive to noise, and have limited recognition paradigms, making them difficult to adapt to complex and ever-changing real-world engineering drawings.

Method used

采用基于时序-频谱联合扩散的方法,通过图纸标准化与上下文编码,构建全局静态条件频谱上下文,结合频谱交叉注意力引导的时序去噪网络,逐步去噪并生成要素响应谱,最终通过逆傅里叶变换和峰值检测识别要素。

Benefits of technology

It achieves efficient and robust feature recognition, can collaboratively utilize global structural information in the frequency domain, improves robustness to noise and computational efficiency, and provides deep interpretability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121686508B_ABST
    Figure CN121686508B_ABST
Patent Text Reader

Abstract

The application discloses a kind of two-dimensional engineering drawing element identification method and system based on timing-spectrum joint diffusion, comprising the following steps: drawing standardization and context coding;Response spectrum space diffusion process definition;Guided denoising based on spectrum cross attention;Response spectrum decoding and element positioning;Boundary box refining and multi-attribute identification.This application identifies and generates in the same diffusion framework.Uniformly, element identification is no longer a feature matching process, but a generation process from noise to heat map under the guidance of global context, which is more advanced in concept.As the entire process is carried out in the frequency domain, the model can access the global structural information of the drawing at each step.The cross-attention mechanism enables the model to reason like an expert, achieving efficient global-local information collaboration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and artificial intelligence, and in particular to a method and system for identifying elements in two-dimensional engineering drawings based on time-spectrum joint diffusion. Background Technology

[0002] Two-dimensional engineering drawings, such as architectural floor plans, mechanical drawings, and piping layouts, are the core carriers of information transmission and archiving in the engineering field. Automating the identification and location of various standardized elements (such as doors, windows, and equipment) from these drawings is crucial for realizing drawing digitization, BIM (Building Information Modeling) reverse engineering, equipment asset management, and automated design review.

[0003] Currently, the technical approaches for drawing feature recognition are mainly divided into traditional methods and deep learning-based methods. Traditional methods often rely on template matching, Hough transform, or manually designed feature descriptors. These methods are very sensitive to feature scale, rotation, occlusion, and drawing noise, have poor generalization ability, and are difficult to adapt to complex and ever-changing real-world engineering drawings.

[0004] Deep learning-based methods, especially convolutional neural networks (CNNs), such as Faster R-CNN and YOLO, have made significant progress in object detection tasks. These methods treat object detection as a general object detection problem, learning rich visual features through training on large amounts of labeled data. However, they are essentially "discriminative" models, where the recognition process involves local search and matching in the pixel space or feature space of the image, which has the following limitations: 1. Insufficient utilization of global context: Conventional CNNs have limited receptive fields, making it difficult to effectively utilize the global layout and structural information of drawings. For example, a "door" element always appears on a "wall," and this global structural constraint is difficult to fully model in the local detection box. 2. Sensitivity to noise and style changes: Pixel- or local feature-based methods are easily affected by low-level visual changes such as line thickness, print quality, and scanning artifacts. 3. Paradigm limitations: Treating recognition as a process of finding matches in a large search space, the conceptual model is relatively straightforward and may not fully explore the deep structural information contained in the data.

[0005] In recent years, diffusion models, as a powerful generative model, have achieved revolutionary breakthroughs in the field of image generation. Their process of gradually recovering data from noise is similar to the human cognitive process of moving from blurry to clear. However, in recognition tasks, diffusion models are often used as data augmentation or preprocessing tools, and their potential as a core inference engine has not yet been fully explored.

[0006] Therefore, there is an urgent need in this field for a new technological paradigm that can transcend the traditional discriminative recognition framework, deeply integrate the global structural information of drawings with the local feature patterns of elements, and achieve element recognition in a more robust and efficient manner.

[0007] The information disclosed in this background section is intended only to enhance the understanding of the general background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention

[0008] The purpose of this invention is to overcome the shortcomings of the prior art and provide a two-dimensional drawing element recognition method and system based on time-spectrum joint diffusion, aiming to solve the problems of insufficient global context utilization, sensitivity to noise, and limited recognition paradigm in the background art.

[0009] To achieve the above objectives, the present invention adopts the following technical solution:

[0010] This invention provides a method for identifying two-dimensional drawing features based on time-spectrum joint diffusion, comprising the following steps:

[0011] Step 1: Drawing standardization and context encoding. The input vector or raster format 2D engineering drawings are standardized and preprocessed, including rasterization, size normalization and binarization. The standardized drawing image is input into a basis feature extraction network to obtain a deep feature map, and then subjected to a multi-channel 2D fast Fourier transform to construct an image spectral context as a global static condition.

[0012] Step 2: Define the response spectrum spatial diffusion process, which includes... The task is to identify a category of features and construct a... The target response heatmap tensor of the channel is transformed to the frequency domain to obtain the ground state response spectrum; through a preset variance scheduling, a forward diffusion process is defined to gradually inject complex Gaussian noise into the ground state response spectrum until it is transformed into a pure random noise spectrum;

[0013] Step 3: Based on guided denoising using spectral cross-attention, a temporal denoising network is constructed. At each time step of backdiffusion, the network uses the current noisy response spectrum as the query and the image spectral context generated in Step 1 as the key and value. It then predicts the noise spectrum to be removed through the temporal-spectral cross-attention module and iteratively updates the response spectrum.

[0014] Step 4: Response spectrum decoding and feature localization. After the backdiffusion process, perform an inverse fast Fourier transform on each channel of the final denoised response spectrum to obtain... The response heatmap of each spatial domain is generated, and the category and center point coordinates of each element are extracted by peak detection and non-maximum suppression.

[0015] Step 5: Bounding box refinement and multi-attribute recognition. Using the center point obtained in Step 4 as a reference, local features are extracted from the multi-scale deep feature map generated by the basis feature extraction network in Step 1, and input into a lightweight regression and classification head network to regress the precise bounding box of the feature and selectively identify more fine-grained attributes.

[0016] Further: The standardization preprocessing in step 1 specifically involves: uniformly rendering and scaling / filling vector graphics (such as DWG, DXF) or raster graphics (such as PNG, TIFF) to a fixed size (such as 1024x1024 pixels), rendering lines to a unit pixel width, and normalizing the image to a single-channel binary image; the basis feature extraction network uses a convolutional neural network (such as ConvNeXt) or visual transformer (ViT) pre-trained on a large image dataset, whose parameters are frozen in the feature recognition task.

[0017] Further: The formula for constructing the image spectral context in step 1 is:

[0018] ;

[0019] in, It is the output of the basis feature extraction network. Deep feature map of the channel It is a two-dimensional fast Fourier transform. It is a function that shifts the zero-frequency component to the center of the spectrum, ultimately yielding a complex tensor. .

[0020] Further: The calculation formula for the time-spectrum cross-attention module in step 3 is as follows:

[0021] ;

[0022] Among them, query From the noisy response spectrum Channel features and time step embedding Generated by complex linear projection after combination; bond Sum All are derived from the image spectral context Generated by different complex linear projections; This is the conjugate transpose. To perform the real part operation, It is the feature dimension of key K.

[0023] Further: The temporal denoising network in step 3 The training loss function is composed of L2 norm distance:

[0024] ;

[0025] in, It is a target response heatmap Fourier transform, It is standard complex Gaussian noise. It is the cumulative variance scheduling parameter of the forward diffusion process. It is the network in time step Noisy response spectrum and spectral context Predicting noise under certain conditions.

[0026] Further: The temporal denoising network in step 3 A SpectralTransformer U-Net architecture is adopted, in which the standard convolutional blocks in the encoder and decoder are replaced with spectral transformer blocks. These blocks sequentially contain a temporal-spectral cross-attention module, a spectral self-attention module that operates on the channel and frequency dimensions, and a complex feedforward network. The linear projection and normalization layers inside the network are designed to support complex number operations.

[0027] Further: Peak detection in step 4 specifically involves: for each heatmap Apply confidence threshold filtering, and then perform non-maximum suppression (NMS) through max pooling to retain only the points whose values ​​are equal to the maximum values ​​in their neighborhood as feature centers.

[0028] Further: In step 5, the input features for refining the bounding box come from multi-level feature maps of the base feature extraction network. After being fused through a feature pyramid network (FPN) structure, the RoIAlign operation is used to extract local features around the detected center point. The lightweight regression and classification head network contains parallel fully connected layers, which are used to regress the center point offset and width and height of the bounding box, respectively. It also categorizes predefined fine-grained attributes (such as the opening direction of doors and windows).

[0029] A two-dimensional drawing feature recognition system based on time-spectrum joint diffusion includes:

[0030] The drawing preprocessing and context encoding module is used to perform the operation in step 1, realize the standardized processing of the input drawing, and encode and generate a static image spectrum context as a global condition;

[0031] The guided response spectrum generation module is used to perform the operations in steps 2 and 3. Its core is a temporal denoising network based on spectral cross-attention. This network is guided by the image spectral context and transforms a random noise spectrum into a final response spectrum containing the location information of all feature categories through iterative denoising.

[0032] The result decoding and refining module is used to perform the operations in steps 4 and 5. It obtains a spatial heat map by performing an inverse Fourier transform on the final response spectrum, and combines it with a lightweight detection head to finally output the category, precise location and attribute information of all elements in the drawing.

[0033] By adopting the above technical solution, the present invention has the following beneficial effects:

[0034] 1. Fundamental Paradigm Innovation: This invention unifies identification and generation within the same diffusion framework. Element identification is no longer a feature matching process, but a generation process guided by a global context, moving from chaos (noise) to order (heatmap), which is conceptually more advanced.

[0035] 2. Efficient Global-Local Cooperative Reasoning: Since the entire process takes place in the frequency domain, the model can access the global structural information of the drawing at each step. The cross-attention mechanism enables the model to reason like an expert. For example, to determine the location of a "door" (local decision), the model can focus on the low-frequency components related to the "wall" in the entire drawing, achieving efficient global-local information collaboration.

[0036] 3. Excellent robustness and parallel efficiency: The model is matched and generated at the spectral level, exhibiting natural robustness to pixel-level noise and variations in line thickness. Furthermore, response heatmaps for all categories are generated in parallel during a single complete backdiffusion process, resulting in high computational efficiency.

[0037] 4. Enhanced interpretability: By visualizing the weights of cross-attention, it is clear which frequency components of the input drawing the model focuses on in order to generate a response for a certain element, providing deep interpretability for the model's decision-making process. Attached Figure Description

[0038] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0039] Figure 1This is a flowchart of the two-dimensional drawing feature recognition method based on time-spectrum joint diffusion provided in this application. Detailed Implementation

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

[0041] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0042] Combination Figure 1 As shown, this application provides a method for identifying two-dimensional drawing features based on time-series-spectrum joint diffusion, including the following steps:

[0043] Step 1: Drawing Standardization and Context Coding:

[0044] For heterogeneous 2D engineering drawings (such as DWG vector format or PNG raster format), a standardized preprocessing workflow is first established. A rendering engine (such as the ezdxf drawing plugin) is used to convert all drawings into single-channel binary images of a fixed size (e.g., 1024x1024 pixels), where the background is black (pixel value 0), the foreground lines are white (pixel value 255), and the line width is uniformly 1 pixel. Subsequently, the image pixel values ​​are normalized to the range [0, 1], resulting in a standardized input image tensor. .

[0045] Next, Input a pre-trained, parameter-frozen ConvNeXt-Base network on ImageNet and extract deep feature maps from the output of its third stage. To construct the image spectral context, for Each of the 512 channels is independently subjected to a two-dimensional Fast Fourier Transform (FFT), and FFT-shift is applied to shift the zero-frequency component to the center of the spectrum. The construction formula is as follows:

[0046] ;

[0047] Finally, we obtain complex tensors. This tensor serves as static, global conditional information in subsequent processing.

[0048] Step 2: Definition of the spatial diffusion process of the response spectrum:

[0049] For a containing The task involves classifying features into categories, and constructing a system based on the annotations of the training samples (feature category and center point coordinates). Target response heatmap tensor of the channel Place a standard deviation at the center point of each feature. A two-dimensional Gaussian kernel. This represents the ideal recognition result.

[0050] Will Transform to the frequency domain to obtain its ground state response spectrum Define a linear variance scheduling scheme. ,from arrive ,common Each time step. Based on this schedule, at any given time... Noisy response spectrum It can be generated in the following closed form for model training:

[0051] ;

[0052] in From the standard complex Gaussian distribution noise in the mid-sample, It is the cumulative variance of the forward process.

[0053] Step 3: Guided denoising based on spectral cross-attention:

[0054] This step is performed during inference and its core is a pre-trained temporal denoising network. The network employs a U-Net architecture with a spectrum converter. It uses a randomly sampled noise response spectrum. Begin, proceed Iterative noise reduction.

[0055] At each time step The network receives the current noisy response spectrum. Time step embedding and static image spectral context Within the network's internal spectrum transformer block, the crucial time-spectrum cross-attention module operates as follows: 1. Query generation: Channel characteristics and After combination, a query is generated through a complex linear layer. 2. Key / Value Generation: Bond generation via two different complex linear layers Sum 3. Attention Calculation:

[0056] ;

[0057] in, The correlation between "current element guess" and "drawing structural evidence" in the frequency domain was calculated, and this correlation was used as a weight to aggregate structural information from the drawings. This corrects the response spectrum. 4. The network's final output predicts noise. Update the response spectrum using the DDIM sampler to obtain a cleaner result. .

[0058] The training objective of the network is to minimize the L2 distance between the predicted noise and the actual noise.

[0059] ;

[0060] Step 4: Response spectrum decoding and feature localization:

[0061] go through The final denoised response spectrum is obtained through iterative steps. Regarding it Perform inverse FFT on each channel to obtain Zhang Space Heat Map For each heatmap, a confidence threshold (e.g., 0.5) is first applied, and then a 3x3 max pooling operation is used for NMS. The remaining peak points are the identified feature center points.

[0062] Step 5: Bounding box refinement and multi-attribute recognition:

[0063] To obtain accurate bounding boxes, using the center point coordinates obtained in step 4, the local features of each element are cropped from the multi-scale feature map (fused by FPN) output by the ConvNeXt network in step 1 through the RoIAlign operation. These features are then input into a lightweight MLP head containing two branches: one branch regresses the center offset and width / height of the bounding box. Another branch categorizes predefined attributes (such as whether the door opens inwards or outwards).

[0064] This application provides a two-dimensional drawing feature recognition system based on time-spectrum joint diffusion, including:

[0065] Drawing preprocessing and context encoding module: responsible for performing the operations in step 1, rasterizing, normalizing and binarizing the input CAD drawings, and constructing the image spectral context using CNN backbone network and FFT.

[0066] Guided Response Spectrum Generation Module: The core of this module is the U-Net spectrum transformer that performs step 3. Starting with random noise, guided by the image's spectral context, this module generates the final response spectrum through iterative denoising.

[0067] The result decoding and refining module is responsible for performing the operations in steps 4 and 5. It converts the response spectrum into a heatmap using iFFT, performs peak detection to locate the feature center, and uses a refining head network to output accurate bounding boxes and attributes.

[0068] Example 1: Identification of door and window elements in architectural floor plans;

[0069] This embodiment demonstrates the application of the present invention in a scenario of door and window recognition in architectural floor plans. First, a batch of DWG format architectural floor plans containing door and window annotations is collected. According to step 1 of the present invention, all drawings are uniformly rendered as 1024x1024 binary images, and the image spectral context is calculated for each drawing. Based on step 2, generate a corresponding 2-channel (door, window) target response heatmap for each training sample. .

[0070] During the training phase, a spectrum converter U-Net is trained according to the description in step 3. This network learns to operate on arbitrary architectural drawings. Under the given conditions, the corresponding door and window position response spectra are generated from random noise.

[0071] During the reasoning phase, for a new architectural floor plan, step 1 is first executed to generate its... Then, starting with a random noise spectrum, a 200-step backdiffusion is performed using a DDIM sampler. At each step, the denoising network utilizes cross-attention to compare the current guesses about the positions of doors and windows with the drawings. Perform matching. For example, the response spectrum of the "gate" channel will be the focus. The frequency components are related to wall interruptions and arcs (indicating the opening direction).

[0072] After diffusion, following step 4, an iFFT is performed on the generated 2-channel response spectrum to obtain two clear heatmaps. In the "door" heatmap, all door locations are represented by bright peaks; the same applies to the "window" heatmap. Peak detection is used to obtain the center points of all doors and windows. Finally, following step 5, a pre-trained refinement head is used to regress the precise bounding boxes of each door and window. Experimental results show that this method improves the AP@0.5 metric by 5.2% compared to the YOLOv5-based detector, and exhibits better robustness to noise such as handwritten annotations and dimension lines in drawings.

[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for identifying features in two-dimensional engineering drawings based on time-spectrum joint diffusion, characterized in that, Includes the following steps: Step 1: Drawing Standardization and Context Encoding: Standardize the input 2D engineering drawings in vector or raster format, including rasterization, size normalization and binarization; input the standardized drawing image into a basis feature extraction network to obtain a deep feature map, and perform multi-channel 2D fast Fourier transform on it to construct an image spectral context as a global static condition. Step 2: Definition of response spectrum spatial diffusion process: [This refers to a process involving...] The task is to identify a category of features and construct a... The target response heatmap tensor of the channel is transformed to the frequency domain to obtain the ground state response spectrum; through a preset variance scheduling, a forward diffusion process is defined to gradually inject complex Gaussian noise into the ground state response spectrum until it is transformed into a pure random noise spectrum; Step 3: Guided Denoising Based on Spectral Cross-Attention: Construct a temporal denoising network. At each time step of backdiffusion, the network uses the current noisy response spectrum as the query and the image spectral context generated in Step 1 as the key and value. It then predicts the noise spectrum to be removed through the temporal-spectral cross-attention module and iteratively updates the response spectrum. Step 4: Response Spectrum Decoding and Feature Localization: After the backdiffusion process, perform an inverse fast Fourier transform on each channel of the final denoised response spectrum to obtain... The response heatmap of each spatial domain is generated, and the category and center point coordinates of each element are extracted by peak detection and non-maximum suppression. Step 5: Bounding box refinement and multi-attribute recognition: Using the center point obtained in Step 4 as a reference, local features are extracted from the multi-scale deep feature map generated by the basis feature extraction network in Step 1, and input into a lightweight regression and classification head network to regress the precise bounding box of the feature and selectively identify more fine-grained attributes.

2. The method for identifying two-dimensional engineering drawing elements based on time-spectrum joint diffusion according to claim 1, characterized in that, The standardization preprocessing in step 1 specifically includes: Vector or raster paper is uniformly rendered and scaled / filled to a fixed size, lines are rendered to unit pixel width, and images are normalized to single-channel binary images; the basis feature extraction network uses a convolutional neural network or visual transformer pre-trained on a large image dataset, whose parameters are frozen in the feature recognition task.

3. The method for identifying two-dimensional engineering drawing elements based on time-spectrum joint diffusion according to claim 1, characterized in that, The formula for constructing the image spectral context in step 1 is: ; in, It is the output of the basis feature extraction network. Deep feature map of the channel It is a two-dimensional fast Fourier transform. It is a function that shifts the zero-frequency component to the center of the spectrum, ultimately yielding a complex tensor. .

4. The method for identifying two-dimensional engineering drawing elements based on time-spectrum joint diffusion according to claim 1, characterized in that, The calculation formula for the time-spectrum cross-attention module in step 3 is as follows: ; Among them, query From the noisy response spectrum Channel features and time step embedding Generated by complex linear projection after combination; bond Sum All are derived from the image spectral context Generated by different complex linear projections; This is the conjugate transpose. To perform the real part operation, It is the feature dimension of key K.

5. The method for identifying two-dimensional engineering drawing elements based on time-spectrum joint diffusion according to claim 1, characterized in that, Step 3 Temporal Denoising Network The training loss function is composed of L2 norm distance: ; in, It is a target response heatmap Fourier transform, It is standard complex Gaussian noise. It is the cumulative variance scheduling parameter of the forward diffusion process. It is the network in time step Noisy response spectrum and spectral context Predicting noise under certain conditions.

6. The method for identifying two-dimensional engineering drawing elements based on time-spectrum joint diffusion according to claim 1, characterized in that, Step 3 Temporal Denoising Network A spectrum transformer U-Net architecture is adopted, in which the standard convolutional blocks in the encoder and decoder are replaced with spectrum transformer blocks. These blocks sequentially contain a time-spectral cross-attention module, a spectrum self-attention module that operates on the channel and frequency dimensions, and a complex feedforward network. The linear projection and normalization layers inside the network are designed to support complex number operations.

7. The method for identifying two-dimensional engineering drawing elements based on time-spectrum joint diffusion according to claim 1, characterized in that, The peak detection in step 4 specifically involves: for each heatmap Apply confidence threshold filtering, and then perform non-maximum suppression through max pooling, retaining only the points whose values ​​are equal to the maximum values ​​in their neighborhoods as feature centers.

8. The method for identifying two-dimensional engineering drawing elements based on time-spectrum joint diffusion according to claim 1, characterized in that, In step 5, the input features for refining the bounding box come from the multi-level feature maps of the base feature extraction network. After being fused through the feature pyramid network structure, the RoIAlign operation is used to extract local features around the detected center point. The lightweight regression and classification head network contains parallel fully connected layers, which are used to regress the center point offset and width and height of the bounding box, and to classify the predefined fine-grained attributes, respectively.

9. A system for identifying two-dimensional drawing elements based on time-spectrum joint diffusion as described in any one of claims 1-8, characterized in that, include: Drawing preprocessing and context encoding module: used to perform the operation in step 1, realize the standardized processing of the input drawing, and encode and generate a static image spectrum context as a global condition; Guided response spectrum generation module: used to perform the operations in steps 2 and 3. Its core is a temporal denoising network based on spectral cross-attention. Guided by the image spectral context, the network iteratively denoises and gradually transforms a random noise spectrum into a final response spectrum containing the location information of all feature categories. The result decoding and refining module is used to perform the operations in steps 4 and 5. It obtains a spatial heat map by performing an inverse Fourier transform on the final response spectrum, and combines it with a lightweight detection head to finally output the category, precise location, and attribute information of all elements in the drawing.