Method, device, electronic equipment and storage medium for identifying electronic drawings

By combining the method of machine learning algorithm, identify the component lines in the building drawing and detect the target component, solve the problem of low component recognition accuracy in the existing technology, and achieve more accurate component line recognition and target component detection.

CN115082952BActive Publication Date: 2025-01-28BEIJING GUOSHENG HUAXING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210847571.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-19
Publication Date
2025-01-28
Estimated Expiration
2042-07-19

AI Technical Summary

Technical Problem

In the existing method of identifying component recognition in architectural drawings, when using image recognition algorithms to identify components in electronic drawings, the accuracy rate is low and cannot meet the recognition requirements. In particular, components with similar appearances may be misidentified.

Method used

The method of combining machine learning algorithms is used to identify all the component lines in the architectural drawing, and then detect the target components based on these component lines. Specific steps include receiving drawing identification instructions, analyzing electronic drawings, extracting multiple target features of the line, and being performed as a normalized process. The input feature is to the predicted classification model to the output predictive value, and the component line is finally determined.

Benefits of technology

By extracting target features in electronic drawings and using predicted classification models, the identified component lines are more accurate, solving the problems of low detection rates and inaccurate detection areas in the component column recognition task in the component column recognition task.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115082952B_ABST
    Figure CN115082952B_ABST
Patent Text Reader

Abstract

The present application provides an electronic drawing recognition method, device, electronic device and storage medium, which parse the electronic drawing to determine the attribute data of the target pixel in the electronic drawing, the target pixel including lines and text; extract multiple first target sub-features of each line according to the attribute data of the target pixel; for each line, respectively normalize the multiple first target sub-features of the line, and merge the multiple first target sub-features after normalization into the first target feature corresponding to the line; for each line, input the first target feature corresponding to the line into a prediction classification model corresponding to the target component type to output the prediction value corresponding to the line; according to the prediction value corresponding to each line, determine the component line in the electronic drawing used to constitute the component indicated by the target component type, so as to accurately identify the component line in the electronic drawing, and lay a foundation for detecting the target component in the electronic drawing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic drawing recognition, and in particular to an electronic drawing recognition method, device, electronic device and storage medium. Background Art

[0002] In the existing architectural drawing component recognition, it is generally achieved through image recognition algorithms. However, the graphics in architectural drawings are complex, and components with similar appearance may be components of different component types. For example, beams and columns are drawn in rectangular shapes in electronic drawings. Therefore, the accuracy of using image recognition algorithms to recognize components in electronic drawings is low and cannot meet the recognition requirements. Therefore, a component recognition method for architectural drawings combined with a machine learning algorithm is proposed. First, all component lines in the architectural drawings are identified, and then the target components are detected based on the identified component lines. However, how to accurately identify component lines from architectural drawings is a problem to be solved. Summary of the invention

[0003] In view of this, the purpose of the present application is to provide a method, device, electronic device and storage medium for identifying electronic drawings, so as to accurately identify component lines in electronic drawings and lay a foundation for detecting target components in electronic drawings.

[0004] In a first aspect, the present application provides a method for identifying electronic drawings, the method comprising: receiving a drawing identification instruction, the drawing identification instruction carrying a type identifier and a drawing identifier, the drawing identifier indicating the electronic drawing to be identified, and the type identifier indicating the target component type expected to be identified; obtaining the electronic drawing indicated by the drawing identifier, and parsing the electronic drawing to determine the attribute data of the target pixels in the electronic drawing, the target pixels including lines and texts; extracting multiple first target sub-features of each line based on the attribute data of the target pixels; for each line, normalizing the multiple first target sub-features of the line respectively, and merging the normalized multiple first target sub-features into the first target feature corresponding to the line; for each line, inputting the first target feature corresponding to the line into a prediction classification model corresponding to the target component type to output a prediction value corresponding to the line; based on the prediction value corresponding to each line, determining the component line in the electronic drawing used to constitute the component indicated by the target component type.

[0005] Preferably, the attribute data includes the length value of the line, the width value of the line and the endpoint coordinates of the line, and multiple first target sub-features are extracted in the following manner: for each line, at least one data value among the length value, width value and endpoint coordinates of the line is extracted, and each extracted data value is determined as a first target sub-feature of the line.

[0006] Preferably, multiple first target sub-features are extracted in the following manner: for each line, intersecting lines that have intersections with the line are determined, the number of determined intersecting lines is determined as a first target sub-feature of the line, and / or the angle value between the line and the target axis in the electronic drawing is extracted as a first target sub-feature of the line.

[0007] Preferably, the attribute data also includes the position coordinates of the text, and multiple first target sub-features are extracted in the following manner: for each line, the text closest to the line is determined based on the distance value between the line and the position coordinates of each text; for each line, the position coordinates of the text closest to the line are extracted as a first target sub-feature of the line, and / or the distance value between the line and the closest text is extracted as a first target sub-feature of the line.

[0008] Preferably, the component lines in the electronic drawing used to constitute the component indicated by the target component type are determined in the following manner: for each line, the predicted value corresponding to the line is compared with the target predicted value; if the predicted value corresponding to the line is greater than the target predicted value, then the line is determined to be a component line used to constitute the component indicated by the target component type; if the predicted value corresponding to the line is not greater than the target predicted value, then the line is determined not to be a component line used to constitute the component indicated by the target component type.

[0009] Preferably, the prediction classification model includes multiple decision tree models, and the prediction classification model corresponding to the target component type is generated in the following manner: multiple preset feature sets are determined according to the target component type, each preset feature set includes multiple second target features, and the multiple second target features are features of component lines used to constitute the component indicated by the target component type; for each preset feature set, a decision tree model is trained and generated using the preset feature set and the initial model, and each decision tree model is used to output the weight value of each line belonging to the component indicated by the target component type; based on the multiple decision tree models, a prediction classification model corresponding to the target component type is generated, wherein the preset value output by the prediction classification model is the sum of the weight values ​​output by all decision tree models.

[0010] Preferably, the second target feature includes multiple second target sub-features, each decision tree model includes multiple nodes, and each decision tree model is trained and generated in the following manner: determine the split feature corresponding to each node, the split feature corresponding to each node is a second target sub-feature; determine the split feature value of the split feature corresponding to each node; configure the initial model according to the split feature and split feature value on each node, and the last node on each decision path in the initial model corresponds to the output weight value to generate a decision tree model.

[0011] In a second aspect, the present application provides an electronic drawing recognition device, the device comprising:

[0012] A receiving module, used for receiving a drawing recognition instruction, wherein the drawing recognition instruction carries a type identifier and a drawing identifier, wherein the drawing identifier indicates an electronic drawing to be recognized, and the type identifier indicates a target component type to be recognized;

[0013] A parsing module, used for acquiring the electronic drawing indicated by the drawing identifier, and parsing the electronic drawing to determine the attribute data of the target pixels in the electronic drawing, the target pixels including lines and texts;

[0014] A feature extraction module, used for extracting a plurality of first target sub-features of each line according to the attribute data of the target pixel;

[0015] A normalization module, used for normalizing the multiple first target sub-features of each line respectively, and merging the multiple first target sub-features after the normalization process into the first target feature corresponding to the line;

[0016] A prediction module, for each line, inputting a first target feature corresponding to the line into a prediction classification model corresponding to the target component type, so as to output a prediction value corresponding to the line;

[0017] The judgment module is used to determine the component lines used to constitute the component indicated by the target component type in the electronic drawing according to the prediction value corresponding to each line.

[0018] In a third aspect, the present application also provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the electronic drawing recognition method as described above are performed.

[0019] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the electronic drawing recognition method as described above are executed.

[0020] The present application provides a method, device, electronic device and storage medium for identifying electronic drawings, which receive a drawing identification instruction, wherein the drawing identification instruction carries a type identifier and a drawing identifier, wherein the drawing identifier indicates the electronic drawing to be identified, and the type identifier indicates the type of target component to be identified. The electronic drawing indicated by the drawing identifier is obtained, and the electronic drawing is parsed to determine the attribute data of the target pixel in the electronic drawing, wherein the target pixel includes a line and a text. According to the attribute data of the target pixel, multiple first target sub-features of each line are extracted; for each line, the multiple first target sub-features of the line are normalized respectively, and the multiple first target sub-features after normalization are merged into the first target feature corresponding to the line. For each line, the first target feature corresponding to the line is input into a prediction classification model corresponding to the target component type to output the prediction value corresponding to the line. According to the prediction value corresponding to each line, the component line used to constitute the component indicated by the target component type in the electronic drawing is determined. By extracting target features for each line in the electronic drawing, the target features are selected and extracted based on the attribute data of the pixels in the electronic drawing, and then calculating the predicted value of each line through the prediction classification model. According to the predicted value of each line, the component line used to constitute the component indicated by the target component type in the electronic drawing is determined. By combining the preset component line features with the machine learning algorithm, the component lines identified are more accurate.

[0021] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0023] Figure 1 A flowchart of a method for identifying an electronic drawing provided in an embodiment of the present application;

[0024] Figure 2 A flowchart of steps for generating a prediction splitting model provided in an embodiment of the present application;

[0025] Figure 3 A schematic diagram of the structure of an electronic drawing recognition device provided in an embodiment of the present application;

[0026] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.

[0028] First, the application scenarios to which the present application is applicable are introduced. The present application can be applied to the identification of target components in electronic drawings.

[0029] Research has found that in the existing architectural drawing component recognition, it is generally achieved through image recognition algorithms. However, the graphics in architectural drawings are complex, and components with similar appearance may be components of different component types. For example, beams and columns are drawn in rectangular shapes in electronic drawings. Therefore, the accuracy of using image recognition algorithms to recognize components in electronic drawings is low and cannot meet the recognition requirements. Therefore, a component recognition method for architectural drawings combined with a machine learning algorithm is proposed. First, all component lines in the architectural drawings are identified, and then the target components are detected based on the identified component lines. However, how to accurately identify component lines from architectural drawings is a problem to be solved.

[0030] Based on this, the embodiments of the present application provide a method, device, electronic device and storage medium for identifying electronic drawings.

[0031] See also Figure 1 , Figure 1 This is a flow chart of a method for identifying an electronic drawing provided in an embodiment of the present application. Figure 1 As shown in , the electronic drawing recognition method provided by the embodiment of the present application includes:

[0032] S101. Receive a drawing recognition instruction, wherein the drawing recognition instruction carries a type identifier and a drawing identifier, wherein the drawing identifier indicates an electronic drawing to be recognized, and the type identifier indicates a target component type to be recognized.

[0033] In this step, the drawing recognition instruction includes a type identifier and a drawing reference identifier. The type identifier is used to indicate the target component type to be recognized, where the component type may be a column, a beam, a wall, etc. The electronic drawing to be recognized may be a DWG-formatted architectural drawing.

[0034] There are multiple components drawn in the electronic drawing here, and each component has corresponding annotation information, which may include a leader line and text. The leader line in the annotation information is used to indicate the corresponding relationship between the text and the component. The text is used to indicate the component name of the component.

[0035] S102: Acquire the electronic drawing indicated by the drawing identifier, and parse the electronic drawing to determine attribute data of target pixels in the electronic drawing, where the target pixels include lines and texts.

[0036] In this step, the input electronic drawing can be read, and all the pixels in the electronic drawing, such as text, line segments, circles, etc., as well as the attribute data of each pixel can be parsed. Specifically, the data in the electronic drawing in DWG format can be read by improving the CXF library (Apache CXF) through C++ technology, and each pixel can be exported as a corresponding object class according to the type in the electronic drawing.

[0037] The attribute data here is used to indicate the drawing information of the pixels in the electronic drawing, such as the width value of the line, the coordinates of the end points of the line, the radius value of the circle, the center coordinates of the text, etc. The attribute data here is drawn by the draftsman in the process of drawing the electronic drawing and stored in the electronic drawing.

[0038] S103. Extract multiple first target sub-features of each line according to the attribute data of the target pixel.

[0039] The target sub-feature includes a first target sub-feature and a second target sub-feature. The target sub-feature here is determined based on architectural knowledge and drawing rules of architectural electronic drawings. The target sub-feature here may correspond to the target component type, that is, different component types may extract different target sub-features.

[0040] S104 . For each line, respectively normalize the multiple first target sub-features of the line, and merge the multiple first target sub-features after the normalization process into the first target feature corresponding to the line.

[0041] It is understandable that, taking coordinates as an example, the coordinate scales in different drawings are different. Some drawings are particularly large, and the coordinates are values ​​starting from tens of thousands. Some drawings are relatively small, and the coordinates are values ​​of thousands or hundreds. Therefore, it is necessary to normalize the coordinates according to the overall coordinates of the drawing so that they are distributed in the range of 0-1. Exemplarily, the normalized coordinate value = (coordinate value-minimum coordinate value) / (maximum coordinate value-minimum coordinate value). Text normalization can use the categories predicted by text classification in natural language processing, or give each text in different texts a unique identifier. Different data will use different normalization methods, which need to be processed according to actual conditions.

[0042] All normalized first target features are merged into the first target feature. For example, the first first target sub-feature is used as the first column of the matrix, and so on. If M first target sub-features are extracted here, and each first target sub-feature includes N eigenvalues, the matrix size of the first target feature is M×N.

[0043] S105 . For each line, input a first target feature corresponding to the line into a prediction classification model corresponding to the target component type to output a prediction value corresponding to the line.

[0044] In this step, for each line in the electronic drawing, the first target feature corresponding to the line is input into the trained prediction classification model. Different prediction classification models can be corresponding to different target component types. The input of the prediction classification model is the target feature of the line, and the output is the prediction value corresponding to the line. The prediction value is used to indicate whether the line is a component line of a component of the target component type.

[0045] The predictive classification model here is pre-trained, and the model can be established using the principles of the extreme gradient boosting tree algorithm or the random forest algorithm.

[0046] S106. Determine, according to the prediction value corresponding to each line, the component line used to constitute the component indicated by the target component type in the electronic drawing.

[0047] Specifically, the component lines used to constitute the component indicated by the target component type in the electronic drawing can be determined in the following manner:

[0048] For each line, the predicted value corresponding to the line is compared with the target predicted value. If the predicted value corresponding to the line is greater than the target predicted value, it is determined that the line is a component line used to constitute the component indicated by the target component type. If the predicted value corresponding to the line is not greater than the target predicted value, it is determined that the line is not a component line used to constitute the component indicated by the target component type.

[0049] The target prediction value here can be statistically calculated based on the process of training the prediction classification model. For example, if the target prediction value is 4 and the prediction value corresponding to a line is 6, it can be determined that the line is a component line of the component indicated by the target component type.

[0050] It should be noted that the component lines here refer to the lines used to form components of the target component type in the electronic drawings. After all the component lines of the components of the target component type are identified in the electronic drawings, all component lines can be input into the target detection model through deep learning to realize target detection, so as to determine all components of the target component type, and finally output the position of the components of the target component type in the electronic drawings, which effectively solves the problems of low detection rate and inaccurate detection area of ​​the image detection algorithm in the component column recognition task, and can complete the component recognition task.

[0051] The electronic drawing recognition method provided in the embodiment of the present application extracts target features for each line in the electronic drawing, where the target features are selected and extracted based on the attribute data of the pixels in the electronic drawing, and then calculates the predicted value of each line through the prediction classification model, and determines the component line in the electronic drawing used to constitute the component indicated by the target component type according to the predicted value of each line. By combining the preset component line features with the machine learning algorithm, the component lines identified are more accurate.

[0052] In one embodiment of the present application, the attribute data includes the length value of the line, the width value of the line, and the endpoint coordinates of the line, and the plurality of first target sub-features are extracted in the following manner:

[0053] For each line, at least one data value among the length value, width value and endpoint coordinates of the line is extracted, and each extracted data value is determined as a first target sub-feature of the line.

[0054] For each line, determine the intersecting lines that have intersection points with the line, determine the number of determined intersecting lines as a first target sub-feature of the line, and / or extract the angle value between the line and the target axis in the electronic drawing as a first target sub-feature of the line.

[0055] The attribute data also includes the location coordinates of the text, and multiple first target sub-features are extracted in the following way:

[0056] For each line, the text closest to the line is determined based on the distance value between the line and the position coordinates of each text.

[0057] For each line, the position coordinates of the text closest to the line are extracted as a first target sub-feature of the line, and / or the distance value between the line and the text closest to the line is extracted as a first target sub-feature of the line.

[0058] The target sub-features include the first target sub-features and the second target sub-features. The target sub-features here can be the length value of the line, the width value of the line, the endpoint coordinates of the line (including the first endpoint coordinates and the second endpoint coordinates), the number of intersections of the line, the distance value between the line and the target text (the target text here can be the text closest to the line or multiple texts closest to the line), the text content of the target text, the radius of the circle closest to the line, etc. The target sub-features also include the angle of the line, where the angle value of the line refers to the angle value of the line in the electronic drawing, and the target axis is a coordinate axis of the coordinate system in the electronic drawing, such as the X axis or the Y axis. It can be understood that if a line is drawn vertically in the electronic drawing, the angle of the line can be 0°, and if it is drawn horizontally, the angle of the line can be 90°. The target sub-features here can be directly obtained or indirectly obtained after calculation based on the attribute data of the pixels in the electronic drawing.

[0059] In one embodiment of the present application, the predictive classification model is an extreme gradient boosting tree classification model (XGBoost).

[0060] See also Figure 2 , Figure 2 A flowchart of the steps of generating a prediction splitting model provided in an embodiment of the present application. Specifically, the prediction classification model includes multiple decision tree models, and the prediction classification model corresponding to the target component type is generated in the following manner:

[0061] S201. Determine a plurality of preset feature sets according to a target component type, each preset feature set including a plurality of second target features, and the plurality of second target features are features of component lines used to constitute a component indicated by the target component type.

[0062] S202. For each preset feature set, a decision tree model is trained and generated by using the preset feature set and the initial model. Each decision tree model is used to output a weight value of each line belonging to a component indicated by the target component type.

[0063] S203. Generate a prediction classification model corresponding to the target component type based on multiple decision tree models, wherein a preset value output by the prediction classification model is the sum of weight values ​​output by all decision tree models.

[0064] It is understandable that multiple weak classifiers (decision tree models) can be generated by continuously iterating training of weak learners. Specifically, 500 weak classifiers are used in the present application to form a total prediction classification model. The depth of each weak classifier is 8. Here, each weak classifier includes multiple leaf nodes, and the target feature of the weak classifier input is output by the leaf node through different decision paths. The sample weight corresponding to the leaf node is the weight value of the final output. The sum of the weight values ​​of all weak classifications is the predicted value of the prediction classification model. The leaf node here is a node that no longer splits.

[0065] The second target feature includes multiple second target sub-features, each decision tree model includes multiple nodes, and each decision tree model is trained and generated in the following manner:

[0066] Determine the split feature corresponding to each node, where the split feature corresponding to each node is a second target sub-feature. Determine the split feature value of the split feature corresponding to each node. Configure the initial model according to the split feature and split feature value on each node, and the last node on each decision path in the initial model corresponds to the output weight value to generate a decision tree model.

[0067] The extraction steps of the second target feature are basically the same as those of the first target feature, except that the second target feature is extracted based on the component line of the component of the target component type. Specifically, before training, components of the target component type can be manually extracted and classified from multiple electronic drawings, and target features can be extracted from the component lines of the components.

[0068] For each weak classifier, the split node corresponds to the split feature and split feature value. The first thing to do when training and generating a weak classifier is to determine the split feature and split feature value corresponding to each split node.

[0069] When determining the split feature, it is necessary to traverse all target features and calculate the gain value of the loss function based on the feature value of each target sub-feature. And select the point with the largest current gain value to determine the split feature and split feature value.

[0070] Specifically, the weight value of each leaf node The calculation formula is:

[0071]

[0072] Among them, G j and H j They are the loss functions for right The first and second derivatives of . Where j is the index of the leaf node, t is the number of iterations, and λ is the regularization parameter.

[0073] The prediction split model here can also be generated by random forest algorithm training.

[0074] In a specific embodiment, the features of existing components are utilized to construct an accurate and efficient construction column classifier through an extreme gradient tree boosting tree algorithm, thereby improving the accuracy of component line recognition.

[0075] After detecting the components of the target component type based on the component line, the position of the single component in the drawing is output through the position attribute of the single component itself, which effectively solves the problems of low detection rate and inaccurate detection area of ​​the image detection algorithm in the component column recognition task, and can complete the component column recognition task.

[0076] Based on the same inventive concept, an electronic drawing recognition device corresponding to the electronic drawing recognition method is also provided in the embodiment of the present application. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned electronic drawing recognition method in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0077] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic drawing recognition device provided in an embodiment of the present application. Figure 3 As shown in , the identification device 300 includes:

[0078] The receiving module 310 is used to receive a drawing recognition instruction, wherein the drawing recognition instruction carries a type identifier and a drawing identifier, wherein the drawing identifier indicates an electronic drawing to be recognized, and the type identifier indicates a target component type to be recognized;

[0079] The parsing module 320 is used to obtain the electronic drawing indicated by the drawing identifier and parse the electronic drawing to determine the attribute data of the target pixel in the electronic drawing, where the target pixel includes a line and text;

[0080] A feature extraction module 330, for extracting a plurality of first target sub-features of each line according to the attribute data of the target pixel;

[0081] A normalization module 340 is used to perform normalization processing on multiple first target sub-features of each line, and merge the multiple first target sub-features after the normalization processing into a first target feature corresponding to the line;

[0082] A prediction module 350 is used to input, for each line, a first target feature corresponding to the line into a prediction classification model corresponding to the target component type, so as to output a prediction value corresponding to the line;

[0083] The judgment module 360 ​​is used to determine the component lines used to construct the component indicated by the target component type in the electronic drawing according to the prediction value corresponding to each line.

[0084] In a preferred embodiment, the attribute data includes the length value of the line, the width value of the line and the endpoint coordinates of the line, and the feature extraction module 330 extracts multiple first target sub-features in the following manner: for each line, extract at least one data value among the length value, width value and endpoint coordinates of the line, and each extracted data value is determined as a first target sub-feature of the line.

[0085] In a preferred embodiment, the feature extraction module 330 extracts multiple first target sub-features in the following manner: for each line, determine the intersecting lines that have intersections with the line, determine the number of determined intersecting lines as a first target sub-feature of the line, and / or extract the angle value between the line and the target axis in the electronic drawing as a first target sub-feature of the line.

[0086] In a preferred embodiment, the attribute data also includes the position coordinates of the text, and the feature extraction module 330 extracts multiple first target sub-features in the following manner: for each line, the text closest to the line is determined based on the distance value between the line and the position coordinates of each text; for each line, the position coordinates of the text closest to the line are extracted as a first target sub-feature of the line, and / or the distance value between the line and the closest text is extracted as a first target sub-feature of the line.

[0087] In a preferred embodiment, the judgment module 360 ​​determines the component lines in the electronic drawing used to constitute the component indicated by the target component type in the following manner: for each line, the prediction value corresponding to the line is compared with the target prediction value; if the prediction value corresponding to the line is greater than the target prediction value, it is determined that the line is a component line used to constitute the component indicated by the target component type; if the prediction value corresponding to the line is not greater than the target prediction value, it is determined that the line is not a component line used to constitute the component indicated by the target component type.

[0088] In a preferred embodiment, the prediction classification model includes multiple decision tree models, and the training module (not shown in the figure) generates a prediction classification model corresponding to the target component type in the following manner: multiple preset feature sets are determined according to the target component type, each preset feature set includes multiple second target features, and the multiple second target features are features of component lines used to constitute the component indicated by the target component type; for each preset feature set, a decision tree model is trained and generated using the preset feature set and the initial model, and each decision tree model is used to output the weight value of each line belonging to the component indicated by the target component type; based on the multiple decision tree models, a prediction classification model corresponding to the target component type is generated, wherein the preset value output by the prediction classification model is the sum of the weight values ​​output by all decision tree models.

[0089] In a preferred embodiment, the second target feature includes multiple second target sub-features, and each decision tree model includes multiple nodes. The training module trains and generates each decision tree model in the following manner: determining the split feature corresponding to each node, where the split feature corresponding to each node is a second target sub-feature; determining the split feature value of the split feature corresponding to each node; configuring the initial model according to the split feature and split feature value on each node, and the last node on each decision path in the initial model corresponds to the output weight value to generate a decision tree model.

[0090] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown in , the electronic device 400 includes a processor 410 , a memory 420 and a bus 430 .

[0091] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned Figure 1 The specific implementation of the steps of the method for identifying electronic drawings in the method embodiment shown can be found in the method embodiment, and will not be repeated here.

[0092] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The specific implementation of the steps of the method for identifying electronic drawings in the method embodiment shown can be found in the method embodiment, and will not be repeated here.

[0093] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0094] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

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

[0096] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0097] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0098] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for identifying an electronic drawing, characterized in that: The method comprises: Receive a drawing identification instruction, wherein the drawing identification instruction carries a type identifier and a drawing identifier, wherein the drawing identifier indicates an electronic drawing to be identified, and the type identifier indicates a target component type to be identified; Acquire the electronic drawing indicated by the drawing identifier, and parse the electronic drawing to determine attribute data of target pixels in the electronic drawing, wherein the target pixels include lines and texts; Extracting a plurality of first target sub-features of each line according to the attribute data of the target pixel; For each line, normalize the multiple first target sub-features of the line respectively, and merge the multiple first target sub-features after the normalization process into the first target feature corresponding to the line; For each line, inputting a first target feature corresponding to the line into a prediction classification model corresponding to the target component type to output a prediction value corresponding to the line; According to the prediction value corresponding to each line, the component line used to constitute the component indicated by the target component type in the electronic drawing is determined.

2. The method according to claim 1, characterized in that The attribute data includes the length value of the line, the width value of the line and the coordinates of the end points of the line, and a plurality of first target sub-features are extracted in the following manner: For each line, at least one data value among the length value, width value and endpoint coordinates of the line is extracted, and each extracted data value is determined as a first target sub-feature of the line.

3. The method according to claim 2, characterized in that Extract multiple first target sub-features by: For each line, determine the intersecting lines that have intersection points with the line, determine the number of determined intersecting lines as a first target sub-feature of the line, and / or extract the angle value between the line and the target axis in the electronic drawing as a first target sub-feature of the line.

4. The method according to claim 3, characterized in that The attribute data also includes the position coordinates of the text, and a plurality of first target sub-features are extracted in the following manner: For each line, according to the distance value between the line and the position coordinates of each text, determine the text closest to the line; For each line, the position coordinates of the text closest to the line are extracted as a first target sub-feature of the line, and / or the distance value between the line and the text closest to the line is extracted as a first target sub-feature of the line.

5. The method according to claim 1, characterized in that The component lines used to form the component indicated by the target component type in the electronic drawing are determined in the following way: For each line, the predicted value corresponding to the line is compared with the target predicted value. If the predicted value corresponding to the line is greater than the target predicted value, it is determined that the line is a component line used to constitute the component indicated by the target component type. If the predicted value corresponding to the line is not greater than the target predicted value, it is determined that the line is not a component line used to constitute the component indicated by the target component type.

6. The method according to claim 1, characterized in that The prediction classification model includes multiple decision tree models, and the prediction classification model corresponding to the target component type is generated in the following manner: Determine a plurality of preset feature sets according to the target component type, each preset feature set includes a plurality of second target features, and the plurality of second target features are features of component lines used to constitute the component indicated by the target component type; For each preset feature set, a decision tree model is trained and generated by using the preset feature set and the initial model, and each decision tree model is used to output a weight value of each line belonging to a component indicated by the target component type; A prediction classification model corresponding to the target component type is generated according to multiple decision tree models, wherein a preset value output by the prediction classification model is the sum of weight values ​​output by all decision tree models.

7. The method according to claim 6, characterized in that The second target feature includes a plurality of second target sub-features, each decision tree model includes a plurality of nodes, and each decision tree model is trained and generated in the following manner: Determine the split feature corresponding to each node, where the split feature corresponding to each node is a second target sub-feature; Determine the split feature value of the split feature corresponding to each node; The initial model is configured according to the split feature and split feature value on each node, and the last node on each decision path in the initial model corresponds to the output weight value to generate a decision tree model.

8. An electronic drawing recognition device, characterized in that: The device comprises: A receiving module, used for receiving a drawing recognition instruction, wherein the drawing recognition instruction carries a type identifier and a drawing identifier, wherein the drawing identifier indicates an electronic drawing to be recognized, and the type identifier indicates a target component type to be recognized; A parsing module, used for acquiring the electronic drawing indicated by the drawing identifier, and parsing the electronic drawing to determine the attribute data of the target pixels in the electronic drawing, wherein the target pixels include lines and texts; A feature extraction module, used for extracting a plurality of first target sub-features of each line according to the attribute data of the target pixel; A normalization module, used for normalizing the multiple first target sub-features of each line respectively, and merging the multiple first target sub-features after the normalization process into the first target feature corresponding to the line; A prediction module, for each line, inputting a first target feature corresponding to the line into a prediction classification model corresponding to the target component type, so as to output a prediction value corresponding to the line; The judgment module is used to determine the component lines used to constitute the component indicated by the target component type in the electronic drawing according to the prediction value corresponding to each line.

9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the electronic drawing recognition method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the electronic drawing recognition method according to any one of claims 1 to 7 are executed.

Citation Information

Patent Citations

  • Building model identification method, system and related device

    CN113128457A

  • Identification method and device for component in drawing, electronic equipment and storage medium

    CN114445845A