Robot service-oriented CAD drawing intelligent analysis method and device

Through the intelligent analysis method of CAD drawings for robot services, text detection and element detection are used, combined with image-text segmentation and matching, the problems of inconsistency in complexity and identification of CAD drawings are solved, and high-precision element recognition and comprehensive detection are achieved.

CN119763142AActive Publication Date: 2025-04-04BEIJING UNIV OF POSTS & TELECOMM +1
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411611497.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-04-04
Estimated Expiration
2044-11-12

AI Technical Summary

Technical Problem

The prior art is difficult to effectively identify and understand complex CAD drawings, especially in the field of engineering design, resulting in incomplete inspection and poor consistency.

Method used

A CAD drawing intelligent analysis method for robot services is proposed. By obtaining the original metadata set, text detection and element detection are carried out, and the metadata set is constructed by combining image-text segmentation and matching, and through data augmentation and object detection model training, the element recognition accuracy is improved.

Benefits of technology

It realizes high-precision element recognition, adapts to diverse application scenarios, improves the comprehensiveness and consistency of detection, and improves the robot's understanding of the engineering design environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119763142A_ABST
    Figure CN119763142A_ABST
Patent Text Reader

Abstract

The invention provides a robot service-oriented CAD drawing intelligent analysis method. The method comprises the following steps of: obtaining an original primitive data set; performing text detection on the primitive image in the original primitive data set to obtain a text detection result, including a text position and a text label; on the basis of the text detection result, primitive images in the original primitive data set are preprocessed, primitive detection is conducted on the preprocessed images, and an image detection result is obtained and comprises the image position and the primitive images; based on the text position and the image position, the text label and the primitive image are paired, and a primitive data set is further constructed; performing data enhancement on the primitive images in the primitive data set, and further training the target detection model to obtain a trained target detection model; and performing data enhancement on a to-be-detected primitive image, inputting the to-be-detected primitive image into the trained target detection model, and outputting a primitive detection result. By the adoption of the scheme, the method has the high primitive recognition capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of intelligent recognition of CAD drawings, and in particular to a method and device for intelligent analysis of CAD drawings for robot services. Background Art

[0002] Engineering design drawings are an important basis for engineering completion, and drawing analysis has important research significance and engineering application value. For example, according to CAD drawing information, the quality of engineering completion can be analyzed and engineering hidden dangers can be eliminated. With the development of robot applications, intelligent drawing analysis has become particularly important, which can help robots deeply understand the working environment and assist in navigation, inspection and other operations.

[0003] CAD primitive recognition is the basis of CAD drawing analysis. CAD drawings are composed of component symbols, text and other elements. How to identify component symbols in CAD drawings is the key to CAD primitive recognition. Traditional CAD drawings are manually reviewed and analyzed, requiring professionals to check and interpret various symbols and connections in the drawings one by one, which is not only time-consuming and labor-intensive, but also relies on manual experience, making it difficult to ensure the comprehensiveness and consistency of detection.

[0004] With the development of technologies such as artificial intelligence, intelligent recognition of CAD drawings has gradually become a research hotspot. In the early days, manual feature extraction methods were mainly used to extract primitive shape features, and classifiers were designed to achieve primitive recognition. In recent years, target detection technology has developed rapidly. More and more scholars have begun to study how to use these models to extract deep features and achieve efficient primitive target detection.

[0005] However, the intelligent recognition of CAD drawings still faces many difficulties and challenges. The first is the problem of domain gap. The current artificial intelligence technology is a typical data-driven method, which mainly uses commonly used image and video data, and there is a large domain gap with engineering design drawing data. Therefore, it is difficult to directly migrate existing artificial intelligence models and data to the field of engineering design. Secondly, the content of CAD drawings is complex and diverse, which poses a huge challenge to the intelligent recognition of CAD drawings. For example, CAD drawings usually contain a large number of complex electrical components, connection information (straight lines, dotted lines, line combinations), text and other graphics, and the relationship between different elements is complex, which poses a huge challenge to the intelligent understanding of CAD drawings. Summary of the invention

[0006] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0007] To this end, the first purpose of this application is to propose an intelligent analysis method for CAD drawings for robot services, which can adapt to various application scenarios and has high accuracy in primitive recognition.

[0008] The second purpose of this application is to propose a CAD drawing intelligent analysis device for robot services.

[0009] To achieve the above objectives, the first embodiment of the present application proposes a CAD drawing intelligent analysis method for robot services, including:

[0010] Get the original primitive data set;

[0011] Performing text detection on the primitive images in the original primitive data set to obtain text detection results, wherein the text detection results include text positions and text labels;

[0012] Preprocessing the primitive image in the original primitive data set based on the text detection result, and performing primitive detection on the preprocessed image to obtain an image detection result, wherein the image detection result includes an image position and a primitive image;

[0013] Pairing text labels and primitive images based on text positions and image positions, and constructing a primitive dataset based on the paired primitive images and text labels;

[0014] Performing data enhancement on the primitive images in the primitive data set, and using the processed primitive images to train the target detection model to obtain a trained target detection model;

[0015] Data enhancement is performed on the primitive image to be detected, and the processed primitive image is input into the trained target detection model to output the primitive detection result.

[0016] The intelligent analysis method for CAD drawings for robot services in the embodiment of the present application obtains diverse and comprehensive original primitive metadata, and on this basis, proposes an image-text segmentation and matching method based on field matching, realizes the pairing of primitive images and texts, and forms a commonly used basic primitive data set. Secondly, the present application proposes a variety of data enhancement methods such as image filling and proportional scaling, which are conducive to enriching and expanding the primitive data set. Finally, considering efficiency and accuracy, YOLO v8 is selected as the basic model to build an intelligent primitive recognition model, and it is trained on the enhanced primitive metadata to effectively improve the primitive recognition ability of the model.

[0017] Optionally, in one embodiment of the present application, performing text detection on a primitive image in an original primitive data set includes:

[0018] Text detection is performed through the OCR detection model to identify and locate the position information and text content of the text box in the image, and determine the text label based on the text content.

[0019] Optionally, in one embodiment of the present application, preprocessing the primitive image based on the text detection result includes:

[0020] Determine the text area based on the text position, cover the text area with the background color, and use Hough transform to remove the straight line part;

[0021] Perform primitive detection on the preprocessed image to obtain image detection results, including:

[0022] Convert the image to grayscale, use the Canny edge detection algorithm to locate the edge of the primitive, and merge adjacent primitives through morphological dilation operation;

[0023] Use binary images to detect contours and select valid primitive contours based on the contour hierarchy and size;

[0024] The primitive image is cut based on the primitive contour, and the position information of the primitive image is recorded.

[0025] Optionally, in one embodiment of the present application, pairing the text label with the primitive image based on the text position and the image position includes:

[0026] The distance between the text and the primitive image is determined based on the text position and the image position, and the text label and the primitive image of the text closest to each other are paired.

[0027] Optionally, in one embodiment of the present application, data enhancement is performed on the primitive image, including:

[0028] The primitive image is scaled proportionally, and a solid color background is used to fill the scaled primitive image around so that it is filled to a fixed image size;

[0029] The target detection model is YOLOv8. The target detection model uses the improved CSPDarknet as the backbone network for feature extraction, and multi-scale feature fusion is performed through the feature pyramid network and path aggregation network;

[0030] Train the target detection model, including:

[0031] The object detection model is optimized through localization loss, classification loss and confidence loss.

[0032] To achieve the above-mentioned purpose, the second embodiment of the present invention proposes a CAD drawing intelligent analysis device for robot service, comprising:

[0033] A data acquisition module, used to acquire the original image element data set;

[0034] A text detection module is used to perform text detection on the primitive images in the original primitive data set to obtain text detection results, wherein the text detection results include text positions and text labels;

[0035] An image detection module is used to preprocess the primitive images in the original primitive data set based on the text detection result, and perform primitive detection on the preprocessed images to obtain image detection results, wherein the image detection results include image positions and primitive images;

[0036] A pairing module, used for pairing text labels and primitive images based on text positions and image positions, and constructing a primitive dataset based on the paired primitive images and text labels;

[0037] A model training module is used to perform data enhancement on the primitive images in the primitive data set, and use the processed primitive images to train the target detection model to obtain a trained target detection model;

[0038] The primitive recognition module is used to perform data enhancement on the primitive image to be detected, input the processed primitive image into the trained target detection model, and output the primitive detection result.

[0039] Optionally, in one embodiment of the present application, performing text detection on a primitive image in an original primitive data set includes:

[0040] Text detection is performed through the OCR detection model to identify and locate the position information and text content of the text box in the image, and determine the text label based on the text content.

[0041] Optionally, in one embodiment of the present application, preprocessing the primitive image based on the text detection result includes:

[0042] Determine the text area based on the text position, cover the text area with the background color, and use Hough transform to remove the straight line part;

[0043] Perform primitive detection on the preprocessed image to obtain image detection results, including:

[0044] Convert the image to grayscale, use the Canny edge detection algorithm to locate the edge of the primitive, and merge adjacent primitives through morphological dilation operation;

[0045] Use binary images to detect contours and select valid primitive contours based on the contour hierarchy and size;

[0046] The primitive image is cut based on the primitive contour, and the position information of the primitive image is recorded.

[0047] Optionally, in one embodiment of the present application, pairing the text label with the primitive image based on the text position and the image position includes:

[0048] The distance between the text and the primitive image is determined based on the text position and the image position, and the text label and the primitive image of the text closest to each other are paired.

[0049] Optionally, in one embodiment of the present application, data enhancement is performed on the primitive image, including:

[0050] The primitive image is scaled proportionally, and a solid color background is used to fill the scaled primitive image around so that it is filled to a fixed image size;

[0051] The target detection model is YOLOv8. The target detection model uses the improved CSPDarknet as the backbone network for feature extraction, and multi-scale feature fusion is performed through the feature pyramid network and path aggregation network;

[0052] Train the target detection model, including:

[0053] The object detection model is optimized through localization loss, classification loss and confidence loss.

[0054] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0056] Figure 1 A schematic diagram of a process flow of a CAD drawing intelligent analysis method for robot services provided in Example 1 of the present application;

[0057] Figure 2 A schematic diagram of a process for constructing a primitive data set according to an embodiment of the present application;

[0058] Figure 3 This is an example diagram of the data set matching results of an embodiment of the present application;

[0059] Figure 4 A schematic diagram of a flowchart of a primitive matching process according to an embodiment of the present application;

[0060] Figure 5 A schematic diagram of class distribution in a data set according to an embodiment of the present application;

[0061] Figure 6 A schematic diagram of the process of intelligent recognition of CAD primitives in an embodiment of the present application;

[0062] Figure 7 A schematic diagram of a confusion matrix of an embodiment of the present application;

[0063] Figure 8 A schematic diagram of ablation experiment results of an embodiment of the present application;

[0064] Fig. 9 A schematic diagram of the structure of a CAD drawing intelligent analysis device for robot services provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0066] The following describes the intelligent analysis method and device of CAD drawings for robot services in an embodiment of the present application with reference to the accompanying drawings.

[0067] Figure 1 A flow chart of a method for intelligent analysis of CAD drawings for robot services provided in Example 1 of the present application.

[0068] like Figure 1 As shown, the robot-oriented CAD drawing intelligent analysis method includes the following steps:

[0069] Step 101, obtaining an original primitive data set;

[0070] Step 102, performing text detection on the primitive images in the original primitive data set to obtain text detection results, wherein the text detection results include text positions and text labels;

[0071] Step 103, preprocessing the primitive images in the original primitive data set based on the text detection result, and performing primitive detection on the preprocessed images to obtain image detection results, wherein the image detection results include image positions and primitive images;

[0072] Step 104, pairing the text label with the primitive image based on the text position and the image position, and constructing a primitive data set based on the paired primitive image and text label;

[0073] Step 105, performing data enhancement on the primitive images in the primitive data set, and using the processed primitive images to train the target detection model to obtain a trained target detection model;

[0074] Step 106, data enhancement is performed on the primitive image to be detected, and the processed primitive image is input into the trained target detection model to output the primitive detection result.

[0075] The intelligent analysis method for CAD drawings for robot services in the embodiment of the present application obtains diverse and comprehensive original primitive metadata, and on this basis, proposes an image-text segmentation and matching method based on field matching, realizes the pairing of primitive images and texts, and forms a commonly used basic primitive data set. Secondly, the present application proposes a variety of data enhancement methods such as image filling and proportional scaling, which are conducive to enriching and expanding the primitive data set. Finally, considering efficiency and accuracy, YOLO v8 is selected as the basic model to build an intelligent primitive recognition model, and it is trained on the enhanced primitive metadata to effectively improve the primitive recognition ability of the model.

[0076] Embodiment 2 of the present application provides another intelligent analysis method for CAD drawings oriented to robot services, which is applied in the power industry.

[0077] This embodiment includes constructing a power CAD primitive data set and CAD primitive recognition, specifically,

[0078] Figure 2 The process of constructing the primitive dataset for this article is as follows. First, the basic primitive image data is obtained to construct the original primitive dataset; second, the text labels are obtained through text detection, and the text labels are preprocessed to merge the label texts with the same primitive semantics; then, primitive image detection is performed by combining the original image and the detected text information; finally, the image and text are paired, and the processed text labels and primitive images are "one-to-one matched" to obtain the primitive image and its text label information.

[0079] The detailed processing is as follows:

[0080] (1) Data Acquisition

[0081] Obtain existing public image source data, including several image data, such as a single image Figure 3 As shown, Figure 3 The left part is the basic primitive image, which mainly includes device symbols and their meanings. Figure 3 The right part is the image-text matching result, and the same color indicates the image-text pairs that are matched.

[0082] (2) Text Recognition

[0083] The OCR detection model is used for text detection. Through the advanced structure of CRNN, the model combines the feature extraction capability of convolutional neural network (CNN) and the sequence processing capability of long short-term memory network (LSTM), effectively identifying and locating Chinese text in the image. Through this step, not only the location information of the text box is captured, but also the text content is obtained, which provides an important basis for subsequent image preprocessing.

[0084] (3) Image segmentation

[0085] Next, the goal of this embodiment is to remove elements that may interfere with primitive detection, such as text and long straight lines in the image. Therefore, based on the text detection results, this embodiment performs some detailed preprocessing on the original image, including covering the text area with the background color and removing the straight line part using Hough transform. This process not only purifies the image, but also preserves the integrity of the primitive image, laying a solid foundation for subsequent primitive detection.

[0086] Based on the processed image, this embodiment further implements primitive detection. First, the image is converted into a grayscale image, and the Canny edge detection algorithm is used to locate the edges of the primitives. Through the morphological dilation operation, adjacent primitives are merged to enhance the recognizability of the primitives. Subsequently, the binary image is used for contour detection, and the valid primitive contours are screened out based on the hierarchy and size of the contours. Finally, the primitive images are accurately cut out through the bounding box, and their location information is recorded, laying the foundation for further analysis and application. The specific process is as follows Figure 4 shown.

[0087] (4) Image-text matching

[0088] This embodiment proposes a field-based image-text matching method, which performs a "one-to-one" pairing of the image and text information obtained above, thereby obtaining the primitive image and its text label information. The matching is performed with the horizontal axis of the center of the text detection frame as the center, and the primitives near the horizontal line and close to the text are paired, and all the text information is traversed to achieve the pairing of the primitive image and the text label, such as Figure 4 The specific process is to first determine the order of the graphic element and the corresponding text. If they are arranged in rows, the left-right matching method is used. Conversely, if they are arranged in columns, the top-bottom matching method is used.

[0089] In summary, according to the above method, this embodiment constructs an electrical CAD element dataset (ECED), which includes 32 major types of elements and more than 600 element instances.

[0090] like Figure 5The sample size distribution of the ECED dataset, where the horizontal axis represents the name of the primitive and the vertical axis represents the number of primitives. As can be seen from the figure, the dataset presents a classic long-tail distribution. For example, some categories (such as transistors) appear very frequently in the dataset and dominate in terms of quantity. However, some categories appear only once or very rarely in the dataset. This long-tail distribution also poses a challenge to primitive recognition.

[0091] Figure 6 The CAD primitive recognition process of this embodiment is as follows: Figure 6 As shown, first, the primitive image to be detected is input; secondly, multi-scale data enhancement is performed on the input image to enhance the multi-scale target recognition ability of the model; finally, considering efficiency and accuracy comprehensively, YOLO V8 is selected as the target detection model of this embodiment to obtain the primitive detection result of the current input.

[0092] (1) Data enhancement

[0093] Taking into account the characteristics of the primitive data set, such as small data volume and scale diversity, this embodiment proposes a multi-scale data enhancement method to expand the constructed primitive data set to improve the multi-scale target recognition ability of the model. This method is mainly implemented through operations such as image scaling and padding. First, this embodiment scales the length and width of the original image in equal proportion to retain the spatial and shape characteristics of the original image and avoid distortion of the primitive image. Secondly, padding is performed around the scaled primitive image to fill it to a fixed image size, which is conducive to the training of deep neural networks. This embodiment adjusts the scaled image to a uniform size. For images whose image size after scaling is less than 224×224, this embodiment fills white background pixels around the image to expand it to the specified image size. The primitive data set constructed in this embodiment is mainly a white background image, so this embodiment uses white background padding to retain the authenticity and naturalness of the appearance of the primitive image.

[0094] (2) Target Identification:

[0095] This embodiment uses YOLOv8 (You Only Look Once, version 8) as the target detection model, adopts the improved CSPDarknet as the backbone network for feature extraction, performs multi-scale feature fusion through feature pyramid network (FPN) and path aggregation network (PANet), and optimizes the model through positioning loss, classification loss and confidence loss.

[0096] This embodiment conducts a series of experiments to verify the proposed primitive dataset and primitive recognition framework.

[0097] (1) Experimental setup

[0098] This embodiment uses ECED for experimental verification. In order to better train and evaluate the model, the data set is first randomly divided into non-overlapping training sets and test sets. 70% of the data is used for training and the remaining 30% is used for testing. In the training of the YOLOv8 model, this embodiment empirically sets the batch size to 16, trains 200 epochs, and the learning rate is 0.01. In data enhancement, the primitive images are scaled by 1.25, 1.5, 1.75, 2.0, and 2.25 respectively.

[0099] (2) Results and discussion

[0100] On the test set, the accuracy is 96.10%. Table 1 provides more details about the performance on different categories and uses three different metrics: precision, recall, and F1 score.

[0101] Table 1 Training results of different categories on the ECED dataset

[0102] Category Name Number of images Accuracy Recall Mean average precision operate 2 97.70% 100.00% 99.50% capacitance 5 100.00% 61.80% 90.00% triode 7 84.60% 85.70% 93.30% sensor 1 100.00% 100.00% 99.50% Straight line segment 1 100.00% 100.00% 99.50% Ground wire 3 97.80% 100.00% 99.50% cable 4 98.60% 100.00% 99.50% Switches and sockets 23 95.40% 90.10% 98.00% Potentiometers and resistors 7 99.20% 100.00% 99.50% Amplifier 1 100.00% 100.00% 99.50% Fuse 4 100.00% 78.60% 99.50% Motor and windings 5 85.50% 80.00% 93.80% illumination 5 88.20% 80.00% 84.70% inductance 3 98.00% 100.00% 99.50% diode 6 85.00% 100.00% 97.20% Coupler 2 96.70% 100.00% 99.50% Crystal Oscillator 1 95.90% 100.00% 99.50% transformer 7 100.00% 76.80% 99.50% Substation Power Station 3 100.00% 50.20% 99.50% Electrical Equipment 4 98.60% 100.00% 99.50% power supply 6 82.60% 100.00% 99.50% other 5 96.40% 100.00% 99.50% Relay 4 100.00% 78.80% 99.50% line 11 100.00% 82.40% 93.80% Connector 1 100.00% 0.00% 99.50% Electricity Meter 4 98.30% 100.00% 99.50% average 4.81 96.10% 87.09% 97.74%

[0103] Table 1 shows the experimental results on the ECED dataset. As can be seen from the table, the average precision of different categories reaches 96.10%. However, the detection performance of some categories is difficult to measure due to their small number of occurrences in the dataset. For example, the "fuse category, although its precision is high, its recall rate is only 78.60% due to the small number of instances in the dataset, which indicates that some instances are missed during the detection process. The same situation also occurs in the "transformer" and "substation power station" categories, with recall rates of 76.80% and 50.20% respectively, showing that the detector has certain limitations in identifying these categories.

[0104] At the same time, this experiment observed that some categories in the dataset had significantly improved detection performance due to the large number of instances. For example, "potentiometer and resistor", which has 7 instances in the test dataset, has a near-perfect F1 score, showing high precision and high recall. In addition, the category "switch socket", which has 23 instances in the test dataset, also showed high detection accuracy.

[0105] Next, this embodiment further analyzes the classification performance of the model through a confusion matrix. This embodiment constructs a confusion matrix (such as Figure 7 As shown), where the rows represent the true categories and the columns represent the predicted categories. Through this matrix, we can clearly see the prediction accuracy and misclassification of each category.

[0106] Through the confusion matrix, this embodiment finds that the model performs well in some categories, such as the "potentiometer and resistor" category, showing a near-perfect F1 score. However, for some categories, such as "transformer", the recall rate of the model is low due to the small number of samples in the dataset, indicating that the model's recognition ability in these categories needs to be improved.

[0107] (3) Ablation experiment

[0108] In this embodiment, in order to deeply understand the impact of data preprocessing on the performance of the CAD primitive recognition model, this implementation designed three ablation experiments to test the size adjustment method of the data set. In the first ablation experiment, all images in the data set are directly resized (Resize) to a uniform 224x224 pixel size. This method simplifies the input requirements of the model by changing the size of the image to ensure that all input images have the same dimension. However, this may cause loss and distortion of image information, especially for those images with smaller original sizes. The effect is shown in Table 2. In the second ablation experiment, the padding technique is used to maintain the original size and ratio of the image and add a border (usually a white background) around the image to ensure that all images have a uniform input size (224x224). This method retains the original ratio of the image and reduces the information distortion caused by size adjustment, but the padding part may introduce additional background noise, which affects the recognition of certain image features. The effect is shown in Table 2.

[0109] Table 2 Resize and Padding ablation experiment results for the dataset

[0110] Average accuracy Average recall Average mAP50 Resize 91.56% 76.78% 95.73% Padding 94.01% 84.91% 97.31%

[0111] The experimental results show (see Table 2) that the Padding method alone shows better performance than the Resize method alone, especially in terms of recall. This may be because the Padding method retains the original ratio of the image and reduces the information distortion caused by resizing.

[0112] In order to further explore the impact of data preprocessing on the performance of the CAD primitive recognition model, this embodiment conducts the third ablation experiment to evaluate the impact of different magnification ratios combined with padding technology on model performance. Specifically, the images in the dataset that are smaller than 224x224 pixels will be magnified in equal proportions at 1.25 times, 1.5 times, 1.75 times, 2.0 times, and 2.25 times. For images that are smaller than 224x224 pixels after magnification, padding technology will be used to adjust them to the standard size. For images that are larger than 224x224 pixels, their original proportions and quality will be maintained without further size adjustment. The effect is as follows: Figure 8 shown.

[0113] Figure 8 The figure shows the effect of different magnification ratios combined with filling techniques on the model performance in the third ablation experiment. By analyzing the experimental results, it can be seen that different magnification ratios have different effects on the average precision (Precision), average recall (Recall) and average mAP50 of the model. When the magnification ratio is 1.25, the average precision of the model reaches the highest, which is 96.60%, the average recall is 87.20%, and the average mAP50 is 98.40%. At this ratio, the image is moderately magnified, retaining more original details while avoiding information distortion caused by over-magnification. Therefore, the model strikes a balance between high precision and high recall and performs best. As the magnification ratio increases to 1.50 and 1.75, although the recall rate of the model is still high, the average precision decreases slightly. This may be because the image begins to lose details or distort during further magnification, making it difficult to recognize some primitives. When the magnification ratio is 2.00, the performance of the model (especially mAP50) reaches the highest. At this time, the image resolution is significantly improved, and more details are retained, thereby improving the recognition ability of the model. However, when the magnification ratio is further increased to 2.25, the model performance does not improve significantly. Excessive magnification may introduce additional noise and background information, which will have a negative impact on recognition.

[0114] This embodiment constructs a new electrical CAD primitive dataset (ECED) and proposes a baseline method for intelligent analysis of CAD drawings. First, the ECED dataset proposed in this embodiment contains a rich set of primitives and instances, which provides learning data and recognition benchmarks for intelligent analysis of CAD drawings, effectively alleviating the challenge of data shortage in the field of electrical engineering. Secondly, this embodiment uses YOLO target detection technology to propose an intelligent CAD drawing recognition model to realize automatic parsing of CAD drawings, effectively improving the efficiency of engineering drawing review and retrieval.

[0115] In order to implement the above-mentioned embodiments, the present application also proposes a CAD drawing intelligent analysis device for robot services.

[0116] Fig. 9 A schematic diagram of the structure of a CAD drawing intelligent analysis device for robot services provided in an embodiment of the present application.

[0117] like Fig. 9 As shown, the CAD drawing intelligent analysis device for robot service includes:

[0118] A data acquisition module, used to acquire the original image element data set;

[0119] A text detection module is used to perform text detection on the primitive images in the original primitive data set to obtain text detection results, wherein the text detection results include text positions and text labels;

[0120] An image detection module is used to preprocess the primitive images in the original primitive data set based on the text detection result, and perform primitive detection on the preprocessed images to obtain image detection results, wherein the image detection results include image positions and primitive images;

[0121] A pairing module, used for pairing text labels and primitive images based on text positions and image positions, and constructing a primitive dataset based on the paired primitive images and text labels;

[0122] A model training module is used to perform data enhancement on the primitive images in the primitive data set, and use the processed primitive images to train the target detection model to obtain a trained target detection model;

[0123] The primitive recognition module is used to perform data enhancement on the primitive image to be detected, input the processed primitive image into the trained target detection model, and output the primitive detection result.

[0124] Optionally, in one embodiment of the present application, performing text detection on a primitive image in an original primitive data set includes:

[0125] Text detection is performed through the OCR detection model to identify and locate the position information and text content of the text box in the image, and determine the text label based on the text content.

[0126] Optionally, in one embodiment of the present application, preprocessing the primitive image based on the text detection result includes:

[0127] Determine the text area based on the text position, cover the text area with the background color, and use Hough transform to remove the straight line part;

[0128] Perform primitive detection on the preprocessed image to obtain image detection results, including:

[0129] Convert the image to grayscale, use the Canny edge detection algorithm to locate the edge of the primitive, and merge adjacent primitives through morphological dilation operation;

[0130] Use binary images to detect contours and select valid primitive contours based on the contour hierarchy and size;

[0131] The primitive image is cut based on the primitive contour, and the position information of the primitive image is recorded.

[0132] Optionally, in one embodiment of the present application, pairing the text label with the primitive image based on the text position and the image position includes:

[0133] The distance between the text and the primitive image is determined based on the text position and the image position, and the text label and the primitive image of the text closest to each other are paired.

[0134] Optionally, in one embodiment of the present application, data enhancement is performed on the primitive image, including:

[0135] The primitive image is scaled proportionally, and a solid color background is used to fill the scaled primitive image around so that it is filled to a fixed image size;

[0136] The target detection model is YOLOv8. The target detection model uses the improved CSPDarknet as the backbone network for feature extraction, and multi-scale feature fusion is performed through the feature pyramid network and path aggregation network;

[0137] Train the target detection model, including:

[0138] The object detection model is optimized through localization loss, classification loss and confidence loss.

[0139] It should be noted that the aforementioned explanation of the embodiment of the method for intelligent analysis of CAD drawings for robot services is also applicable to the device for intelligent analysis of CAD drawings for robot services of this embodiment, and will not be repeated here.

[0140] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0141] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0142] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0143] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0144] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0145] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0146] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0147] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A CAD drawing intelligent analysis method for robot service, characterized in that: include: Get the original primitive data set; Performing text detection on the primitive images in the original primitive data set to obtain a text detection result, wherein the text detection result includes a text position and a text label; Preprocessing the primitive images in the original primitive data set based on the text detection result, and performing primitive detection on the preprocessed images to obtain image detection results, wherein the image detection results include image positions and primitive images; Pairing text labels and primitive images based on text positions and image positions, and constructing a primitive dataset based on the paired primitive images and text labels; Performing data enhancement on the primitive images in the primitive data set, and using the processed primitive images to train the target detection model to obtain a trained target detection model; Data enhancement is performed on the primitive image to be detected, and the processed primitive image is input into the trained target detection model to output the primitive detection result.

2. The method according to claim 1, characterized in that The performing text detection on the primitive images in the original primitive data set includes: Text detection is performed through the OCR detection model to identify and locate the position information and text content of the text box in the image, and determine the text label based on the text content.

3. The method according to claim 1, characterized in that Preprocess the primitive image based on the text detection result, including: Determine the text area based on the text position, cover the text area with the background color, and use Hough transform to remove the straight line part; The performing primitive detection on the preprocessed image to obtain an image detection result includes: Convert the image to grayscale, use the Canny edge detection algorithm to locate the edge of the primitive, and merge adjacent primitives through morphological dilation operation; Use binary images to detect contours and select valid primitive contours based on the contour hierarchy and size; The primitive image is cut based on the primitive contour, and the position information of the primitive image is recorded.

4. The method according to claim 1, characterized in that The pairing of the text label and the primitive image based on the text position and the image position includes: The distance between the text and the primitive image is determined based on the text position and the image position, and the text label and the primitive image of the text closest to each other are paired.

5. The method according to claim 1, characterized in that Perform data augmentation on primitive images, including: The primitive image is scaled proportionally, and a solid color background is used to fill the scaled primitive image around so that it is filled to a fixed image size; The target detection model is YOLOv8, which uses the improved CSPDarknet as the backbone network for feature extraction and performs multi-scale feature fusion through the feature pyramid network and the path aggregation network; Train the target detection model, including: The object detection model is optimized by localization loss, classification loss and confidence loss.

6. A CAD drawing intelligent analysis device for robot services, characterized in that: include: A data acquisition module, used to acquire the original image element data set; A text detection module, used to perform text detection on the primitive images in the original primitive data set to obtain a text detection result, wherein the text detection result includes a text position and a text label; An image detection module, used for preprocessing the primitive images in the original primitive data set based on the text detection result, and performing primitive detection on the preprocessed images to obtain image detection results, wherein the image detection results include image positions and primitive images; A pairing module, used for pairing text labels and primitive images based on text positions and image positions, and constructing a primitive dataset based on the paired primitive images and text labels; A model training module, used to perform data enhancement on the primitive images in the primitive data set, and use the processed primitive images to train the target detection model to obtain a trained target detection model; The primitive recognition module is used to perform data enhancement on the primitive image to be detected, input the processed primitive image into the trained target detection model, and output the primitive detection result.

7. The device according to claim 6, characterized in that The performing text detection on the primitive images in the original primitive data set includes: Text detection is performed through the OCR detection model to identify and locate the position information and text content of the text box in the image, and determine the text label based on the text content.

8. The device according to claim 6, characterized in that Preprocess the primitive image based on the text detection result, including: Determine the text area based on the text position, cover the text area with the background color, and use Hough transform to remove the straight line part; The performing primitive detection on the preprocessed image to obtain an image detection result includes: Convert the image to grayscale, use the Canny edge detection algorithm to locate the edge of the primitive, and merge adjacent primitives through morphological dilation operation; Use binary images to detect contours and select valid primitive contours based on the contour hierarchy and size; The primitive image is cut based on the primitive contour, and the position information of the primitive image is recorded.

9. The device according to claim 6, characterized in that The pairing of the text label and the primitive image based on the text position and the image position includes: The distance between the text and the primitive image is determined based on the text position and the image position, and the text label and the primitive image of the text closest to each other are paired.

10. The device according to claim 6, characterized in that Perform data augmentation on primitive images, including: The primitive image is scaled proportionally, and a solid color background is used to fill the scaled primitive image around so that it is filled to a fixed image size; The target detection model is YOLOv8, which uses the improved CSPDarknet as the backbone network for feature extraction and performs multi-scale feature fusion through the feature pyramid network and the path aggregation network; Train the target detection model, including: The object detection model is optimized by localization loss, classification loss and confidence loss.

Citation Information

Patent Citations

  • Construction drawing primitive adaptive identification method based on improved convolutional neural network

    CN111914612A

  • State identification method and device of power primitive, storage medium and electronic equipment

    CN114049598A

  • Switch cabinet terminal diagram automatic identification method suitable for non-table primitives

    CN115272172A

  • Pixel symbol detection method based on YOLO target detection framework

    CN117392697A

  • In-station thematic graph primitive identification method based on intelligent image algorithm

    CN117456549A