Fire-fighting part automatic labeling method and system based on drawing recognition model

Through the automatic labeling method of fire-fighting parts based on drawing recognition model, the problem of complexity of complex or large fire-fighting assembly labeling is solved, automatic labeling and programming is realized, and efficiency and accuracy are improved.

CN119904889APending Publication Date: 2025-04-29BENGBU EI FIRE ELECTRONICS CO LTD

Patent Information

Application Number
CN202411994209.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

When handling complex or large fire-fighting assembly, the center point, central axis or coordinate origin of the assembly is required to mark it, resulting in increased analysis and calculation complexity.

Method used

The automatic labeling method of fire-fighting parts based on the drawing recognition model is adopted. By constructing the bounding box separation engineering drawings, the target detection and segmentation model is constructed, and the fire-fighting parts icons and loop addresses are automatically identified and marked.

Benefits of technology

Reduces the dependence of manual operations, improves work efficiency, reduces errors and labor costs, and is suitable for automatic labeling and programming of complex or large fire-fighting assembly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119904889A_ABST
    Figure CN119904889A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for automatically labeling fire-fighting parts based on a drawing recognition model, relates to the technical field of intelligent fire fighting, and solves the problems of low efficiency and excessive dependence on manual operation when an engineering drawing is punctuated and programmed in the prior art. The method comprises the following steps: acquiring a fire-fighting component icon in an output feature map and a corresponding icon box; constructing a target segmentation model to segment room information in the drawing to obtain a plurality of segmentation blocks; constructing a text detection model to obtain text information and a text box, and judging whether the fire-fighting drawing contains a loop address and room information or not; if yes, the icon boxes in the segmentation blocks are matched with the textbox to obtain loop addresses of the corresponding icons; room names corresponding to the segmentation blocks are obtained according to a textbox containing the room names; acquiring position information corresponding to the icon frame according to a position relationship between the icon frame and the segmentation block; if not, fire-fighting component loop address planning is carried out; according to the invention, the complexity of automatic part labeling is reduced, and the reliability of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent fire protection, and relates to automatic component labeling and programming technology, and specifically to an automatic labeling method and system for fire protection components based on a drawing recognition model. Background Art

[0002] A new method that can automatically complete the labeling and programming of fire protection parts to reduce the burden of manual operation and improve work efficiency. With the rapid development of deep learning technology, especially in the field of object detection and image segmentation, it has become more feasible to automatically process key information in images; in the display and construction of fire protection parts, accurately labeling the icons and location information of fire protection parts, and programming the detailed information such as the circuit, address, location and linkage relationship of fire protection parts through programming software are key steps to ensure the smooth installation and operation of fire protection systems.

[0003] The prior art (invention patent with application number CN115063827B) discloses a method and system for automatically marking drawing dimensions based on name search and feature recognition, including: determining an identification field describing a specific type of a component according to the naming rules of the drawing components, and using the identification field as a search target; traversing all components in the drawing to obtain the specific type of each component, and obtaining key shape features in the components based on the specific type of the components, and determining positioning points according to the key shape features; determining the center point, center axis or coordinate origin of the entire assembly according to the assembly relationship of the components in the drawing; marking each positioning point based on the center point, center axis or coordinate origin;

[0004] In the prior art, it is necessary to determine the center point, center axis or coordinate origin of the entire assembly to mark the positioning points; however, as the complexity of the assembly increases, the difficulty of determining these reference points will also increase accordingly. In particular, for large or complex assemblies, it may be necessary to consider the interactions and constraints between multiple components, resulting in increased complexity of analysis and calculation.

[0005] The present invention provides a method and system for automatically marking firefighting components based on a drawing recognition model to solve the above technical problems. Summary of the invention

[0006] The present invention aims to solve at least one of the technical problems existing in the prior art; to this end, the present invention proposes a method and system for automatic marking of fire protection parts based on a drawing recognition model, which is used to solve the technical problem in the prior art that the center point, center axis or coordinate origin of the entire assembly needs to be determined to mark the positioning point; for large or complex assemblies, the complexity of analysis and calculation will be increased.

[0007] To achieve the above object, a first aspect of the present invention provides a method for automatically labeling firefighting components based on a drawing recognition model, comprising:

[0008] Icon acquisition module: obtain engineering drawings, separate and save the engineering drawings by building bounding boxes, and build a target detection model to obtain output feature maps;

[0009] Obtain the fire component icons and corresponding icon frames in the output feature map;

[0010] Model building module: construct the target segmentation model to segment the room information in the drawing and obtain several segmentation blocks;

[0011] Loop address matching module: extract text information from engineering drawings through text information recognition; and determine whether the text information contains a loop address; if yes, match the icon box in the segmented block with the text box to obtain the loop address of the corresponding icon; mark the unmatched text box as a text box containing a room name, and obtain the room name corresponding to the segmented block according to the text box containing the room name;

[0012] No, proceed with the fire protection component loop address planning.

[0013] Preferably, separating and saving the engineering drawings by constructing a bounding box includes:

[0014] Get the drawing from the database, traverse all the entity graphics in the drawing through CAD, and build several bounding boxes according to the position of each entity graphic;

[0015] (x min ,y min ) is defined as the lower left corner coordinate of the bounding box, and (x max ,y max ) is defined as the coordinate of the upper right corner of the bounding box;

[0016] Set inclusion condition 1 to: The second inclusion condition is: The third inclusion condition is: The fourth inclusion condition is: Among them, A and B represent bounding boxes at two different positions;

[0017] The outer rectangular frame is used to determine whether all the inclusion conditions are met between the bounding boxes at the same time; if yes, the bounding boxes that meet the inclusion conditions are merged into the same bounding box, and the boundary of the largest bounding box is used as the outermost rectangular frame of the merged bounding box; if no, there is no need to merge the determined bounding boxes;

[0018] Create several subsets according to each outermost rectangular frame, and save all entity graphics contained in the outermost rectangular frame to CAD file 1;

[0019] An optical character recognition (OCR) model is called to recognize text information in the drawing, and a bounding box of a text box corresponding to the annotated text information is marked; all the annotated text information in the drawing contained in the text box is saved to CAD file 2; wherein the annotated text information includes: loop address and room name; the text box includes: a text box containing the loop address and a text box containing the room name.

[0020] It should be noted that the inclusion condition of the bounding box is also applicable to determining the inclusion of multiple bounding boxes; several subsets are saved by using the graphics library; it is determined whether the recognized text information starts with a number, if yes, the loop address and icon are matched, if not, the loop address is planned;

[0021] If there are unmatched text boxes after the loop address and icon matching is completed, these text boxes will be matched with the identified room outline.

[0022] The present invention divides a computer-aided design engineering drawing containing multiple drawings into files containing only a single drawing, which is convenient for rapid identification and processing at a later stage; and creates a subset for each outermost rectangular frame and saves all graphic entities in the frame into a new CAD file, thereby realizing the separation of several graphic entities in the drawing.

[0023] Preferably, the step of constructing a target detection model to obtain an output feature map includes:

[0024] Retrieve the entity graph and use it as the input feature graph; mark the weights of the convolutional layer as {W i}, mark the transformation obtained by the convolution layer and ReLU activation function as F(X i-1 ,{W i}); where the set {W i} = {K, C, H, W}, K is the number of convolution kernels, C is the number of input channels, H is the height of the convolution kernel, and W is the width of the convolution kernel;

[0025] Select a convolution kernel with the same number of channels as the input feature map; obtain the spatial value of the convolution kernel by multiplying the height and width of the convolution kernel; place the convolution kernel at the starting position of the input feature map, multiply the convolution kernel with the corresponding elements of the input feature map area covered by the convolution kernel one by one and sum them up to obtain the convolution result of the covered area of ​​the current input feature map; slide the convolution kernel on the input feature map and repeat the calculation until the entire input feature map is traversed;

[0026] By formula X i =F(X i-1 ,{W i})+X i-1The output feature map of the residual block is calculated; where i represents the number of layers of the feature map, and the value range of i is a positive integer greater than 1.

[0027] It should be noted that, when i=1, the input feature map is the original image; the default starting position is the upper left corner of the input feature map.

[0028] The present invention uses the ResNet-50 algorithm to extract the feature map of the input image when constructing a target detection model for convolutional feature extraction, introduces a residual block for output, and alleviates the gradient vanishing problem in the deep network through jump connections.

[0029] Preferably, the step of obtaining the firefighting component icons and corresponding icon frames in the output feature graph includes:

[0030] Retrieve the output feature map; through the formula P i =F(X i )+upsample(P i+1 ) calculates the corresponding fusion feature map generated for each layer of feature map; where F(X i ) is the convolution function, upsample(P i+1 ) is the upsampling function;

[0031] The region proposal network uses the adaptive anchor box technology to generate several candidate regions from the fused feature map, and the non-maximum suppression algorithm is used to screen the high-quality candidate regions, which are used as fire component icons.

[0032] The high-quality candidate regions are mapped to the feature map, fixed-size features are extracted through the region of interest pooling layer, each high-quality candidate region is convolved to output several high-quality candidate region bounding boxes, and the high-quality candidate region bounding boxes are used as the corresponding icon boxes.

[0033] The present invention can map candidate regions of different sizes to a feature map of fixed size through a region of interest pooling layer, which is convenient for subsequent classification and regression tasks; convolution processing is performed on each high-quality candidate region to output more precise bounding boxes, which can more accurately locate fire component icons.

[0034] Preferably, the method of obtaining high-quality candidate regions by screening using a non-maximum suppression algorithm includes:

[0035] S110: Retrieving candidate boxes corresponding to several candidate regions and obtaining confidence scores of the candidate boxes;

[0036] S120: sorting the candidate boxes in descending order according to the confidence scores;

[0037] S130: Select the box with the highest score from the sorted list as the current box and mark it as C;

[0038] S140: By formula The intersection over union (IoU) (C, D) is calculated; where C and D are two different candidate boxes, and the confidence score of C is greater than the confidence score of D; Area (C∩D) is the intersection area of ​​the two boxes, and Area (C∪D) is the union area of ​​the two boxes;

[0039] S150: The IoU threshold is calculated by the formula θ=θ0+α·ρ+β·c; wherein θ0 is the basic IoU threshold, ρ is the density of the candidate box, c is the confidence, α and β are adjustment coefficients, and the value range of α and β is (0, 1);

[0040] S160: Determine whether IoU (C, D) is greater than the IoU threshold; if yes, remove the candidate box D with a small relative confidence score; if no, proceed to S170;

[0041] S170: Repeat steps S130-S160 until all candidate boxes are processed; and mark the candidate regions corresponding to the selected candidate boxes as high-quality candidate regions.

[0042] It should be noted that the specific values ​​of α and β are set by the staff according to specific experimental results.

[0043] The present invention introduces a basic IoU threshold and a method for dynamically calculating the IoU threshold according to the density, confidence and adjustment coefficient of the candidate boxes, so that the algorithm can more flexibly adapt to the distribution of candidate boxes in different scenarios, which helps to further improve the robustness and adaptability of the algorithm while maintaining detection accuracy.

[0044] Preferably, constructing the target segmentation model to segment the room information in the drawing includes:

[0045] S210: downsample and upsample layer by layer through the encoder-decoder structure to obtain sample pixels, connect the corresponding encoder and decoder layers through skip connections; call the feature map X in the skip connection, S220: through the formula Calculate the activation function;

[0046] S230: The attention weight is calculated by the formula W=σ·[W1·ReLU(W2·X+b2)+b1]); wherein W1 represents the feature map of the encoder, W2 represents the feature map of the decoder; b1 and b2 are both bias terms;

[0047] S240: By Formula X selected =W·X calculates the output feature map;

[0048] S250: Convolve the last layer output feature map to obtain the feature map and convert it into the category probability of each pixel and mark it as The true pixel category is labeled as y;

[0049] By formula The loss value is calculated; where j represents the number of categories of sample pixels, and the value range of j is a positive integer;

[0050] S260: Set a preset round, and determine whether the number of calculations of the loss value is greater than the preset round; if yes, proceed to S270; if no, continue to determine;

[0051] S270: Classify the sample pixels and output the category of each pixel, and use each pixel category as a corresponding segmentation block; wherein the segmentation block contains the room outline information in the drawing; the room outline information includes: the center coordinates of the room block, the width of the room, and the height of the room.

[0052] It should be noted that the loop address of the fire protection component refers to the unique identifier of each loop in the fire linkage control system, which is used to identify different loops and the fire protection components thereon.

[0053] The present invention converts the output feature map of the last layer into the category probability of each pixel through layer-by-layer convolution and feature extraction, and compares it with the real pixel category, so as to accurately calculate the loss value; the calculation of the loss value helps to evaluate the performance of the model and continuously improve the segmentation accuracy through iterative optimization.

[0054] Preferably, the step of matching the icon box with the text box to obtain the loop address of the corresponding icon includes:

[0055] Retrieve the icon box and the text box, obtain the distance between the icon box and the text box, and determine whether there are multiple text boxes with the same distance to the same icon box; if yes, obtain the overlap rate of the bounding boxes of the icon box and the corresponding multiple text boxes, and preferentially match the bounding box of the icon box with the bounding box of the text box with the highest overlap rate;

[0056] If not, the icon box and the corresponding text box are matched based on the principle of shortest distance first.

[0057] It should be noted that when the overlap rate is 0, the icon box is matched with the text box located on the right side of the icon box; when the icon does not match the loop address, an early warning signal is issued and the staff makes a manual judgment.

[0058] The present invention can more accurately find the most likely match by further screening matching pairs by calculating the overlap rate when there are multiple text boxes with the same distance from the same icon box, thereby optimizing the matching efficiency; the calculation of the overlap rate takes into account the overlap degree of the bounding boxes of the icon box and the text box, thereby improving the accuracy of the matching.

[0059] Preferably, obtaining the room name corresponding to the segmented block according to the text box containing the room name includes:

[0060] Retrieve several segments and text boxes that failed to match; mark the number of segments as r, and the width and height of the segments as W respectively r , H r , the width and height of the text box are marked as W and t , H t , the width and height of the icon box are marked as W p , H p ;

[0061] Set the center coordinate of the segment block to G room =(x r ,y r ), the center coordinate of the text box is C text =(x t ,y t ), the center coordinate of the icon frame is C icon =(x p ,y p ); Mark the coordinate of the lower left corner of the segmented block as (x min_room ,y min_room ), the coordinate of the upper right corner of the segment is marked as (x max_room ,y ma x _room );

[0062] Among them, through the formula Calculate the horizontal coordinate of the lower left corner;

[0063] By formula Calculate the vertical coordinate of the lower left corner;

[0064] By formula Calculate the horizontal coordinate of the upper right corner;

[0065] By formula Calculate the vertical coordinate of the upper right corner;

[0066] Set the text box internal condition 1 to: x min_room <x r <x max_room , the second condition inside the text box is: y min_room <y r<y max_room ;

[0067] Set the internal condition of the icon frame to: x min_room <x p <x max_room , the second condition inside the icon box is: y min_room <y p <y max_room ;

[0068] Determine whether the center coordinates of the text box simultaneously meet all text box internal conditions; if yes, the text box is located inside the segmentation block; use the text box information contained in the current segmentation block as the room name represented by the current segmentation block; if no, continue to determine until all rooms match the room name;

[0069] Determine whether the center coordinates of the icon frame simultaneously meet the internal conditions of all icon frames; if yes, the icon frame is located inside the segmentation block; use the room name of the current segmentation block as the remark information of the current icon; if no, continue to determine until all icons match the room name as the remark information.

[0070] The present invention determines whether a text box is located inside a segmented block by determining whether the center coordinates of the text box satisfy all text box internal conditions, which is conducive to more accurately determining whether the text box is located inside the segmented block and reducing misjudgment; at the same time, it allows the computer to automatically determine the relationship between the text box and the segmented block without manual intervention, thereby improving processing efficiency.

[0071] Preferably, the fire protection component loop address planning includes:

[0072] S310: Obtain the number of firefighting components in the segmented block and classify the components according to the firefighting component type;

[0073] S320: Obtain fire protection component location information, component type and wiring connectivity to sort each type of equipment, and encode the loop addresses of each type of components in sequence according to the sorted component information; wherein the fire protection component location information includes: the coordinates of the icon and the corresponding room name;

[0074] S330: Determine whether the addressing of the current fire protection component is completed; if yes, determine whether all fire protection components have completed addressing; if yes, save the loop address of the fire protection component; if no, edit the next type of equipment and re-sort according to the location information;

[0075] If not, the loop addresses of various components are re-encoded; among them, the fire protection component types include: detector type, supervision module type and others.

[0076] To achieve the above object, the second aspect of the present invention provides a fire protection component automatic labeling system based on a drawing recognition model, comprising:

[0077] Icon acquisition module: obtain engineering drawings, separate and save the engineering drawings by building bounding boxes, and build a target detection model to obtain output feature maps;

[0078] Obtain the fire component icons and corresponding icon frames in the output feature map;

[0079] Model building module: construct the target segmentation model to segment the room information in the drawing and obtain several segmentation blocks;

[0080] Loop address matching module: extract text information from engineering drawings through text information recognition; and determine whether the text information contains a loop address; if yes, match the icon box in the segmented block with the text box to obtain the loop address of the corresponding icon; mark the unmatched text box as a text box containing a room name, and obtain the room name corresponding to the segmented block according to the text box containing the room name;

[0081] No, proceed with the fire protection component loop address planning.

[0082] Compared with the prior art, the present invention has the following beneficial effects:

[0083] 1. The present invention constructs an intelligent automatic marking and efficient programming solution for firefighting components based on a drawing recognition model. Its core purpose is to significantly reduce the reliance on manual operation in the process of precise identification of firefighting equipment and in-depth analysis of complex drawings, thereby effectively avoiding errors and omissions caused by human factors; by integrating advanced image recognition and deep learning algorithms, this method can automatically realize the precise punctuation function on the drawings without manual marking one by one, which greatly saves time resources and labor costs;

[0084] 2. When there are multiple text boxes with the same distance from the same icon box, the present invention further screens the matching pairs by calculating the overlap rate, and can more accurately find the most likely match, thereby optimizing the matching efficiency; the present invention introduces advanced computer vision and deep learning technology, which can automatically identify the fire protection component information in engineering drawings, mark the fire protection components, and plan the loop address of the components based on this information, which greatly reduces the workload of traditional manual marking and significantly saves a lot of human resources and related costs; in the traditional process, manual marking is not only time-consuming and labor-intensive, but also prone to errors, and the automatic recognition system of the present invention effectively solves these problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0086] Figure 1 A schematic diagram of the process of automatically marking firefighting components of the present invention;

[0087] Figure 2 A schematic diagram of specific steps of separating engineering drawings according to the present invention;

[0088] Figure 3 A schematic diagram of a specific flow chart for obtaining an output feature map in the present invention;

[0089] Figure 4 A schematic diagram of the steps for planning the loop address of a fire protection component according to the present invention;

[0090] Figure 5 It is a schematic diagram of the relationship between the modules included in the present invention. DETAILED DESCRIPTION

[0091] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0092] See also Figure 1 The first aspect of the present invention provides a method for automatically labeling firefighting components based on a drawing recognition model, comprising:

[0093] Icon acquisition module: obtain engineering drawings, separate and save the engineering drawings by building bounding boxes, and build a target detection model to obtain output feature maps;

[0094] Obtain the fire component icons and corresponding icon frames in the output feature map;

[0095] Model building module: construct the target segmentation model to segment the room information in the drawing and obtain several segmentation blocks;

[0096] Loop address matching module: extract text information from engineering drawings through text information recognition; and determine whether the text information contains a loop address; if yes, match the icon box in the segmented block with the text box to obtain the loop address of the corresponding icon; mark the unmatched text box as a text box containing a room name, and obtain the room name corresponding to the segmented block according to the text box containing the room name;

[0097] No, proceed with the fire protection component loop address planning.

[0098] It should be noted that the drawing recognition model includes: target detection model, target segmentation model;

[0099] See also Figure 2 ,The specific steps of separating engineering drawings are to obtain ,drawings from the database, traverse all entity graphics in the ,drawings through CAD, and construct several bounding boxes according to the ,position of each entity graphic;

[0100] (x min ,y min ) is defined as the lower left corner coordinate of the bounding box, and (x max ,y max ) is defined as the coordinate of the upper right corner of the bounding box;

[0101] Set inclusion condition 1 to: The second inclusion condition is: The third inclusion condition is: The fourth inclusion condition is: Among them, A and B represent bounding boxes at two different positions;

[0102] The outer rectangular frame is used to determine whether all the inclusion conditions are met between the bounding boxes at the same time; if yes, the bounding boxes that meet the inclusion conditions are merged into the same bounding box, and the boundary of the largest bounding box is used as the outermost rectangular frame of the merged bounding box; if no, there is no need to merge the determined bounding boxes;

[0103] Create several subsets according to each outermost rectangular frame, and save all entity graphics contained in the outermost rectangular frame to CAD file 1;

[0104] Call the optical character recognition model to recognize the text information in the drawing, and mark the bounding box of the text box corresponding to the text information; save all the marked text information in the drawing contained in the text box to CAD file 2; wherein the marked text information includes: loop address and room name; the text box includes: a text box containing the loop address and a text box containing the room name.

[0105] For example, now obtain the engineering drawing, save the entities contained in each outermost rectangular box as a new drawing exchange format (DXF) drawing file; identify the current DXF drawing, redraw it according to the vector diagram, and save it as a JPG (or PNG) file;

[0106] Get drawings from the database, read and parse various data structures in DXF drawing files, such as layers, entities (lines, arcs, text, etc.); traverse the model space, find rectangular boxes defined as lines or polygons, collect all rectangles, and determine the outermost rectangular box based on the inclusion relationship between rectangles; for each outermost rectangular box, find all graphic entities in this box and treat it as a drawing subset; save each subset as a new DXF file;

[0107] Read and parse various data structures in each subset DXF file, such as layers, entities (lines, arcs, text, etc.);

[0108] Redraw the graphics according to the data structure and convert the vector graphics in the drawing into pixel graphics; use the savefig method in matplotlib to save the rendered image in JPG (or PNG) format;

[0109] Use the text recognition model OCR to identify the circuit address in the drawing and mark the text box.

[0110] See also Figure 3 , obtain the specific flow chart of the output feature map, call the entity map, and use the entity map as the input feature map; mark the weight of the convolutional layer as {W i}, mark the transformation obtained by the convolution layer and ReLU activation function as F(X i-1 ,{W i}); where the set {W i} = {K, C, H, W}, K is the number of convolution kernels, C is the number of input channels, H is the height of the convolution kernel, and W is the width of the convolution kernel;

[0111] Select a convolution kernel with the same number of channels as the input feature map; obtain the spatial value of the convolution kernel by multiplying the height and width of the convolution kernel; place the convolution kernel at the starting position of the input feature map, multiply the convolution kernel with the corresponding elements of the input feature map area covered by the convolution kernel one by one and sum them up to obtain the convolution result of the covered area of ​​the current input feature map; slide the convolution kernel on the input feature map and repeat the calculation until the entire input feature map is traversed;

[0112] By formula X i =F(X i-1 ,{W i})+X i-1 Calculate the output feature map of the residual block;

[0113] For example, the existing weights are a set {W i} = {1, 3, 3, 3}, indicating that there is 1 convolution kernel, 3 channels (RGB), and the convolution kernel size is a 3×3 matrix

[0114] The shape of the input feature map is (3, 5, 5), then the input representation feature map also has three channels, and the size of each channel is a 5×5 matrix;

[0115] Place the weighted convolution kernel in the upper left corner of the input feature map, multiply and sum the convolution kernel with the corresponding elements of the covered input feature map area; repeat the calculation until the entire input feature map is covered;

[0116] By formula X i =F(X i-1 ,{W i})+X i-1 Calculate the output feature map of the residual block;

[0117] See also Figure 4 , the steps of planning the loop address of the fire protection components, obtaining the number of fire protection components in the segmented block, and classifying the components according to the type of fire protection components;

[0118] Obtain the location information, component type and wiring connectivity of fire protection components to sort each type of equipment, and encode the loop addresses of each type of components in sequence according to the sorted component information;

[0119] Determine whether the addressing of the current fire protection component is completed; if yes, determine whether all fire protection components have completed addressing; if yes, save the loop address of the fire protection component; if no, edit the next type of equipment and re-sort according to the location information;

[0120] If not, the loop addresses of various components are re-encoded; among them, the fire protection component types include: detector type, supervision module type and others.

[0121] For example, a drawing that does not contain the circuit and address of the fire protection components is retrieved, the component icon and component type are identified through the target detection model, and the location information of each component is obtained, and the information is saved as the component information of each fire protection component in the drawing;

[0122] Classify components by device type, and then sort each type of device according to location information, component type, and wiring connectivity; encode the loop information of various components in sequence according to the location information, with the loop address starting from 1 and gradually increasing, and set a loop for every 150 components;

[0123] According to the sorted component information, the addresses of the fire protection components in each loop are encoded in turn. Each loop contains 150 devices, so the encoding of the component addresses in each loop starts from 1 and ends at 150, and so on. When the encoding of one type of equipment is completed, the next type of equipment is addressed until all devices are addressed.

[0124] It should be noted that all data obtained from drawing recognition is uploaded to a third-party IoT platform, and these data are uploaded and saved in the platform's database. These data can be directly used for floor plan functions and CRT devices; in the floor plan function module of the platform, pictures that match the device type are automatically added to the corresponding position of the drawing based on the identified point information, and the circuit, address and location of the device are displayed in the device details page; users such as construction personnel and technicians can also add, delete or modify equipment and equipment details on the drawings according to the actual construction situation; the modified programming information is synchronized with the on-site construction, and the construction personnel will work according to these updated programming information. This process not only ensures the accuracy of construction information, but also ensures the consistency of platform data with the actual on-site situation, greatly improving construction efficiency and the reliability of system management.

[0125] In the workflow of the platform, all data obtained from drawing recognition is retrieved to automatically program related equipment, including programming the type, circuit and address information of the current component; classifying the equipment in the drawing according to the point type, such as detectors, supervision modules and other equipment; based on these classifications, the platform further programs the working mode, action logic, and linkage expression of each component.

[0126] For example: set the action in advance when a fire occurs in the M building, where the action is: send out an early warning signal;

[0127] Set the linkage expression to (0 / 1 / 1)*(1 / 1 / 2+0 / 1+1 / 2). The linkage expression indicates that the action logic will be executed only after this condition is met. Among them, 0 / 1 / 1 indicates the address of loop 1 of this machine, 1 / 1 / 2 indicates the address of loop 2 of machine 1, 0 / 1 indicates the address of partition 1 of this machine, 1 / 2 indicates the address of partition 2 of machine 1, * indicates logical AND, and + indicates logical OR.

[0128] See also Figure 5 , the second aspect of the present invention provides a fire protection component automatic labeling system based on a drawing recognition model, including: an icon acquisition module, a model construction module, and a loop address matching module;

[0129] Icon acquisition module: obtain engineering drawings, separate and save the engineering drawings by building bounding boxes, and build a target detection model to obtain output feature maps;

[0130] Obtain the fire component icons and corresponding icon frames in the output feature map;

[0131] Model building module: construct the target segmentation model to segment the room information in the drawing and obtain several segmentation blocks;

[0132] Loop address matching module: extract text information from engineering drawings through text information recognition; and determine whether the text information contains a loop address; if yes, match the icon box in the segmented block with the text box to obtain the loop address of the corresponding icon; mark the unmatched text box as a text box containing a room name, and obtain the room name corresponding to the segmented block according to the text box containing the room name;

[0133] No, proceed with the fire protection component loop address planning.

[0134] Part of the data in the above formula is calculated by removing the dimension and taking its numerical value. The formula is a formula closest to the actual situation obtained by software simulation of a large amount of collected data; the preset parameters and preset thresholds in the formula are set by technical personnel in this field according to actual conditions or obtained through simulation of a large amount of data.

[0135] The working principle of the present invention is as follows: the present invention obtains engineering drawings, constructs bounding boxes to separate and save the engineering drawings, constructs a target detection model to obtain an output feature map; obtains fire component icons and corresponding icon boxes in the output feature map; constructs a target segmentation model to segment the room information in the drawings to obtain a number of segmentation blocks; determines whether the room information contains a loop address; if so, matches the icon box in the segmentation block with the text box to obtain the loop address of the corresponding icon; marks the unmatched text box as a text box containing the room name, and obtains the room name corresponding to the segmentation block according to the text box containing the room name; if not, performs fire component loop address planning.

[0136] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.

Claims

1. A method for automatically marking firefighting components based on a drawing recognition model, characterized in that: include: Icon acquisition module: obtain engineering drawings, separate and save the engineering drawings by building bounding boxes, and build a target detection model to obtain output feature maps; Obtain the fire component icons and corresponding icon frames in the output feature map; Model building module: construct the target segmentation model to segment the room information in the drawing and obtain several segmentation blocks; Loop address matching module: extracts text information from engineering drawings through text information recognition; and, Determine whether the text information contains a loop address; if yes, match the icon box in the segmentation block with the text box to obtain the loop address of the corresponding icon; mark the unmatched text box as a text box containing the room name, and obtain the room name corresponding to the segmentation block based on the text box containing the room name; if no, plan the loop address of the fire protection component.

2. According to the method of automatic marking of firefighting parts based on drawing recognition model in claim 1, it is characterized in that: The process of separating and saving the engineering drawings by constructing a bounding box includes: Get the drawing from the database, traverse all the entity graphics in the drawing through CAD, and build several bounding boxes according to the position of each entity graphic; (x min ,y min ) is defined as the coordinates of the lower left corner of the bounding box, and (x max ,y max ) is defined as the coordinates of the upper right corner of the bounding box; Set inclusion condition 1 to: The second inclusion condition is: The third inclusion condition is: The fourth inclusion condition is: Among them, A and B represent bounding boxes at two different positions; The outer rectangular frame is used to determine whether all the inclusion conditions are met between the bounding boxes at the same time; if yes, the bounding boxes that meet the inclusion conditions are merged into the same bounding box, and the boundary of the largest bounding box is used as the outermost rectangular frame of the merged bounding box; if no, there is no need to merge the determined bounding boxes; Create several subsets according to each outermost rectangular frame, and save all entity graphics contained in the outermost rectangular frame to CAD file 1; Call the optical character recognition model to recognize the text information in the drawing, and mark the bounding box of the text box corresponding to the text information; save all the marked text information in the drawing contained in the text box to CAD file 2; wherein the marked text information includes: loop address and room name; the text box includes: a text box containing the loop address and a text box containing the room name.

3. The method for automatically marking firefighting components based on a drawing recognition model according to claim 1 is characterized in that: The step of constructing a target detection model to obtain an output feature map includes: Retrieve the entity graph and use it as the input feature graph; mark the weights of the convolutional layer as {W i }, mark the transformation obtained by the convolution layer and ReLU activation function as F(X i-1 ,{W i }); where the set {W i } = {K, C, H, W}, K is the number of convolution kernels, C is the number of input channels, H is the height of the convolution kernel, and W is the width of the convolution kernel; Select a convolution kernel with the same number of channels as the input feature map; obtain the spatial value of the convolution kernel by multiplying the height and width of the convolution kernel; place the convolution kernel at the starting position of the input feature map, multiply the convolution kernel with the corresponding elements of the input feature map area covered by the convolution kernel one by one and sum them up to obtain the convolution result of the covered area of ​​the current input feature map; slide the convolution kernel on the input feature map and repeat the calculation until the entire input feature map is traversed; By formula X i =F(X i-1 ,{W i })+X i-1 The output feature map of the residual block is calculated; where i represents the number of layers of the feature map, and the value range of i is a positive integer greater than 1.

4. The method for automatically marking firefighting components based on a drawing recognition model according to claim 1 is characterized in that: The step of obtaining the firefighting component icons and corresponding icon frames in the output feature graph includes: Retrieve the output feature map and use the formula P i =F(X i )+upsample(P i+1 ) calculates the corresponding fusion feature map generated for each layer of feature map; where F(X i ) is the convolution function, upsample(P i+1 ) is the upsampling function; The region proposal network uses the adaptive anchor box technology to generate several candidate regions from the fused feature map, and the non-maximum suppression algorithm is used to screen the high-quality candidate regions, which are used as fire component icons. The high-quality candidate regions are mapped to the feature map, fixed-size features are extracted through the region of interest pooling layer, each high-quality candidate region is convolved to output several high-quality candidate region bounding boxes, and the high-quality candidate region bounding boxes are used as the corresponding icon boxes.

5. The method for automatically marking firefighting components based on a drawing recognition model according to claim 4 is characterized in that: The high-quality candidate regions are obtained by screening using a non-maximum suppression algorithm, including: S110: Retrieving candidate boxes corresponding to several candidate regions and obtaining confidence scores of the candidate boxes; S120: sorting the candidate boxes in descending order according to the confidence scores; S130: Select the box with the highest score from the sorted list as the current box and mark it as C; S140: By formula The intersection over union (IoU) (C, D) is calculated; where C and D are two different candidate boxes, and the confidence score of C is greater than the confidence score of D; Area (C∩D) is the intersection area of ​​the two boxes, and Area (C∪D) is the union area of ​​the two boxes; S150: The IoU threshold is calculated by the formula θ=θ0+α·ρ+β·c; wherein θ0 is the basic IoU threshold, ρ is the density of the candidate box, c is the confidence, α and β are adjustment coefficients, and the value range of α and β is (0, 1); S160: Determine whether the intersection over union (IoU) (C, D) is greater than the IoU threshold; if yes, remove the candidate box D with a small relative confidence score; if no, proceed to S170; S170: Repeat steps S130-S160 until all candidate boxes are processed; and mark the candidate regions corresponding to the selected candidate boxes as high-quality candidate regions.

6. The method for automatically marking firefighting components based on a drawing recognition model according to claim 1 is characterized in that: The building of the target segmentation model segmentation drawing includes: S210: down-sampling and up-sampling layer by layer through the encoder-decoder structure to obtain sample pixels, connecting the corresponding encoder and decoder layers through skip connections; calling the feature map X in the skip connection, S220: By formula Calculate the activation function; S230: The attention weight is calculated by the formula W=σ·[W1·ReLU(W2·X+b2)+b1]); wherein W1 represents the feature map of the encoder, W2 represents the feature map of the decoder; b1 and b2 are both bias terms; S240: By Formula X selected =W·X to calculate the output feature map X selected ; S250: Convolve the last layer output feature map to obtain the feature map and convert it into the category probability of each pixel and mark it as The true pixel category is labeled as y; By formula The loss value is calculated; where j represents the number of categories of sample pixels, and the value range of j is a positive integer; S260: Set a preset round, and determine whether the number of calculations of the loss value is greater than the preset round; if yes, proceed to S270; if no, continue to determine; S270: Classify the sample pixels and output the category of each pixel, and use each pixel category as a corresponding segmentation block; wherein the segmentation block contains the room outline information in the drawing; the room outline information includes: the center coordinates of the room block, the width of the room, and the height of the room.

7. The method for automatically marking firefighting components based on a drawing recognition model according to claim 1 is characterized in that: The step of matching the icon box and the text box in the segmented block to obtain the loop address of the corresponding icon includes: Retrieve the icon box and the text box to obtain the distance between them; determine whether there are multiple text boxes with the same distance to the same icon box; if so, obtain the overlap rate of the bounding boxes of the icon box and the corresponding multiple text boxes, and give priority to matching the bounding box of the icon box with the bounding box of the text box with the highest overlap rate; if not, match the icon box and the corresponding text box based on the principle of shortest distance first.

8. The method for automatically marking firefighting components based on a drawing recognition model according to claim 1 is characterized in that: The step of obtaining the room name corresponding to the segmented block according to the text box containing the room name includes: Retrieve several segments and text boxes that failed to match; mark the number of segments as r, and the width and height of the segments as W respectively r , H r , the width and height of the text box are marked as W and t , H t , the width and height of the icon box are marked as W p , H p ; Set the center coordinate of the segment block to C room =(x r ,y r ), the center coordinate of the text box is C text =(x t ,y t ), the center coordinate of the icon frame is C icon =(x p ,y p ); Mark the coordinate of the lower left corner of the segmented block as (x min_room ,y min_room ), the coordinate of the upper right corner of the segment is marked as (x max_room ,y max_room ); Among them, through the formula Calculate the horizontal coordinate of the lower left corner; By formula Calculate the vertical coordinate of the lower left corner; By formula Calculate the horizontal coordinate of the upper right corner; By formula Calculate the vertical coordinate of the upper right corner; Set the text box internal condition 1 to: x min_room <x r <x max_room , the second condition inside the text box is: y min_room <y r <y max_room ; Set the internal condition of the icon frame to: x min_room <x p <x max_room , the second condition inside the icon box is: y min_room <y p <y max_room ; Determine whether the center coordinates of the text box simultaneously meet the internal conditions of all text boxes; if yes, the text box is located inside the segmentation block; use the text box information contained in the current segmentation block as the room name represented by the current segmentation block; if no, continue to determine until all rooms match the room name; Determine whether the center coordinates of the icon frame simultaneously meet the internal conditions of all icon frames; if yes, the icon frame is located inside the segmentation block; use the room name of the current segmentation block as the remark information of the current icon; if no, continue to determine until all icons match the room name as the remark information.

9. The method for automatically marking firefighting components based on a drawing recognition model according to claim 1, characterized in that: The fire protection component circuit address planning includes: S310: Obtain the number of firefighting components in the segmented block and classify the components according to the firefighting component type; S320: Obtain fire protection component location information, component type and wiring connectivity to sort each type of equipment, and encode the loop addresses of each type of components in sequence according to the sorted component information; wherein the fire protection component location information includes: the coordinates of the icon and the corresponding room name; S330: Determine whether the addressing of the current fire protection component is completed; if yes, determine whether all fire protection components have completed addressing; if yes, save the loop address of the fire protection component; if no, edit the next type of equipment and re-sort according to the location information; If not, the loop addresses of various components are re-encoded; among them, the fire protection component types include: detector type, supervision module type and others.

10. A fire-fighting component automatic labeling system based on a drawing recognition model, applied to a fire-fighting component automatic labeling method based on a drawing recognition model as claimed in any one of claims 1 to 9, characterized in that: include: Icon acquisition module: obtain engineering drawings, separate and save the engineering drawings by building bounding boxes, and build a target detection model to obtain output feature maps; Obtain the fire component icons and corresponding icon frames in the output feature map; Model building module: construct the target segmentation model to segment the room information in the drawing and obtain several segmentation blocks; Loop address matching module: extract text information from engineering drawings through text information recognition, and determine whether the text information contains a loop address; if yes, match the icon box in the segmentation block with the text box to obtain the loop address of the corresponding icon; mark the unmatched text box as a text box containing the room name, and obtain the room name corresponding to the segmentation block based on the text box containing the room name; if no, plan the loop address of the fire protection component.

Citation Information

Patent Citations

  • Automatic drawing dimensioning method and system based on name search and feature recognition

    CN115063827B

Cited By

  • Fire control room graph display device and automatic graph importing method and device thereof

    CN121188020A