Dimension line annotation data recognition model training method, recognition method and product

CN122966950APending Publication Date: 2026-10-23QINGDA ORIENTAL INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610982678.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-02
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

而现有技术中,难以利用网络模型对复杂背景下的尺寸线标注内容进行识别,导致对像素建筑工程图进行自动化智能审查的可靠性偏低

Benefits of technology

[0056]本申请实施例提供的尺寸线标注数据识别模型训练方法、识别方法及产品,通过根据尺寸线标注样本数据生成包括局部样本图像和对应掩膜图像的样本对集合,并将局部样本图像及对应掩膜图像输入数据识别代理模型进行图像特征提取,结合多次且空洞率不同的空洞卷积操作提取上下文特征,同时选取低层特征并计算低层结构特征,再将上采样后的上下文特征与低层结构特征进行融合拼接,以预测区域分割结果,并基于预测区域分割结果与分割标签之间的像素级差异对模型进行迭代训练,使得训练后的数据识别代理模型可以感知短尺寸线的局部连续性、长尺寸线的延伸关系以及尺寸线与周边背景线条之间的空间关系,并补充尺寸线边界位置、端点位置和细窄前景区域等细节信息,达到提升复杂背景下尺寸线标注内容识别准确性的效果,进而形成可用于后续审查与计算的结构化标注数据。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122966950A_ABST
    Figure CN122966950A_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a size line marking data recognition model training method, a recognition method and products, and relates to the technical field of image processing. The method comprises the following steps: generating a sample pair set according to size line marking sample data in a pixel building engineering sample image; inputting local sample images and corresponding mask images in the sample pair set into a data recognition agent model, and performing image feature extraction by using the data recognition agent model; extracting context features and low-layer structure features from the image feature extraction, and fusing and splicing the two to generate fusion features; generating a prediction region segmentation result of the local sample images and the corresponding mask images according to the fusion features, and iteratively training the data recognition agent model according to pixel-level differences between the prediction segmentation result and a segmentation label. The effect of improving the size line marking content recognition accuracy in a complex background is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method for training a model for recognizing dimension line annotation data, a recognition method, and a product. Background Technology

[0002] Architectural drawings are a fundamental and crucial type of data in the construction industry, reflecting a wealth of domain knowledge and basic data information throughout the building's design, construction, and subsequent operation and maintenance. Since signed and stamped PDF pixel-art architectural drawings are currently the primary legally valid delivery format, automated and intelligent review of pixel-art architectural drawings (PDFs or images) has become an important research direction within the industry.

[0003] Accurately identifying dimension lines in drawings is a crucial task in the automated intelligent review of pixel-based architectural drawings. However, current technologies struggle to utilize network models to identify dimension lines against complex backgrounds, resulting in low reliability for automated intelligent review of pixel-based architectural drawings. Therefore, how to accurately identify dimension lines in pixel-based architectural drawings using network models is a pressing issue that needs to be addressed. Summary of the Invention

[0004] This application provides a method for training a dimension line annotation data recognition model, an identification method, and a product, which can improve the accuracy of dimension line annotation content recognition in complex backgrounds and facilitate the formation of structured annotation data that can be used for subsequent review and calculation.

[0005] In a first aspect, embodiments of this application provide a method for training a dimension line annotation data recognition model, including:

[0006] Based on the dimension line annotation sample data in the pixel building engineering sample image, a sample pair set is generated. The sample pair set includes a one-to-one correspondence of local sample images and mask images. The local sample images correspond to local sample labels, and the mask images correspond to segmentation labels.

[0007] The local sample images and corresponding mask images in the sample pair set are input into the data recognition proxy model, and the image feature extraction is performed using the data recognition proxy model.

[0008] The image feature extraction results are subjected to dilated convolution operation to extract contextual features. The dilated convolution operation is performed multiple times, and the dilation rate of any two dilated convolution operations is different.

[0009] Low-level features are selected from the image feature extraction results, and low-level structural features of the low-level features are calculated through convolution operation.

[0010] The context features are upsampled, and the upsampled context features are then fused and concatenated with the low-level structural features to generate fused features;

[0011] Based on the fusion features, the predicted region segmentation results of the local sample image and the corresponding mask image are generated. Based on the pixel-level difference between the predicted segmentation result and the segmentation label, the data recognition proxy model is iteratively trained. The trained data recognition proxy model is used to recognize the dimension line annotation data in the pixel architectural engineering drawing.

[0012] In one possible implementation, a set of sample pairs is generated based on the dimension line annotation sample data in the pixel architectural engineering sample image, specifically including:

[0013] Read the dimension line annotation sample data from the pixel architectural engineering sample image, and perform local cropping on the area of ​​the dimension line annotation sample data in the pixel architectural engineering sample image to generate a local sample image and the corresponding local sample label;

[0014] Generate the corresponding mask image and segmentation label based on the local sample image and local sample label;

[0015] A set of sample pairs is formed based on the local sample image, local sample label, mask image, and segmentation label.

[0016] In one possible implementation, the region of the dimension line annotation sample data in the pixel architectural engineering sample image is locally cropped to generate a local sample image and a corresponding local sample label, specifically including:

[0017] Calculate the minimum bounding box of the circumscribed axis aligned rectangle based on the coordinates of the sample data marked by the dimension lines.

[0018] When the size of the bounding box of the smallest outer axis aligned rectangle is smaller than the preset clipping window, the region in the pixel architectural engineering sample image is locally clipped to generate a local sample image.

[0019] Based on the annotation results of the dimension line annotation sample data, local sample labels are generated through coordinate transformation.

[0020] In one possible implementation, local cropping of a region in the pixel architectural engineering sample image specifically includes:

[0021] The first range of values ​​for the cropping center point is determined based on the region coordinates of the bounding box of the minimum circumscribed axis and the half-side length of the preset cropping window.

[0022] The second range of values ​​for the cropping center point is determined based on the half-side length of the preset cropping window and the size of the pixel architectural engineering sample image.

[0023] Determine the coordinates of the cutting center point based on the first and second value ranges;

[0024] Based on the half-length of the preset cropping window and the coordinates of the cropping center point, a local cropping is performed on the area in the pixel architectural engineering sample image.

[0025] In one possible implementation, the method further includes:

[0026] When the cropping boundary of the local sample image is outside the pixel architectural engineering sample image, pixel filling processing is performed on the cropped image to generate a local sample image, wherein the pixel value of the filling is 255.

[0027] Secondly, embodiments of this application provide a method for identifying dimension line annotation data, including:

[0028] Obtain a pixel-based architectural drawing and input the pixel-based architectural drawing into a trained data recognition proxy model to recognize the dimension line annotation data in the pixel-based architectural drawing. The trained data recognition proxy model is a model determined according to the first aspect and / or various possible implementations of the first aspect described above.

[0029] Thirdly, embodiments of this application provide a training device for a dimension line annotation data recognition model, comprising:

[0030] The sample generation module is used to generate a set of sample pairs based on the dimension line annotation sample data in the pixel architectural engineering sample image. The set of sample pairs includes a one-to-one correspondence of local sample images and mask images. The local sample images have local sample labels, and the mask images have segmentation labels.

[0031] The feature extraction module is used to input local sample images and corresponding mask images from the sample pair set into the data recognition proxy model, and use the data recognition proxy model to extract image features.

[0032] The feature extraction module is also used to perform dilated convolution operations on the image feature extraction results to extract contextual features. The dilated convolution operation is performed multiple times, and the dilation rate is different for any two dilated convolution operations.

[0033] The feature extraction module is also used to select low-level features from the image feature extraction results and to calculate the low-level structural features of the low-level features through convolution operations.

[0034] The feature fusion module is used to upsample the context features and then fuse and concatenate the upsampled context features with the low-level structure features to generate fused features.

[0035] The iterative training module is used to generate predicted region segmentation results of local sample images and corresponding mask images based on fusion features, and to iteratively train the data recognition proxy model based on the pixel-level difference between the predicted segmentation results and the segmentation labels. The trained data recognition proxy model is used to recognize the dimension line annotation data in pixel architectural engineering drawings.

[0036] In one possible implementation, the sample generation module specifically includes:

[0037] The local sample generation submodule is used to read the dimension line annotation sample data in the pixel architectural engineering sample image, and to locally crop the area of ​​the dimension line annotation sample data in the pixel architectural engineering sample image to generate a local sample image and the corresponding local sample label.

[0038] The mask generation submodule is used to generate the corresponding mask image and segmentation label based on the local sample image and local sample label;

[0039] The sample generation submodule is used to form a set of sample pairs based on local sample images, local sample labels, mask images, and segmentation labels.

[0040] In one possible implementation, the local sample generation submodule specifically includes:

[0041] The bounding box calculation unit is used to calculate the minimum circumscribed axis aligned bounding box based on the coordinates of the sample data labeled with dimension lines.

[0042] The cropping unit is used to locally crop a region in the pixel architectural engineering sample image and generate a local sample image when the size of the bounding box of the smallest outer axis aligned rectangle is smaller than the preset cropping window.

[0043] The label unit is used to generate local sample labels based on the annotation results of the dimension line annotation sample data through coordinate transformation.

[0044] In one possible implementation, when the cropping unit performs local cropping on a region in the pixel architectural engineering sample image, it specifically includes:

[0045] The first range of values ​​for the cropping center point is determined based on the region coordinates of the bounding box of the minimum circumscribed axis and the half-side length of the preset cropping window.

[0046] The second range of values ​​for the cropping center point is determined based on the half-side length of the preset cropping window and the size of the pixel architectural engineering sample image.

[0047] Determine the coordinates of the cutting center point based on the first and second value ranges;

[0048] Based on the half-length of the preset cropping window and the coordinates of the cropping center point, a local cropping is performed on the area in the pixel architectural engineering sample image.

[0049] In one possible implementation, the device further includes:

[0050] The fill module is used to perform pixel fill processing on the cropped image when the cropping boundary of the local sample image is outside the pixel architectural engineering sample image, so as to generate a local sample image. The fill pixel value is 255 during the fill processing.

[0051] Fourthly, embodiments of this application provide a dimension line annotation data recognition device, including: a memory and a processor;

[0052] The memory stores the instructions that the computer executes;

[0053] The processor executes computer execution instructions stored in memory, causing the processor to execute the first aspect and / or the various possible dimension line annotation data recognition model training methods of the first aspect, or to execute the dimension line annotation data recognition method of the second aspect.

[0054] Fifthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions. When executed by a processor, the computer-executable instructions are used to implement the first aspect and / or various possible dimension line annotation data recognition model training methods of the first aspect, or to execute the dimension line annotation data recognition method of the second aspect described above.

[0055] In a sixth aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible dimension line annotation data recognition model training methods of the first aspect, or executes the dimension line annotation data recognition method of the second aspect described above.

[0056] The dimension line annotation data recognition model training method, recognition method, and product provided in this application generate a set of sample pairs, including local sample images and corresponding mask images, based on dimension line annotation sample data. The local sample images and corresponding mask images are then input into a data recognition proxy model for image feature extraction. Contextual features are extracted by combining multiple dilated convolution operations with different dilation rates. Simultaneously, low-level features are selected and low-level structural features are calculated. The upsampled contextual features and low-level structural features are then fused and concatenated to predict the region segmentation result. The model is iteratively trained based on the pixel-level difference between the predicted region segmentation result and the segmentation label. This allows the trained data recognition proxy model to perceive the local continuity of short dimension lines, the extension relationship of long dimension lines, and the spatial relationship between dimension lines and surrounding background lines. It also supplements detailed information such as the boundary position, endpoint position, and narrow foreground region of the dimension lines, thereby improving the accuracy of dimension line annotation content recognition in complex backgrounds and forming structured annotation data that can be used for subsequent review and calculation. Attached Figure Description

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

[0058] Figure 1 A flowchart illustrating the training method for the dimension line annotation data recognition model provided in this application. Figure 1 ;

[0059] Figure 2 A flowchart illustrating the training method for the dimension line annotation data recognition model provided in this application. Figure 2 ;

[0060] Figure 3 Schematic diagram of the structure of the dimension line annotation data recognition model training device provided in this application Figure 1 ;

[0061] Figure 4 Schematic diagram of the structure of the dimension line annotation data recognition model training device provided in this application Figure 2 ;

[0062] Figure 5 A schematic diagram of the structure of the dimension line annotation data recognition device provided in this application.

[0063] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0064] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.

[0065] Pixel-based intelligent recognition of architectural engineering drawings belongs to the field of engineering drawing digitization processing and image analysis technology, and is mainly applied in scenarios such as architectural design, construction review, and digitization of drawing archives. In these scenarios, the system typically needs to receive architectural engineering drawings in PDF or image format and automatically recognize the dimension-related annotations in the drawings to support subsequent verification, comparison, and structured storage.

[0066] In existing technologies, the identification of dimension information in pixel-based architectural engineering drawings typically employs rule analysis, marker detection, or image processing methods. For example, candidate dimension lines can be filtered based on geometric rules such as line segment length, direction, and relative position, or the dimension annotation area can be located by recognizing associated markers such as dimension numbers and arrows. Some solutions also improve the recognition effect through image enhancement, cropping, or local analysis.

[0067] However, in actual architectural drawings, dimension lines are often long and thin linear structures with significant directional changes. At the same time, the background information, such as wall outlines, component boundary lines, grid lines, text annotations, and dimension figures, is complex. This makes it easy for rule-based or local feature-based recognition methods to misidentify background lines as dimension lines or to miss dimension lines in inclined, adjacent, or overlapping states.

[0068] For unstructured pixel data such as PDFs or images, it is impossible to directly extract dimension line structure information that can be processed automatically, making it difficult to directly form structured annotation data that can be used for subsequent review and calculation.

[0069] Therefore, improving the accuracy and stability of dimension line annotation data recognition in pixel-based architectural engineering drawings under complex backgrounds and multi-directional lines has become an urgent technical problem to be solved.

[0070] To address the aforementioned issues, this application provides a method for training a dimension line annotation data recognition model. This method generates a set of sample pairs, including local sample images and mask images, based on dimension line annotation sample data from pixel-based architectural engineering sample images. The sample pair set is then input into a data recognition proxy model for image feature extraction. The extracted results are subjected to multiple dilated convolutions with different dilation rates to obtain contextual features. Low-level features are selected and convolved to obtain low-level structural features. The upsampled contextual features are then fused and concatenated with the low-level structural features. Based on the fused features, a predicted region segmentation result is generated. The model is iteratively trained based on the pixel-level difference between the predicted segmentation result and the segmentation label. This allows the trained data recognition proxy model to be used for dimension line annotation data recognition in pixel-based architectural engineering images, thereby improving the accuracy of dimension line annotation content recognition in complex backgrounds.

[0071] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0072] Figure 1 A flowchart illustrating the training process for the dimension line annotation data recognition model provided in this application. Figure 1 ,like Figure 1 As shown, the method includes:

[0073] S101: Generate a set of sample pairs based on the dimension line annotation sample data in the pixel architectural engineering sample image. The set of sample pairs includes a one-to-one correspondence of local sample images and mask images. The local sample images have local sample labels, and the mask images have segmentation labels.

[0074] For example, the pixel-based architectural engineering sample image can be a PDF drawing, a scanned drawing, a screenshot, or an image-formatted engineering drawing. Dimension line annotation sample data is used to characterize the location range of the relevant areas of the dimension lines in the original engineering drawing, serving as the basic input for sample construction. The sample pair set represents the paired organization of the training data, and in specific implementations, it can be stored in the form of a list, index table, or sample file list. Each item includes at least the correspondence between the local sample image, local sample label, mask image, and segmentation label.

[0075] Local sample images are used to characterize the local image content in the sample image. The mask image is the supervision image corresponding to the local sample image. The local sample label is the annotation result corresponding to the local sample image. The segmentation label is the labeling information used for pixel-level supervision.

[0076] In one example, a local sample image can be determined based on the dimension line labeled sample data, and a local sample label, mask image, and segmentation label corresponding to the local sample image can be generated.

[0077] This application embodiment constructs a set of sample pairs corresponding to the dimension line annotation area and maintains the correspondence between local sample labels and segmentation labels, which enables subsequent training to carry out supervised learning for the dimension line annotation area, thereby reducing interference from complex backgrounds.

[0078] S102: Input the local sample images and corresponding mask images from the sample pair set into the data recognition proxy model, and use the data recognition proxy model to extract image features.

[0079] For example, the data recognition proxy model is the main body of the model that performs image recognition and segmentation training, and can be deployed on a server, graphics processor, or processing device with neural network inference capabilities. The model receives local sample images and corresponding mask images from the sample pair set, forms training batches according to a pre-set data reading order, and then performs normalization, channel arrangement, and tensor quantization processing before sending them into the encoding network.

[0080] Image feature extraction refers to the process of extracting basic representation information from an input image layer by layer. In practice, it can be accomplished step by step through convolutional layers, batch normalization layers, and nonlinear activation layers, thereby forming feature maps with different resolutions and semantic levels.

[0081] The local sample image carries the pixel distribution of the size line, arrow, digit neighborhood and background line, while the mask image carries the supervision information of the corresponding position. The two maintain a correspondence during the training phase, enabling the model to establish a mapping between the image appearance and the target region during training.

[0082] In one example, the images in the sample pairs and the corresponding supervision information are used for model training. For instance, a data recognition proxy model can employ a backbone network consisting of multiple convolutional blocks. The first two convolutional blocks output higher-resolution shallow / low-level features, while subsequent convolutional blocks output semantically stronger but lower-resolution high-level features. Each convolutional block can include 3×3 convolutions, downsampling convolutions with a stride of 1 or 2, batch normalization, and Rectified Linear Unit (ReLU) activation operations, thereby extracting more stable structural representations while preserving dimension line edge information.

[0083] For example, for the k-th sample S k For [the specific value], its expression can be:

[0084]

[0085] Among them, Ik M represents a local sample image. b,k This indicates the corresponding standardized dimension line segmentation label.

[0086] First, analyze the local sample image I. k Convolutional feature extraction is performed to obtain feature maps F at different levels. l :

[0087]

[0088] Among them, F l f represents the feature map of the l-th layer. l This indicates a feature extraction backbone network based on convolutional operations. For example, a deep residual network ResNet101 can be selected. The network parameters of the deep residual network ResNet101 are shown in Table 1.

[0089] Table 1

[0090]

[0091] After extraction, low-level features retain high spatial resolution and edge details, which can be used to express local geometric information such as the edges, endpoints, and narrow structures of dimension lines; high-level features contain stronger semantic information and contextual expression, which can be used to distinguish the differences between dimension lines and background lines such as wall lines, grid lines, and component boundary lines.

[0092] In another example, the image feature extraction results include at least a set of low-level features and a set of high-level features. The low-level features preserve details such as endpoints, line widths, and intersection positions, while the high-level features encode the regional relationship between the dimension lines and the background, the contextual layout of adjacent components, and the overall distribution of dimension annotations in the local region.

[0093] Through the above process, step S102 maps the local sample image into a multi-level feature representation, providing a unified feature basis for subsequent multi-scale context modeling and low-level structure compensation, so that targets such as slender lines with large directional changes can form separable representations within the network.

[0094] S103: Perform dilated convolution operation on the image feature extraction results to extract contextual features. The dilated convolution operation is performed multiple times, and the dilation rate of any two dilated convolution operations is different.

[0095] For example, contextual features are features calculated further from the high-level features in the image feature extraction results, and are used to characterize the spatial relationship between dimension lines and the surrounding background, adjacent annotations, component boundaries and drawing layout.

[0096] Dilated convolution expands the receptive field by introducing a gap between the sampling points of the convolution kernel, extracting more information without significantly reducing resolution. Multiple dilated convolutions with different dilation rates indicate that at least two sets of convolution processes with different dilation rates are performed on the same high-level feature map to construct multi-scale contextual information.

[0097] In one example, dilated convolution operations with different dilation rates can be used to extract contextual features:

[0098]

[0099] Among them, F L Represents high-level feature maps. (⋅) represents a dilated convolution operation with a dilation rate of r, where R represents the set of multi-scale parameters. Contextual features under different receptive fields can respectively perceive the local continuity of short-size lines, the extension relationship of long-size lines, and the spatial relationship between the length lines and the surrounding background lines.

[0100] For example, high-level feature map F L The high-level feature map output from the fourth stage of the aforementioned deep residual network ResNet101 has 2048 channels; R contains four dilation rates: 1, 12, 24, and 36; dilated convolutions with the four dilation rates are applied to the high-level feature map F. L Perform dilated convolution operations to generate contextual features. , , , The number of channels for all context features is 512.

[0101] Subsequently, multi-scale contextual features F are obtained through convolution operations. c :

[0102]

[0103] in, (⋅) represents dilated convolution, and Concat(⋅) represents concatenation along the channel dimensions.

[0104] Through the above processing, the trained model can simultaneously perceive the local details of the dimension line and the linear continuous structure over a longer range, thereby enhancing its ability to identify dimension line targets of different lengths and directions.

[0105] S104: Select low-level features from the image feature extraction results, and calculate the low-level structural features of the low-level features through convolution operation.

[0106] For example, low-level features are high-resolution feature maps output from shallower layers of the encoding network, which retain more information about edges, endpoints, line widths, and local geometric contours. Low-level structural features are structural representations further refined through convolution operations based on low-level features, used to compensate for the loss of detail caused by downsampling in high-level context features.

[0107] For dimension line annotation data, the endpoint arrow connection, short dimension lines, dense parallel dimension lines, and dimension lines that are close to the background axis lines all rely on higher resolution local structural information to achieve finer pixel positioning. Therefore, this step S104 is used to maintain the boundary continuity of slender targets.

[0108] In one example, a low-level feature F with high spatial resolution can be selected. low Low-level structure features F are calculated through convolution operations. d :

[0109]

[0110] In the formula, the low-level features F low The low-level feature map output from the first stage of the aforementioned deep residual network ResNet101 has 256 channels; the low-level structural features F are calculated through convolution. d The number of channels is 48.

[0111] S105: Upsample the context features and then fuse and concatenate the upsampled context features with the low-level structural features to generate fused features.

[0112] For example, contextual features are derived from high-level semantic branches, which have a lower resolution than low-level structural features; upsampling is used to recover the spatial scale of the contextual features, aligning them with the low-level structural features in width and height.

[0113] Fusion and splicing represent merging two complementary features from different sources in the same spatial coordinate system to form a fused feature that simultaneously contains global semantic and local structural information. The quality of this fused feature, as the direct input to the subsequent output layer, determines the detail and overall consistency of the boundaries of the segmented regions.

[0114] In one example, contextual features can be upsampled using bilinear interpolation, for instance, by restoring them from one-sixteenth resolution of the input image to one-quarter resolution, making them consistent with the size of low-level structural features.

[0115] Then, a fusion and stitching process is performed along the channel dimension, which connects the upsampled context features and the low-level structural features along the channel axis to obtain an intermediate feature map with the number of channels equal to the sum of the two.

[0116] To ensure that the information from different sources is represented in a unified manner after fusion, two more 3×3 convolutional layers can be applied after splicing. Each convolutional layer is followed by batch normalization and ReLU activation, and the output is the fused feature.

[0117] In another example, the fusion feature can be expressed by the following formula:

[0118]

[0119] In the formula, F f This represents the fused features, which are the decoded features. Up indicates the upsampling operation, and Concat(⋅) indicates concatenation along the channel dimensions.

[0120] By fusing high-level contextual features with low-level detail features in this way, the trained model can not only use contextual information to distinguish dimension lines from ordinary building background lines, but also maintain the slender boundaries and local continuity of dimension line targets.

[0121] S106: Based on the fusion features, generate the predicted region segmentation results of the local sample image and the corresponding mask image, and iteratively train the data recognition proxy model based on the pixel-level difference between the predicted region segmentation results and the segmentation labels. The trained data recognition proxy model is used to recognize the dimension line annotation data in the pixel architectural engineering drawing.

[0122] For example, the predicted region segmentation result is a pixel-level prediction map output by the model corresponding to the local sample image space, used to represent the probability or category of each pixel belonging to the foreground or background of the dimension line-labeled region. The pixel-level difference represents the deviation between the predicted region segmentation result and the segmentation label at each pixel position, which serves as the basis for the training loss. Iterative training means that through multiple rounds of forward computation, loss calculation, and parameter updates, the weight parameters of the data recognition surrogate model are continuously corrected, so that the model gradually converges to a state in which it can stably recognize dimension line-labeled data.

[0123] In one example, the input features are fused to segment the output layer. The output layer can consist of 1×1 convolutions, mapping the channel features to a single-channel foreground probability map or a dual-channel classification score map. If the output is a single-channel probability map, the sigmoid function can be used to obtain the probability value of each pixel belonging to the size line region; if the output is a dual-channel classification map, the softmax function can be used to obtain the normalized probabilities of the foreground and background.

[0124] In another example, the fusion feature F obtained in step S105 above can be set. f Perform foreground (size line pixel region) / background (other background pixel regions) classification, and output the predicted probability map of the size line region. The corresponding expression can be:

[0125]

[0126] Here, g(·) represents the pixel-level classification mapping function, and Norm(·) represents the probability normalization operation. The g(·) and Norm(·) operations can be combined and implemented using the Softmax function or the Sigmoid function, depending on the specific segmentation network.

[0127] set up (u,v)∈[0,1] represents the probability that pixel (u,v) belongs to the foreground region of the dimension line. The predicted region segmentation result of the dimension line region can be obtained based on the predicted probability map. :

[0128]

[0129] In the formula, τ is the foreground determination threshold, which can be set according to the situation, such as 0.5.

[0130] During training, the pixel-level difference between the predicted region segmentation result and the segmentation label is used as the supervision signal. The loss function can be binary cross-entropy loss, Dice (Dice Coefficient) loss, or a weighted combination of the two. Alternatively, the pixel-level cross-entropy loss function commonly used in semantic segmentation tasks can be used.

[0131] For special data scenarios where the foreground region of dimension lines has a small pixel proportion, there are many samples of extremely fine dimension lines, or there is strong interference from background lines, a foreground weight coefficient can be introduced into the pixel-level cross-entropy loss. This allows the model to pay more attention to the foreground region of the dimension lines during training. The corresponding loss function can be expressed as:

[0132]

[0133] In the formula, H and W are determined by the size of the pixel architectural engineering sample image, and α is the foreground weight coefficient, used to enhance the influence of foreground pixels on model training. When no foreground weighting is set, α=1.

[0134] In this embodiment of the application, the loss function can also be used to backpropagate and iteratively update the various parameters in the model during the above process.

[0135] Let the parameters of all neural networks be Θ in the t-th iteration. t If the learning rate is η, then the parameter update process can be expressed as:

[0136]

[0137] In the formula, This represents the gradient of the loss function calculated using its derivative.

[0138] Based on the above analysis, step S106 uses segmentation labels as supervision signals to impose pixel-level error constraints, enabling the model to learn the mapping relationship between local sample images and dimension line regions, thus obtaining a data recognition proxy model for dimension line targets in engineering drawings. During training, this model not only utilizes local edge and texture information of dimension lines but also combines multi-scale contextual information and low-level structural details, thereby improving its ability to recognize dimension line targets under interference from slender dimension lines, dimension lines in different directions, and complex background lines. Furthermore, the model can learn the differential features between various shaped dimension line targets and complex background lines during training, thereby enhancing its generalized recognition ability for dimension line targets in complex engineering drawings.

[0139] This application provides a method for training a dimension line annotation data recognition model, comprising: generating a set of sample pairs including local sample images, local sample labels, mask images, and segmentation labels based on dimension line annotation sample data in a pixel architectural engineering sample image; inputting the set of sample pairs into a data recognition proxy model for image feature extraction; performing multiple dilated convolutions with different dilation rates on the high-level features in the extraction results to obtain contextual features; performing convolution processing on the low-level features in the extraction results to obtain low-level structural features; fusing and splicing the upsampled contextual features and low-level structural features to form fused features; outputting a predicted region segmentation result based on the fused features; and iteratively training the data recognition proxy model based on the pixel-level difference between the predicted region segmentation result and the segmentation label. The data recognition proxy model trained by the above method can perceive the local continuity of short dimension lines, the extension relationship of long dimension lines, and the spatial relationship between dimension lines and surrounding background lines, and supplement detailed information such as the boundary position, endpoint position, and narrow foreground region of dimension lines, thereby improving the accuracy of dimension line annotation content recognition in complex backgrounds and forming structured annotation data that can be used for subsequent review and calculation.

[0140] Figure 2 A flowchart illustrating the training method for the dimension line annotation data recognition model provided in this application. Figure 2 ,like Figure 2 As shown, in this embodiment... Figure 1 Based on the examples, the training method for the dimension line annotation data recognition model is described in detail. The method includes:

[0141] S201: Read the dimension line annotation sample data in the pixel architectural engineering sample image, and perform local cropping on the area of ​​the dimension line annotation sample data in the pixel architectural engineering sample image to generate a local sample image and the corresponding local sample label.

[0142] S202: Generate the corresponding mask image and segmentation label based on the local sample image and local sample label;

[0143] S203: Based on the local sample image, local sample label, mask image, and segmentation label, form a set of sample pairs;

[0144] S204: Input the local sample images and corresponding mask images from the sample pair set into the data recognition proxy model, and use the data recognition proxy model to extract image features;

[0145] S205: Perform dilated convolution operation on the image feature extraction results to extract contextual features. The dilated convolution operation is performed multiple times, and the dilation rate of any two dilated convolution operations is different.

[0146] S206: Select low-level features from the image feature extraction results, and calculate the low-level structural features of the low-level features through convolution operation;

[0147] S207: Upsample the context features and then fuse and concatenate the upsampled context features with the low-level structure features to generate fused features;

[0148] S208: Based on the fusion features, generate the predicted region segmentation results of the local sample image and the corresponding mask image, and iteratively train the data recognition proxy model based on the pixel-level difference between the predicted segmentation results and the segmentation labels. The trained data recognition proxy model is used to recognize the dimension line annotation data in the pixel architectural engineering drawing.

[0149] For example, the pixel-based architectural engineering sample image can be a PDF drawing, a scanned drawing, a screenshot, or an image-formatted engineering drawing. Dimension line annotation sample data includes dimension lines, leader lines, arrows, and dimension-related annotation areas. The cropping size of the local sample image can be set to a fixed size. If the cropped image edge is insufficient for the preset size, pixel padding is used to fill the gap, ensuring that subsequent training samples maintain a consistent input specification. In practical applications, other parameters can be selected for the cropping size and padding method; this application does not limit this selection.

[0150] In one example, the sample pair set consists of paired local sample images, local sample labels, mask images, and segmentation labels. Each data pair corresponds to the same dimension line-annotated sample data and maintains consistent registration. This sample pair set is used for subsequent input data recognition proxy models, enabling the model to learn the structural features of the dimension line-annotated regions under the combined effect of local context and pixel-level supervision.

[0151] In this embodiment, by using local cropping, label mapping, and mask generation, the complex background and target annotations in the original engineering drawing can be effectively associated with unified training samples, thereby improving the availability of sample data and enabling subsequent segmentation learning to obtain stable supervision information.

[0152] In one possible implementation, the region of the dimension line annotation sample data in the pixel architectural engineering sample image is locally cropped to generate a local sample image and a corresponding local sample label. Specifically, this includes: calculating the minimum bounding box aligned to the minimum outer axis based on the coordinates of the dimension line annotation sample data; when the size of the minimum bounding box is smaller than a preset cropping window, the region in the pixel architectural engineering sample image is locally cropped to generate a local sample image; and generating local sample labels based on the annotation results of the dimension line annotation sample data through coordinate transformation.

[0153] For example, the input pixel-based architectural drawings in PDF or image format are read. The image format can be JPG, PNG, or other image formats. The specific reading method is not limited in this application embodiment.

[0154] Then, read the annotation data of all dimension lines in any pixel-level architectural engineering sample drawing, including the outline pixel coordinates of the dimension lines in the original architectural engineering drawing. During the reading process, the position of the dimension lines can be manually marked on the original architectural engineering drawing using annotation tools, and the position of the dimension lines can be represented by the bounding box.

[0155] The format of dimension line annotation data in pixel-based architectural drawings can include four types:

[0156] (1) The form with category information is x_center-y_center-width-height-angle. Where x_center represents the x-coordinate of the center point of the bounding box, y_center represents the y-coordinate of the center point of the bounding box, width represents the width of the bounding box, height represents the height of the bounding box, and angle represents the angle of the bounding box relative to the horizontal direction;

[0157] (2) The x_center-y_center-width-height-angle form without category information. Where x_center represents the x-coordinate of the center point of the bounding box, y_center represents the y-coordinate of the center point of the bounding box, width represents the width of the bounding box, height represents the height of the bounding box, and angle represents the angle of the bounding box relative to the horizontal direction;

[0158] (3) A list of the coordinates of the four vertices of a bounding box without category information;

[0159] (4) A list of the coordinates of the four vertices of a bounding box with category information.

[0160] These annotation results are typically stored in TXT format files, with each line representing one annotation data point. After reading the dimension line annotation data from the original drawing, the annotation results in different formats are parsed uniformly.

[0161] Next, calculate the pixel coordinates of the four vertices of the dimension line bounding box in the original drawing.

[0162] Taking dimension line annotation data in the form of x_center-y_center-width-height-angle with category information as an example, let the coordinates of the center point of the dimension line target be... Given a width of w, a height of h, and a rotation angle of θ, we first construct four relative corner points in the local coordinate system. Then, it is transformed back to the original drawing coordinate system using a rotation matrix. The calculation formula is as follows:

[0163]

[0164] in, Take in sequence .

[0165] Through the above process, the pixel coordinates of the four vertices of the dimension line bounding box in the original drawing can be calculated.

[0166] In one example, the size of the local clipping window can be set to a fixed value, such as 480×480 pixels. Based on the pixel coordinates of the four vertices of the dimension line bounding box calculated earlier in the original drawing, the minimum circumscribed axis aligned rectangular bounding box is calculated. That is, the coordinates of the upper left and lower right corners of the corresponding area are calculated, and the horizontal range, vertical range and center position of the dimension line target are determined according to the rectangular area.

[0167] Based on the pixel coordinates of the four vertices of the dimension line bounding box in the original drawing, calculate the minimum circumscribed axis aligned rectangular bounding box, that is, calculate the coordinates of the upper left and lower right corners of the corresponding area, and determine the horizontal range, vertical range and center position of the dimension line target based on the rectangular area.

[0168] When the width and height of the bounding box of the minimum circumscribed axis are both smaller than the preset clipping window, the center of the bounding box or the center of the annotation is used as the clipping reference to extract the corresponding area from the original pixel architectural engineering sample image to form a local sample image.

[0169] When cutting, the cutting window can be directly covered by the target area, or the cutting position can be shifted and corrected while keeping the target dimension line in the middle of the window, so that the wall lines, grid lines and adjacent component lines around the dimension line are preserved.

[0170] The local sample labels are based on the original annotation results and coordinate mapping is performed. The coordinates of the annotation points in the original image are subtracted from the cropping offset. If necessary, the cropping scale is also combined for scaling transformation to obtain the label coordinates in the same coordinate system as the local sample image, ensuring that the image content and label information correspond one-to-one.

[0171] Through the processing described in this embodiment, the dimension line annotation sample data forms an image-label pairing relationship within a local area. The local sample image can centrally represent the dimension line and its neighborhood structure, while the local sample label completely maintains the positional relationship of the original label in the cropped coordinate system, thus providing a consistent input basis for subsequent sample pair set construction and model training. Therefore, the target area in the pixel-based architectural engineering sample image is limited to a suitable cropping window, enabling the generation of stable local training samples without disrupting the label correspondence, and improving the recognizability and sample utilization rate of the dimension line annotation data in complex engineering drawing backgrounds.

[0172] In one possible implementation, partial cropping of a region in a pixel architectural engineering sample image specifically includes: determining a first range of values ​​for the cropping center point based on the region coordinates of the bounding box aligned to the minimum circumscribed axis and half the length of a preset cropping window; determining a second range of values ​​for the cropping center point based on half the length of the preset cropping window and the size of the pixel architectural engineering sample image; determining the coordinates of the cropping center point based on the first and second ranges; and performing partial cropping of the region in the pixel architectural engineering sample image based on half the length of the preset cropping window and the coordinates of the cropping center point.

[0173] For example, before performing local cropping on a region in a pixel architectural engineering sample image, the selectable range of the center point of the local cropping window is calculated based on the size relationship between the bounding box region of the minimum circumscribed axis aligned to the target dimension line annotation data and the set local cropping window size. The cropping center position is then selected within this selectable range, so that the cropping window covers the entire target dimension line while retaining the neighborhood context information within a certain range around it.

[0174] When the area size of the bounding box of the rectangle whose smallest outer axis is aligned is larger than the preset clipping window size, the target can be regarded as an overscale target and the current clipping process can be skipped, or it can enter a subsequent separate processing flow.

[0175] The original pixel architectural drawing size is set to 1600*1000 pixels, the partial cropping window size is 480*480 pixels, and the minimum bounding axis aligned rectangle area for a certain dimension line annotation data is [620, 300, 700, 360], i.e., x min =620, y min =300, x max =700, y max =360.

[0176] When the area size of the bounding box of the smallest circumscribed axis is smaller than the preset clipping window, since the half-side length of the clipping window is 240 pixels, taking the horizontal direction as an example, to ensure that the dimension line annotation data falls completely within the local clipping window, the first value range that the clipping center point of the local clipping window should satisfy in the horizontal direction can be expressed as:

[0177]

[0178] Meanwhile, to ensure that the clipping window does not exceed the boundary of the original pixel architectural drawing, the second value range that the clipping center point should satisfy can be expressed as:

[0179]

[0180] Therefore, the final range of options in the horizontal direction is:

[0181]

[0182] Similarly, in the vertical direction, the corresponding final range of options is:

[0183]

[0184]

[0185]

[0186] Therefore, when performing local clipping, the clipping center point of the local clipping window can be selected within the above selectable range for local clipping. For example, if (660, 390) is selected as the clipping center point, the horizontal range of the corresponding local clipping window is [420, 900], and the vertical range is [150, 630]. This range can completely cover the minimum circumscribed axis aligned rectangle area [620, 300, 700, 360] of the dimension line annotation data set above, and retain its surrounding neighborhood context information.

[0187] In this embodiment, the selectable range of the center point of the clipping window is determined by two types of constraints: one is the target complete coverage constraint, that is, the left boundary of the clipping window is not greater than the left boundary of the target area and the right boundary is not less than the right boundary of the target area; the other is the drawing boundary constraint, that is, the entire clipping window must not exceed the original drawing area. By finding the intersection of the above two types of constraints, the final selectable range of the center point of the clipping window can be obtained.

[0188] After adopting the above method, the local sample images obtained by local cropping have better target integrity and size consistency, which facilitates the subsequent generation of local sample labels and mask images and improves the stability of sample pair construction. Since the cropping center point is constrained by a dual range, the cropping region is less likely to exceed the boundary or be truncated, thereby improving the consistency and effectiveness of sample input during the training of the size line labeled data recognition model.

[0189] In one possible implementation, the method further includes:

[0190] When the cropping boundary of the local sample image is outside the pixel architectural engineering sample image, pixel filling processing is performed on the cropped image to generate a local sample image, wherein the pixel value of the filling is 255.

[0191] For example, the effective area can first be cropped from the pixel architectural engineering sample image according to the cropping center point and the preset window size. Then, a fixed pixel value of 255 is written to the area that exceeds the image boundary and cannot be valued, so that the padded image is consistent with the preset cropping window in width and height. Since 255 corresponds to the white pixel in the grayscale image or single-channel image, it can also be used as a uniform fill value in the multi-channel image. Therefore, the padded area can be clearly distinguished from the original architectural lines, dimension lines and text information.

[0192] In this embodiment of the application, after obtaining the local sample image through the above process, the coordinates of the upper left corner of the preset cropping window in the pixel architectural engineering sample image can be calculated, and the coordinates of the bounding box of the dimension line in the original annotation data can be translated and transformed to convert the dimension line annotation result in the coordinate system of the pixel architectural engineering sample image into the annotation result in the coordinate system of the local sample image.

[0193] Taking dimension line annotation data in the form of x_center-y_center-width-height-angle with category information as an example, the position offset (translation transformation) of the center point coordinates (x_center, y_center) is performed, while the width, height and angle parameters remain unchanged, thereby generating local labels while preserving the original annotation format.

[0194] When the original label is in the form of a list of four vertex coordinates of a bounding box without category information or a list of four vertex coordinates of a bounding box with category information, position offset is performed on the four vertex coordinates to obtain the four point position labels in the local sample.

[0195] Through the above process, local sample images and their corresponding local dimension line annotations can be obtained simultaneously, while maintaining the consistency between the local labels and the original label format.

[0196] Next, the dimension line annotation data in the local sample image is read and converted into a pixel-level segmentation mask.

[0197] When the local dimension line annotation data is in the form of a list of four vertex coordinates of a bounding box without category information or a list of four vertex coordinates of a bounding box with category information, a closed contour is directly generated based on the polygon vertex coordinates, and a fill function is used to perform a fill operation on the inner region of the contour to obtain the dimension line target mask image.

[0198] When the local dimension line annotation data is in the form of x_center-y_center-width-height-angle with category information or in the form of x_center-y_center-width-height-angle without category information, firstly, according to the center point coordinates (x_center, y_center), width (width), height (height), and angle (angle) parameters, the pixel coordinates of the four vertices of the dimension line bounding box in the original drawing are calculated according to the above process. Then, the fill function performs a fill operation on the inner area of ​​the contour enclosed by the four vertices to generate the dimension line target mask image.

[0199] When the local dimension line annotation data is in the form of a list of four vertex coordinates of a bounding box without category information or a list of four vertex coordinates of a bounding box with category information, a closed contour is directly generated based on the polygon vertex coordinates, and a fill function is used to perform a fill operation on the inner region of the contour to obtain the dimension line target mask image.

[0200] Then, the target mask image obtained from the above process is binarized. Regions with pixel values ​​greater than a threshold are uniformly labeled as foreground, and the remaining regions are uniformly labeled as background, thereby generating standardized segmentation labels that only include foreground and background. For example, when the foreground pixel value is greater than 127, it is set to 1; otherwise, it is set to 0.

[0201] When the size of the target mask image obtained by the above process is inconsistent with the label size required for model training, or when it needs to be unified to a preset label size, the embodiments of this application may also use nearest neighbor interpolation to adjust the size of the segmentation label.

[0202] For example, nearest neighbor interpolation does not perform a weighted average of adjacent pixel category values, but directly selects the original pixel value closest to the target pixel position as the adjusted label value. Therefore, it can avoid the intermediate pixel value between the foreground and background generated by continuous interpolation methods such as bilinear interpolation, and ensure that the segmentation label still maintains discrete category attributes during scaling.

[0203] Let the original mask label be The adjusted target label size is For a pixel (u,v) in the adjusted label image M′, its corresponding nearest neighbor coordinates in the original label image can be represented as:

[0204]

[0205] Here, `round()` represents rounding to an integer, so the label pixel value after nearest neighbor interpolation is:

[0206]

[0207] Here, i and j are restricted to the valid coordinate range of the original label image. Subsequently, the label normalization unit performs binarization processing on the adjusted mask labels:

[0208]

[0209] This results in standardized segmentation labels that include only two categories: foreground and background dimensions.

[0210] In this embodiment, simultaneous data augmentation processing can be performed on local sample images and their corresponding standardized size segmentation label mask images to expand the training data, thereby increasing the richness of the dataset and improving the adaptability of the trained model to scenes with dense overlap of adjacent size lines, tilted size lines, and background lines. This augmentation process may include the following steps:

[0211] First, the dimension line annotation sample data in the same pixel architectural drawing is filtered, selecting those whose bounding box angle relative to the horizontal direction is not 0, and these are denoted as dimension line rotation annotation data. When the nearest distance between the edges of two dimension line rotation annotation data is less than a preset distance threshold, these two dimension line rotation annotation data are grouped as a pair of close dimension line samples. By prioritizing the construction of such samples, the number of samples in the dataset of adjacent dimension lines, dense local lines, and scenes with strong background interference can be increased.

[0212] Then, for each pair of line samples with similar sizes, a rotation angle is randomly selected within the range of 0° to 360°, and the corresponding image is rotated. During the rotation, the image canvas is expanded to ensure that the content of the rotated image is preserved as completely as possible. In the rotated image, the joint bounding region is calculated based on the transformed positions of the pair of line samples with similar sizes, and a fixed-size local cropped image is generated as the enhanced image.

[0213] To avoid truncating the dimension line target, the clipping process requires that pairs of similar dimension line samples fall completely within the clipping window, and a preset safety margin is maintained between the dimension line target boundary and the clipping window boundary. If the joint bounding region of a pair of similar dimension line samples cannot be completely contained within a fixed-size clipping window at a certain random rotation angle, the clipping result at that angle is skipped. This ensures that the generated enhanced sample contains the complete dimension line target while retaining certain neighborhood context information.

[0214] While generating the enhanced image, the corresponding dimension line annotation sample data also needs to be updated synchronously. For annotation data in the form of x_center-y_center-width-height-angle with category information or x_center-y_center-width-height-angle without category information, the center point coordinates of the dimension line annotation sample data are updated according to the affine transformation matrix used for image rotation. Furthermore, based on the coordinates of the top-left corner of the cropping window in the rotated image, the center point coordinates of the dimension line target are transformed to the local cropped image coordinate system. The width and height of the dimension line target remain unchanged; the angle parameters are synchronously corrected according to the image rotation angle.

[0215] If the input annotation uses normalized coordinates, the output annotation will also maintain normalized coordinates; if the input angle uses angles or radians, the output angle will maintain the corresponding units, thus ensuring consistency between the annotation formats before and after.

[0216] Through the above-mentioned pairwise similar dimension line sample screening, random angle rotation, fixed size complete cropping, safety margin control, and synchronous update of rotating box labels, this unit can construct a training sample set covering multi-directional, multi-adjacent relationships, and complex background interference scenarios, thereby improving the generalization ability of the trained dimension line recognition model to dimension line targets in complex engineering drawings.

[0217] The training method for the dimension line annotation data recognition model in the embodiments of this application will now be described with specific examples.

[0218] Using a batch of PDF construction drawings from an architectural design company as the original data for pixel-based architectural engineering sample drawings, the drawings are designed to contain dense grid lines, wall outlines, and text annotations. Dimension lines are scattered and vary in direction, including horizontal, vertical, and inclined directions, and the dimension lines are similar to background lines such as grid lines and wall outlines.

[0219] First, read the image data from the PDF construction drawings and set the image resolution to 400dpi. Then, use relevant functions to convert the PDF drawings into high-resolution images to form pixel-based architectural engineering sample drawings. Next, read the dimension line annotation sample data from the drawings. The dimension line annotation sample data can be in x_center-y_center-width-height-angle format or a four-point coordinate list and be parsed into unified structured data.

[0220] For a sample data of a dimension line annotation, set x_center=500, y_center=300, width=100, height=20, angle=45°, and after parsing, generate a structured field containing the center point, dimension, and angle.

[0221] Based on the coordinates of the sample data marked by the dimension line, calculate the minimum bounding box of the bounding rectangle aligned to the outermost axis, and determine whether the size of the minimum bounding box of the bounding rectangle is smaller than the preset clipping window.

[0222] In this process, the preset cropping window is 480×480 pixels, and the bounding box of a certain size line target is set as [xmin=450, ymin=280, xmax=550, ymax=320]. When the size of the minimum bounding box is smaller than the preset cropping window, the first range of values ​​for the cropping center point is determined based on the area coordinates of the minimum bounding box and the half-side length of the preset cropping window. Then, the second range of values ​​for the cropping center point is determined based on the half-side length of the preset cropping window and the size of the pixel architectural engineering sample image. Finally, the coordinates of the cropping center point are determined by combining the first and second ranges.

[0223] For example, for the bounding box [xmin=450, ymin=280, xmax=550, ymax=320], calculate the selectable range of the center point of the cropping window. Under the condition of completely covering the target dimension line and preserving the background lines of the neighborhood, select (500, 300) as the center point. Then, according to the half-side length of the preset cropping window and the coordinates of the cropping center point, perform local cropping on the corresponding area in the pixel architectural engineering sample image to obtain a local sample image.

[0224] When the cropping boundary of a local sample image is outside the pixel architectural engineering sample image, pixel filling processing can be performed on the cropped image, with the fill value set to 255.

[0225] Subsequently, based on the annotation results of the dimension line annotation sample data, local sample labels corresponding to the local sample images are generated through coordinate transformation, that is, the original annotation data is converted into annotations in the local sample coordinate system.

[0226] For the dimension lines annotated in the four-point coordinate list, binary segmentation labels are generated based on the transformed local sample labels using relevant functions, and a binary mask image with a foreground of 1 and a background of 0 is generated accordingly. Then, corresponding mask images and segmentation labels are generated based on the local sample images and local sample labels. These local sample images, local sample labels, mask images, and segmentation labels are combined to form a sample pair set, where each sample pair corresponds one-to-one with a mask image, with the local sample image corresponding to a local sample label and the mask image corresponding to a segmentation label.

[0227] After obtaining the above set of sample pairs, the local sample images and corresponding mask images are input into the data recognition proxy model, which performs image feature extraction. The data recognition proxy model can use ResNet101 to perform convolutional feature extraction on the local sample images and generate multi-layer feature maps. The first-stage feature map has 256 channels, and the fourth-stage high-level feature map has 2048 channels.

[0228] Multiple dilated convolution operations are performed consecutively on the image feature extraction results to extract contextual features. It should be noted that different dilation rates are used in each dilated convolution operation. Dilated convolution operations with dilation rates of 1, 12, 24, and 36 are performed on the high-level feature map of 2048 channels to extract short-range local details and long-range contextual features, respectively. The convolution with a dilation rate of 12 captures the local continuity and endpoints of dimension lines, while the convolution with a dilation rate of 36 perceives the distribution of background lines and the extension relationship of dimension lines over a longer range.

[0229] Meanwhile, low-level features are selected from the image feature extraction results. Specifically, structural details such as edges and endpoints are extracted from the 256-channel low-level feature map of the first stage of the ResNet101 deep residual network. Low-level structural features are calculated through convolution operations to obtain 48-channel low-level structural features.

[0230] Then, the context features are upsampled, and the upsampled multi-scale context features are fused and spliced ​​with the low-level structural features.

[0231] For example, the upsampled multi-scale contextual features are set to 512 channels, and then concatenated with the 48-channel low-level structural features to generate 512-channel fused features, and the spatial resolution is gradually restored to be consistent with the local sample image.

[0232] Based on the fusion features, the predicted region segmentation results of the local sample image and the corresponding mask image are generated. Then, pixel-by-pixel classification is performed on the fusion feature map to generate a foreground probability map. The Softmax function is used to output the size line probability. The probability value of each pixel is in the range of [0,1], which represents the possibility of belonging to the size line.

[0233] During training, the predicted region segmentation results are compared with the segmentation labels at the pixel level, the pixel-level differences between the two are calculated, and the data recognition proxy model is iteratively trained based on the pixel-level differences. The parameters of the data recognition proxy model are updated during the continuous iteration until the model training for the task of recognizing dimension line annotation data in pixel architectural engineering drawings is completed.

[0234] Through the above process, the trained data recognition proxy model can perceive the local continuity of short dimension lines, the extension relationship of long dimension lines, and the spatial relationship between dimension lines and surrounding background lines. It also supplements detailed information such as the boundary position, endpoint position, and narrow foreground area of ​​dimension lines, thereby improving the accuracy of dimension line annotation content recognition in complex backgrounds and forming structured annotation data that can be used for subsequent review and calculation.

[0235] This application embodiment also provides a method for identifying dimension line annotation data, including: acquiring a pixel architectural engineering drawing, inputting the pixel architectural engineering drawing into a trained data recognition proxy model, and identifying the dimension line annotation data in the pixel architectural engineering drawing, wherein the trained data recognition proxy model is a model determined according to the dimension line annotation data recognition model training method provided above.

[0236] In this embodiment, by acquiring pixel-level architectural engineering drawings and directly inputting them into a trained data recognition proxy model, dimension lines, dimension numbers, and their associated areas in unstructured engineering drawings such as PDFs or images can be uniformly recognized. This avoids misjudgments and omissions caused by relying solely on geometric rules, local detection, or manually set thresholds. Since this trained data recognition proxy model is based on dimension line annotation sample data, it can learn the pixel-level features and contextual relationships of dimension line annotations in complex backgrounds. This allows for the effective differentiation of interfering lines similar to wall lines, grid lines, and component boundary lines, thereby stably outputting dimension line annotation data under multi-directional, overlapping, and adjacent distribution conditions. Therefore, it improves recognition accuracy, stability, and the efficiency of subsequent structured data entry and review processing.

[0237] Figure 3A schematic diagram of the structure of the dimension line annotation data recognition model training device provided in this application is shown below. Figure 3 As shown, the dimension line annotation data recognition model training device 30 provided in this embodiment includes:

[0238] The sample generation module 301 is used to generate a set of sample pairs based on the dimension line annotation sample data in the pixel building engineering sample image. The set of sample pairs includes a one-to-one corresponding local sample image and a mask image. The local sample image has a local sample label, and the mask image has a segmentation label.

[0239] The feature extraction module 302 is used to input the local sample images and the corresponding mask images in the sample pair set into the data recognition proxy model, and use the data recognition proxy model to extract image features.

[0240] The feature extraction module 302 is also used to perform dilated convolution operation on the image feature extraction results to extract context features. The dilated convolution operation is performed multiple times, and the dilation rate of any two dilated convolution operations is different.

[0241] The feature extraction module 302 is also used to select low-level features from the image feature extraction results and calculate the low-level structural features of the low-level features through convolution operations.

[0242] The feature fusion module 303 is used to upsample the context features and fuse the upsampled context features with the low-level structure features to generate fused features;

[0243] The iterative training module 304 is used to generate the predicted region segmentation results of local sample images and corresponding mask images based on the fusion features, and to iteratively train the data recognition proxy model based on the pixel-level difference between the predicted segmentation results and the segmentation labels. The trained data recognition proxy model is used to recognize the dimension line annotation data in the pixel architectural engineering drawing.

[0244] In this embodiment, a set of sample pairs corresponding one-to-one between local sample images and mask images is constructed through the sample generation module 301. This explicitly labels the differences between the dimension line annotation region and the background lines, thereby providing stable supervision information for the model. Image features are first extracted, and then multiple dilated convolutions with different dilation rates are used to obtain multi-scale contextual information, enhancing the overall correlation between thin, slanted, and overlapping dimension lines. Simultaneously, low-level features are convolved to form low-level structural features, preserving edges, line widths, and local geometric details, thus improving the ability to distinguish dimension lines from similar lines such as wall lines and grid lines. After fusing and stitching the upsampled contextual features with the low-level structural features, both global semantics and local structure are considered, resulting in a more accurate predicted region segmentation result closer to the true segmentation label. Further iterative training based on pixel-level differences continuously corrects the surrogate model parameters, thereby improving the accuracy, stability, and subsequent structured processing efficiency of dimension line annotation data recognition in pixel-based architectural engineering drawings.

[0245] The dimension line annotation data recognition model training device 30 provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0246] Figure 4 Schematic diagram of the structure of the dimension line annotation data recognition model training device provided in this application Figure 2 ,like Figure 4 As shown, in this embodiment... Figure 3 Based on the embodiments, the dimension line annotation data recognition model training device is described in detail. The device 40 includes:

[0247] The sample generation module 401 is used to generate a set of sample pairs based on the dimension line annotation sample data in the pixel building engineering sample image. The set of sample pairs includes a one-to-one correspondence of local sample images and mask images. The local sample images correspond to local sample labels, and the mask images correspond to segmentation labels.

[0248] The feature extraction module 402 is used to input the local sample images and the corresponding mask images in the sample pair set into the data recognition proxy model, and use the data recognition proxy model to extract image features.

[0249] The feature extraction module 402 is also used to perform dilated convolution operation on the image feature extraction results to extract context features. The dilated convolution operation is performed multiple times, and the dilation rate of any two dilated convolution operations is different.

[0250] The feature extraction module 402 is also used to select low-level features from the image feature extraction results and to calculate the low-level structural features of the low-level features through convolution operations.

[0251] The feature fusion module 403 is used to upsample the context features and fuse the upsampled context features with the low-level structure features to generate fused features;

[0252] The iterative training module 404 is used to generate the predicted region segmentation results of local sample images and corresponding mask images based on the fusion features, and to iteratively train the data recognition proxy model based on the pixel-level difference between the predicted segmentation results and the segmentation labels. The trained data recognition proxy model is used to recognize the dimension line annotation data in the pixel architectural engineering drawing.

[0253] In one possible implementation, the sample generation module 401 specifically includes:

[0254] The local sample generation submodule 4011 is used to read the dimension line annotation sample data in the pixel architectural engineering sample image, and to locally crop the area of ​​the dimension line annotation sample data in the pixel architectural engineering sample image to generate a local sample image and the corresponding local sample label.

[0255] The mask generation submodule 4012 is used to generate the corresponding mask image and segmentation label based on the local sample image and the local sample label;

[0256] The sample generation submodule 4013 is used to form a set of sample pairs based on local sample images, local sample labels, mask images, and segmentation labels.

[0257] In one possible implementation, the local sample generation submodule 4011 specifically includes:

[0258] Bounding box calculation unit 40111 is used to calculate the minimum circumscribed axis aligned rectangle bounding box based on the coordinates of the dimension line annotation sample data.

[0259] The cropping unit 40112 is used to locally crop a region in the pixel architectural engineering sample image to generate a local sample image when the size of the bounding box of the minimum outer axis aligned rectangle is smaller than the preset cropping window.

[0260] Label unit 40113 is used to generate local sample labels by means of coordinate transformation based on the annotation results of the dimension line annotation sample data.

[0261] In one possible implementation, when the cropping unit 40112 performs local cropping on a region in the pixel architectural engineering sample image, it specifically includes:

[0262] The first range of values ​​for the cropping center point is determined based on the region coordinates of the bounding box of the minimum circumscribed axis and the half-side length of the preset cropping window.

[0263] The second range of values ​​for the cropping center point is determined based on the half-side length of the preset cropping window and the size of the pixel architectural engineering sample image.

[0264] Determine the coordinates of the cutting center point based on the first and second value ranges;

[0265] Based on the half-length of the preset cropping window and the coordinates of the cropping center point, a local cropping is performed on the area in the pixel architectural engineering sample image.

[0266] In one possible implementation, the device 40 further includes:

[0267] The filling module 405 is used to perform pixel filling processing on the cropped image when the cropping boundary of the local sample image is outside the pixel architectural engineering sample image, so as to generate a local sample image. The pixel value of the filling during the filling process is 255.

[0268] The dimension line annotation data recognition model training device 40 provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0269] Figure 5 This is a schematic diagram of the structure of the dimension line annotation data recognition device provided in this application. Figure 5 As shown, the dimension line annotation data recognition device 50 provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the dimension line annotation data recognition device 50 further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.

[0270] In the specific implementation process, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to execute the above-mentioned dimension line annotation data recognition model training method, or to execute the above-mentioned dimension line annotation data recognition method.

[0271] In this embodiment, through the coordinated configuration of memory and processor, the dimension line annotation data recognition model training method or dimension line annotation data recognition method can be solidified and executed in the form of program instructions. This enables the device to complete sample input, feature extraction, context modeling, feature fusion, and iterative optimization in model training, and also to directly perform dimension line annotation recognition on pixel-level architectural engineering drawings in PDF or image format. This results in more stable pixel-level segmentation results under complex backgrounds, multi-directional lines, and adjacent overlapping line segments, reducing interference from wall lines, grid lines, and component boundary lines on dimension line recognition. This leads to more accurate dimension annotation region extraction, thereby improving the efficiency and reliability of engineering drawing digitization, review and verification, and structured data storage.

[0272] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0273] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0274] The memory may include random access memory (RAM) and non-volatile memory (NVM), such as at least one disk storage device.

[0275] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0276] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described dimension line annotation data recognition model training method, or executes the above-described dimension line annotation data recognition method.

[0277] In this embodiment, the computer program product can be stored in a readable medium on a server, terminal, or drawing review device, and completes the model training or recognition process after being called by the processor, enabling the system to run directly on pixel-based engineering drawings in PDF or image format. By programmatically implementing sample pair generation, feature extraction, dilated convolution context modeling, low-level structural feature fusion, and pixel-level segmentation prediction, it can more effectively distinguish between dimension lines and similar background lines such as wall lines, grid lines, and component boundary lines, thereby improving the accuracy and stability of dimension line annotation data recognition in complex scenes. Furthermore, the program product is easy to deploy, call, and upgrade, enabling the trained model to continuously adapt to multi-directional, slender, adjacent, or overlapping dimension line recognition tasks, thereby outputting more reliable structured annotation data. Therefore, it is beneficial to improve the overall efficiency of engineering drawing digitization processing, review and verification, and database application.

[0278] This application also provides a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the above-described dimension line annotation data recognition model training method, or executes the above-described dimension line annotation data recognition method.

[0279] In this embodiment, the computer-readable storage medium can be deployed in a server, workstation, or drawing review terminal. By storing and calling corresponding computer execution instructions, the processor can complete processing steps such as sample pair construction, image feature extraction, multi-void ratio context feature acquisition, low-level structure feature extraction, feature fusion, and predictive segmentation output. This solidifies the training or recognition capabilities of the dimension line annotation data recognition model into a directly callable software carrier. With the help of this storage medium, the system can stably perform dimension line annotation training or recognition tasks on pixel-based architectural engineering drawings in PDF or image formats. This makes pixel-level segmentation and recognition of thin, multi-directional, adjacent, or overlapping dimension lines in complex backgrounds more accurate, thereby reducing the probability of false positives and false negatives for background lines. Therefore, it helps improve the stability, processing efficiency, and subsequent review application effects of the structured extraction of engineering drawing dimension annotation data.

[0280] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0281] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0282] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0283] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0284] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0285] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0286] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0287] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. A method for training a dimension line annotation data recognition model, characterized in that, include: Based on the dimension line annotation sample data in the pixel architectural engineering sample image, a sample pair set is generated. The sample pair set includes a one-to-one correspondence of local sample images and mask images. The local sample images correspond to local sample labels, and the mask images correspond to segmentation labels. The local sample images and corresponding mask images in the sample pair set are input into the data recognition proxy model, and the image feature is extracted using the data recognition proxy model. The image feature extraction results are subjected to dilated convolution operation to extract context features. The dilated convolution operation is performed multiple times, and the dilation rate of any two dilated convolution operations is different. Select low-level features from the image feature extraction results, and calculate the low-level structural features of the low-level features through convolution operation; The context features are upsampled, and the upsampled context features are fused and concatenated with the low-level structural features to generate fused features; Based on the fusion features, the predicted region segmentation results of the local sample image and the corresponding mask image are generated. Based on the pixel-level difference between the predicted segmentation results and the segmentation labels, the data recognition proxy model is iteratively trained. The trained data recognition proxy model is used to recognize the dimension line annotation data in the pixel architectural engineering drawing.

2. The method according to claim 1, characterized in that, The step of generating a set of sample pairs based on the dimension line annotation sample data in the pixel architectural engineering sample image specifically includes: Read the dimension line annotation sample data in the pixel architectural engineering sample image, and perform local cropping on the area of ​​the dimension line annotation sample data in the pixel architectural engineering sample image to generate the local sample image and the corresponding local sample label; Based on the local sample image and the local sample label, generate the corresponding mask image and the segmentation label; The sample pair set is formed based on the local sample image, the local sample label, the mask image, and the segmentation label.

3. The method according to claim 2, characterized in that, The step of partially cropping the area of ​​the dimension line annotation sample data in the pixel architectural engineering sample image to generate the partial sample image and the corresponding partial sample label specifically includes: Calculate the minimum bounding box aligned to the outer axis of the sample data based on the coordinates of the dimension line annotation sample data; When the size of the bounding box of the minimum circumscribed axis is smaller than the preset clipping window, the region in the pixel architectural engineering sample image is locally clipped to generate the local sample image. Based on the annotation results of the dimension line annotation sample data, the local sample labels are generated through coordinate transformation.

4. The method according to claim 3, characterized in that, The partial cropping of the region in the pixel architectural engineering sample image specifically includes: Based on the region coordinates of the bounding box of the minimum circumscribed axis and the half-side length of the preset clipping window, determine the first range of values ​​for the clipping center point; The second value range of the cropping center point is determined based on the half-side length of the preset cropping window and the size of the pixel architectural engineering sample image. The coordinates of the cutting center point are determined based on the first value range and the second value range; Based on the half-side length of the preset cropping window and the coordinates of the cropping center point, a region in the pixel architectural engineering sample image is locally cropped.

5. The method according to claim 3 or 4, characterized in that, The method further includes: When the cropping boundary of the local sample image is outside the pixel architectural engineering sample image, pixel filling processing is performed on the cropped image to generate the local sample image, wherein the pixel value filled during the filling processing is 255.

6. A method for recognizing dimension line annotation data, characterized in that, include: Obtain a pixel-based architectural engineering drawing and input the pixel-based architectural engineering drawing into a trained data recognition proxy model to recognize the dimension line annotation data in the pixel-based architectural engineering drawing. The trained data recognition proxy model is a model determined by the dimension line annotation data recognition model training method according to any one of claims 1-5.

7. A training device for a dimension line annotation data recognition model, characterized in that, include: The sample generation module is used to generate a set of sample pairs based on the dimension line annotation sample data in the pixel architectural engineering sample image. The set of sample pairs includes a one-to-one correspondence of local sample images and mask images. The local sample images correspond to local sample labels, and the mask images correspond to segmentation labels. The feature extraction module is used to input the local sample images and corresponding mask images in the sample pair set into the data recognition proxy model, and use the data recognition proxy model to extract image features. The feature extraction module is also used to perform dilated convolution operation on the image feature extraction results to extract context features. The dilated convolution operation is performed multiple times, and the dilation rate of any two dilated convolution operations is different. The feature extraction module is also used to select low-level features from the image feature extraction results, and to calculate the low-level structural features of the low-level features through convolution operations. The feature fusion module is used to upsample the context features and fuse the upsampled context features with the low-level structure features to generate fused features; The iterative training module is used to generate the predicted region segmentation results of the local sample image and the corresponding mask image based on the fusion features, and to iteratively train the data recognition proxy model based on the pixel-level difference between the predicted segmentation results and the segmentation labels. The trained data recognition proxy model is used to recognize the dimension line annotation data in the pixel architectural engineering drawing.

8. A device for recognizing dimension line annotation data, characterized in that, Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the dimension line annotation data recognition model training method as described in any one of claims 1-5, or to perform the dimension line annotation data recognition method as described in claim 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the dimension line annotation data recognition model training method as described in any one of claims 1-5, or to execute the dimension line annotation data recognition method as described in claim 6.

10. A computer program product, characterized in that, The computer program, when executed by a processor, implements the dimension line annotation data recognition model training method according to any one of claims 1-5, or performs the dimension line annotation data recognition method according to claim 6.