AI-based underground pipe network electrical drawing generation method and system
By using multi-layer encoder, visual feature extraction network and graph structure conversion technology in the AI-based electrical drawing generation method of underground pipeline network, combined with attention mechanism and improved U-Net structure, the shortcomings of multi-modal data fusion and spatial information utilization in the existing technology are solved, and high-quality drawing generation and evaluation are achieved.
Patent Information
- Application Number
- CN202510081129.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-20
AI Technical Summary
The existing AI-based electrical drawing generation method for underground pipeline networks has limitations when processing multimodal input data, and it is difficult to effectively integrate text design requirements, reference drawings and geological survey data, making it difficult for the generated drawings to fully consider all factors. At the same time, the existing methods lack full utilization of spatial information when generating the layout and connection relationship of the drawing, which affects the rationality and implementability of the drawing generation. Finally, existing methods often use a single evaluation indicator when evaluating the quality of generated drawings, making it difficult to fully consider multiple aspects such as layout rationality, detail accuracy and standard compliance.
Text feature extraction is performed using a multi-layer encoder with underground pipeline electrical professional dictionary, image features are processed using visual feature extraction networks with edge detection branches, and engineering features are processed through graph structure transformation and feature aggregation. Then, the fusion feature vector is generated through the dynamic weight allocation of attention mechanism, the three-dimensional position distribution heat map and connection relationship matrix are generated using the improved U-Net structure and multi-head attention mechanism, and the initial drawing is generated through the detailed optimization network, and a comprehensive quality evaluation is performed through the multi-discriminator collaborative verification.
The effective integration of multi-modal input data is achieved, the accuracy and rationality of generating drawings are improved, the spatial information is fully utilized, the implementability of drawings is enhanced, and the quality of generating drawings is ensured through multi-angle quality evaluation.
Smart Images

Figure CN119514091B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an AI-based underground pipe network electrical drawing generation method and system. Background Art
[0002] In recent years, with the development of artificial intelligence technology, AI-based underground pipeline network electrical drawing generation methods have gradually attracted attention. These methods analyze a large amount of historical design data through machine learning algorithms, automatically generate electrical drawings that meet the requirements, and improve design efficiency and quality. However, the existing AI-based underground pipeline network electrical drawing generation methods still have some defects and shortcomings: First, the existing methods have limitations in processing multimodal input data, and it is difficult to effectively integrate different types of information such as text design requirements, reference drawings, and geological survey data, resulting in the difficulty of generating drawings that fully consider all aspects.
[0003] Secondly, the existing methods lack full utilization of spatial information when generating the layout and connection relationship of drawings, making it difficult to accurately grasp the three-dimensional spatial distribution characteristics of electrical components in underground pipeline networks, which affects the rationality and feasibility of generated drawings.
[0004] Finally, existing methods often use a single evaluation index to evaluate the quality of generated drawings, which makes it difficult to comprehensively consider multiple aspects such as layout rationality, detail accuracy, and compliance with specifications. As a result, the generated drawings may have potential problems, affecting the actual application effect. Summary of the invention
[0005] The embodiments of the present invention provide an AI-based underground pipe network electrical drawing generation method and system, which can solve the problems in the prior art.
[0006] According to a first aspect of the embodiments of the present invention,
[0007] Provides an AI-based underground pipe network electrical drawing generation method, including:
[0008] The input design requirement text is subjected to feature extraction using a multi-layer encoder with an underground pipe network electrical professional dictionary to obtain a text feature vector; the input underground pipe network reference electrical drawings are processed using a visual feature extraction network with an edge detection branch to obtain an image feature vector; the input engineering file containing geological survey data is subjected to graph structure conversion and feature aggregation to obtain an engineering feature vector; the text feature vector, image feature vector and engineering feature vector are dynamically weighted by an attention mechanism to generate a fused feature vector;
[0009] Based on the fused feature vector, a three-dimensional position distribution heat map of underground pipe network electrical components is generated through a layout generation network, and the layout generation network adopts an improved U-Net structure with a spatial self-attention module; the three-dimensional position distribution heat map is converted into a graph structure, and the spatial connection relationship between the nodes of the graph structure is learned through the multi-head attention mechanism of the connection relationship generation network to generate a connection relationship matrix; the three-dimensional position distribution heat map and the connection relationship matrix are input into the detail optimization network, and an initial underground pipe network electrical drawing is generated through a feature adaptive normalization layer and a residual connection mechanism;
[0010] The initial underground pipe network electrical drawing is subjected to multi-discriminator collaborative verification, including: using a global discriminator with a spatial pyramid pooling module to evaluate the layout rationality score, using a local discriminator based on contrastive learning to evaluate the detail accuracy score, and using a specification discriminator based on a rule-based attention mechanism to evaluate the specification compliance score; weighted fusion of the layout rationality score, detail accuracy score and specification compliance score to obtain a final evaluation score; and outputting the final underground pipe network electrical drawing when the final evaluation score is greater than or equal to a preset threshold.
[0011] In an optional embodiment,
[0012] The input design requirement text is subjected to feature extraction using a multi-layer encoder with an underground pipe network electrical professional dictionary to obtain a text feature vector; the input underground pipe network reference electrical drawing is subjected to processing using a visual feature extraction network with an edge detection branch to obtain an image feature vector; the input engineering file containing geological survey data is subjected to graph structure conversion and feature aggregation to obtain an engineering feature vector, including the following steps:
[0013] An electrical professional dictionary containing electrical components, connection relationships and underground laying process parameters of underground pipe networks is constructed, and the input design requirement text is segmented to obtain a word sequence; in the word embedding layer, multiple related entries are found from the electrical professional dictionary for each word in the word sequence, and the vectors of these related entries are weighted and summed to obtain word embedding; based on the word embedding, a distance perception mechanism is introduced in the self-attention layer, and the attention score is distance-weighted, and the context representation of the text is obtained through encoder processing, and the text feature vector is obtained through feature aggregation;
[0014] Perform edge detection on the input underground pipe network reference electrical drawing to obtain an edge map, perform three-dimensional image block division and linear projection on the underground pipe network reference electrical drawing and the edge map respectively; adopt a two-stream attention mechanism to interactively enhance the image block features of the underground pipe network reference electrical drawing and the image block features of the edge map, combine the interactively enhanced image block features with the original image block features through a learnable fusion coefficient, and obtain an image feature vector through feature aggregation;
[0015] The engineering file is converted into a graph structure, with underground pipe network electrical components as nodes and connection relationships as edges, and the node features are extracted to obtain initial node features; the initial node features are updated through an edge-based message passing mechanism; and the updated initial node features are aggregated using a graph-level feature extraction function to obtain an engineering feature vector.
[0016] In an optional embodiment,
[0017] The steps of dynamically assigning weights to the text feature vector, the image feature vector, and the engineering feature vector through an attention mechanism to generate a fused feature vector include:
[0018] Map the text feature vector, image feature vector and engineering feature vector to a semantic space of uniform dimension through a learnable linear mapping matrix and a bias term to obtain semantically aligned text features, image features and engineering features;
[0019] Performing cross-modal attention calculation on text features, image features and engineering features, including: converting text features into a semantic interaction query matrix through a learnable feature transformation matrix, converting image features and engineering features into cross-modal feature key matrices respectively, performing dot product operations on the semantic interaction query matrix and the cross-modal feature key matrix respectively and performing normalization processing to obtain a text-image attention matrix and a text-engineering attention matrix;
[0020] Perform dot product operations on text features, image features, and engineering features, respectively, and normalize them to obtain the text feature internal attention matrix, the image feature internal attention matrix, and the engineering feature internal attention matrix;
[0021] The text feature internal attention matrix is combined with the text-image attention matrix and the text-engineering attention matrix to form a text feature fusion matrix, the image feature internal attention matrix is combined with the text-image attention matrix to form an image feature fusion matrix, and the engineering feature internal attention matrix is combined with the text-engineering attention matrix to form an engineering feature fusion matrix;
[0022] Performing nonlinear transformation on the text feature fusion matrix, the image feature fusion matrix and the engineering feature fusion matrix to dynamically generate text feature weights, image feature weights and engineering feature weights that reflect the importance of features;
[0023] The text feature weights and text features, the image feature weights and image features, and the engineering feature weights and engineering features are weighted and fused respectively and summed up, and the fused feature vector is obtained after normalization.
[0024] In an optional embodiment,
[0025] Based on the fused feature vector, a three-dimensional position distribution heat map of underground pipe network electrical components is generated through a layout generation network, and the layout generation network adopts an improved U-Net structure with a spatial self-attention module; the three-dimensional position distribution heat map is converted into a graph structure, and the spatial connection relationship between the graph structure nodes is learned through the multi-head attention mechanism of the connection relationship generation network to generate a connection relationship matrix; the three-dimensional position distribution heat map and the connection relationship matrix are input into the detail optimization network, and the steps of generating an initial underground pipe network electrical drawing through a feature adaptive normalization layer and a residual connection mechanism include:
[0026] The layout generation network adopts an improved U-Net structure, and a self-attention module is set in each layer of the encoder and decoder of the improved U-Net structure. The self-attention module models the long-range spatial dependency relationship of the underground space by calculating the attention weights between each position in the input feature map, including: obtaining an initial feature map by upsampling and convolution operations on the fused feature vector, generating a spatial position query matrix, an underground environment local feature key matrix and a feature transformation value matrix for the initial feature map through a convolution layer, calculating the dot product of the spatial position query matrix and the underground environment local feature key matrix and normalizing them to obtain a spatial attention weight, multiplying the spatial attention weight with the feature transformation value matrix to obtain an attention output, performing a residual connection between the attention output and the initial feature map to obtain an enhanced feature map, and obtaining a three-dimensional position distribution heat map containing deep buried information of the underground pipe network through an activation function on the enhanced feature map;
[0027] Extracting local maximum points in the three-dimensional position distribution heat map as candidate element positions of the underground pipe network and constructing an initial graph structure, calculating the relationship features between nodes in the initial graph structure through a multi-head attention mechanism of a connection relationship generation network, wherein the multi-head attention mechanism includes multiple parallel attention heads, and connecting the relationship features calculated by the multiple attention heads and mapping them through a feedforward network to obtain a connection relationship matrix of the underground pipe network;
[0028] The three-dimensional position distribution heat map and the connection relationship matrix are input into a detail optimization network, the detail optimization network includes multiple residual blocks, and a feature adaptive normalization layer is set in each residual block; the detail optimization network extracts layout features from the three-dimensional position distribution heat map through a convolution layer, and the feature adaptive normalization layer adaptively modulates the layout features according to the connection relationship matrix to obtain optimized layout features, and the underground pipeline layout constraint information of the three-dimensional position distribution heat map is fused with the optimized layout features through a residual connection mechanism to generate an initial underground pipeline electrical drawing that meets the underground pipeline layout constraints and connection relationship constraints.
[0029] In an optional embodiment,
[0030] The step of adaptively modulating the layout features according to the connection relationship matrix by the feature adaptive normalization layer to obtain optimized layout features includes:
[0031] The connection relationship matrix is input into a parameter generation network, wherein the parameter generation network comprises a three-layer feedforward network structure, wherein the first two layers of the feedforward network are configured with a ReLU activation function for extracting nonlinear features, and the last layer of the feedforward network generates a depth scaling parameter and a burial depth offset parameter based on the real-time connection status between electrical components of the underground pipe network, wherein the depth scaling parameter and the burial depth offset parameter are dynamically updated as the connection relationship of the underground pipe network changes;
[0032] The layout features are subjected to channel-level standardization processing, including: constructing a feature channel attention map based on the connection relationship matrix, calculating the spatial correlation degree between feature channels according to the feature channel attention map, calculating the weighted mean and variance for each feature channel using the spatial correlation degree as a weight, and obtaining standardized features that change with the connection relationship of the underground pipe network;
[0033] Constructing a feature modulation feedback mechanism, the feature modulation feedback mechanism comprising: calculating the deviation value between the actual connection distance and the preset connection distance between the electrical components of the underground pipe network in the current layout scheme, adjusting the depth scaling parameter and the burial depth offset parameter in real time based on the deviation value, normalizing the adjusted depth scaling parameter by a sigmoid function to obtain a normalized scaling parameter, multiplying the normalized scaling parameter by the standardized feature to obtain a proportional modulation feature, weighting the burial depth offset parameter and the position constraint information of the electrical components of the underground pipe network to obtain a position offset feature, and fusing the proportional modulation feature with the position offset feature to obtain a preliminary modulation feature;
[0034] A feature channel adaptive selection module is designed, which includes a gating network. The gating network calculates the channel importance score according to the correlation between each feature channel and the connection relationship between the electrical components of the underground pipeline network, and generates a modulation weight based on the channel importance score; the modulation weight is weightedly fused with the preliminary modulation feature to obtain an optimized layout feature.
[0035] In an optional embodiment,
[0036] The initial underground pipe network electrical drawing is subjected to multi-discriminator collaborative verification, including: using a global discriminator with a spatial pyramid pooling module to evaluate the layout rationality score, using a local discriminator based on contrastive learning to evaluate the detail accuracy score, and using a specification discriminator based on a rule-based attention mechanism to evaluate the specification compliance score; weighted fusion of the layout rationality score, detail accuracy score and specification compliance score to obtain a final evaluation score; when the final evaluation score is greater than or equal to a preset threshold, the step of outputting the final underground pipe network electrical drawing includes:
[0037] The initial underground pipe network electrical drawing is converted into a three-dimensional layout feature map through a feature extraction network, and the rationality of the underground space layout is evaluated by a global discriminator with a spatial pyramid pooling module. The global discriminator obtains a multi-scale feature representation containing depth information from the three-dimensional layout feature map through adaptive pooling layers of different scales, and the multi-scale feature representation is spliced to form a three-dimensional multi-scale fusion feature after feature mapping, and a layout rationality score is output based on the three-dimensional multi-scale fusion feature;
[0038] Determine the area to be evaluated according to the layout rationality score, input the features of the area to be evaluated corresponding to the three-dimensional layout feature map into a local discriminator, the local discriminator uses a contrastive learning method to construct positive and negative sample pairs based on the underground pipe network electrical standard layout, and trains a feature extractor by maximizing the mutual information of positive sample pairs and minimizing the mutual information of negative sample pairs. The feature extractor calculates the matching degree between the area to be evaluated and the underground pipe network electrical standard layout in the local area to obtain a detail accuracy score;
[0039] A rule vector generation network is constructed, which converts the preset underground pipe network electrical laying specifications into rule vectors, and the rule vectors are input into a specification discriminator. The specification discriminator calculates the feature matching attention weights of the three-dimensional layout feature map and the rule vector based on the rule attention mechanism, and weights the three-dimensional layout feature map according to the feature matching attention weights to obtain specification-related features, and performs feature fusion of the detail accuracy score and the specification-related features to obtain a specification compliance score.
[0040] In an optional embodiment,
[0041] The method further comprises:
[0042] The confidence level of the layout rationality score of the underground pipe network electrical layout is obtained by calculating the consistency of the three-dimensional multi-scale fusion features. The confidence level of the detail accuracy score of the pipeline laying is calculated based on the loss function value of contrastive learning. The confidence level of the specification compliance score of the underground pipe network electrical construction is determined according to the distribution entropy value of the feature matching attention weight.
[0043] The confidence of the layout rationality score, the confidence of the detail accuracy score and the confidence of the specification compliance score are normalized to obtain their respective corresponding weight coefficients, and the weight coefficients are smoothed by exponential sliding average to obtain their respective corresponding fusion weights;
[0044] The final evaluation score is obtained by weighted summing the layout rationality score, detail accuracy score and specification compliance score with their respective corresponding fusion weights;
[0045] A preset threshold is determined based on the historical average of the layout rationality score, detail accuracy score and specification compliance score. When the final evaluation score is greater than or equal to the preset threshold, the final underground pipeline network electrical drawing is output. When the final evaluation score is less than the preset threshold, the layout rationality score, detail accuracy score and specification compliance score are used as conditional parameters, and the detail optimization network is re-input, and the underground pipeline network electrical drawing is generated in combination with the three-dimensional position distribution heat map and the connection relationship matrix.
[0046] According to a second aspect of the embodiments of the present invention,
[0047] Provides an AI-based underground pipe network electrical drawing generation system, including:
[0048] The first unit is used to extract features from the input design requirement text using a multi-layer encoder with an underground pipe network electrical professional dictionary to obtain a text feature vector; process the input underground pipe network reference electrical drawings using a visual feature extraction network with an edge detection branch to obtain an image feature vector; obtain an engineering feature vector through graph structure conversion and feature aggregation for the input engineering file containing geological survey data; dynamically assign weights to the text feature vector, image feature vector and engineering feature vector through an attention mechanism to generate a fused feature vector;
[0049] The second unit is used to generate a three-dimensional position distribution heat map of underground pipe network electrical components through a layout generation network based on the fused feature vector, wherein the layout generation network adopts an improved U-Net structure with a spatial self-attention module; convert the three-dimensional position distribution heat map into a graph structure, learn the spatial connection relationship between the nodes of the graph structure through the multi-head attention mechanism of the connection relationship generation network, and generate a connection relationship matrix; input the three-dimensional position distribution heat map and the connection relationship matrix into a detail optimization network, and generate an initial underground pipe network electrical drawing through a feature adaptive normalization layer and a residual connection mechanism;
[0050] The third unit is used to perform multi-discriminator collaborative verification on the initial underground pipe network electrical drawing, including: using a global discriminator with a spatial pyramid pooling module to evaluate the layout rationality score, using a local discriminator based on contrastive learning to evaluate the detail accuracy score, and using a specification discriminator based on a rule-based attention mechanism to evaluate the specification compliance score; weighted fusion of the layout rationality score, detail accuracy score and specification compliance score to obtain a final evaluation score; and outputting the final underground pipe network electrical drawing when the final evaluation score is greater than or equal to a preset threshold.
[0051] According to a third aspect of the embodiments of the present invention,
[0052] An electronic device is provided, comprising:
[0053] processor;
[0054] a memory for storing processor-executable instructions;
[0055] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.
[0056] A fourth aspect of the embodiments of the present invention is:
[0057] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.
[0058] The present invention effectively integrates the information of design requirement text, reference drawings and engineering data through multimodal feature fusion and attention mechanism, and improves the accuracy and rationality of generated drawings. The use of professional dictionaries and edge detection technologies enhances the pertinence of feature extraction, making the generated drawings more in line with the characteristics of underground pipe network electrical engineering.
[0059] The present invention adopts an improved layout generation network and connection relationship generation network, which can effectively process the three-dimensional spatial distribution and connection relationship of electrical components in underground pipe networks. Through the spatial self-attention and multi-head attention mechanism, the spatial layout rationality and connection accuracy of the generated drawings are improved. The introduction of the detail optimization network further improves the quality and precision of the generated drawings.
[0060] The present invention introduces a multi-discriminator collaborative verification mechanism to evaluate the generated drawings from multiple dimensions, including layout rationality, detail accuracy, and specification compliance. This multi-angle verification mechanism effectively ensures the quality of the generated drawings and improves the reliability and practicality of the generated results. Overall, this method realizes the intelligent generation of electrical drawings for underground pipe networks, which can greatly improve design efficiency and quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1A schematic diagram of a flow chart of a method for generating an electrical drawing of an underground pipe network based on AI according to an embodiment of the present invention;
[0062] Figure 2 This is a structural schematic diagram of an AI-based underground pipe network electrical drawing generation system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not 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.
[0064] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0065] Figure 1 FIG. 1 is a flow chart of a method for generating an underground pipe network electrical drawing based on AI according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0066] S1. Extract features from the input design requirement text using a multi-layer encoder with an underground pipe network electrical professional dictionary to obtain a text feature vector; process the input underground pipe network reference electrical drawings using a visual feature extraction network with an edge detection branch to obtain an image feature vector; obtain an engineering feature vector through graph structure conversion and feature aggregation for the input engineering file containing geological survey data; dynamically assign weights to the text feature vector, image feature vector and engineering feature vector through an attention mechanism to generate a fused feature vector;
[0067] S2. Based on the fused feature vector, a three-dimensional position distribution heat map of underground pipe network electrical components is generated through a layout generation network, wherein the layout generation network adopts an improved U-Net structure with a spatial self-attention module; the three-dimensional position distribution heat map is converted into a graph structure, and the spatial connection relationship between the nodes of the graph structure is learned through the multi-head attention mechanism of the connection relationship generation network to generate a connection relationship matrix; the three-dimensional position distribution heat map and the connection relationship matrix are input into a detail optimization network, and an initial underground pipe network electrical drawing is generated through a feature adaptive normalization layer and a residual connection mechanism;
[0068] S3. Perform multi-discriminator collaborative verification on the initial underground pipe network electrical drawing, including: using a global discriminator with a spatial pyramid pooling module to evaluate the layout rationality score, using a local discriminator based on contrastive learning to evaluate the detail accuracy score, and using a specification discriminator based on a rule-based attention mechanism to evaluate the specification compliance score; performing weighted fusion on the layout rationality score, detail accuracy score and specification compliance score to obtain a final evaluation score; and outputting the final underground pipe network electrical drawing when the final evaluation score is greater than or equal to a preset threshold.
[0069] In an optional embodiment,
[0070] The input design requirement text is subjected to feature extraction using a multi-layer encoder with an underground pipe network electrical professional dictionary to obtain a text feature vector; the input underground pipe network reference electrical drawing is subjected to processing using a visual feature extraction network with an edge detection branch to obtain an image feature vector; the input engineering file containing geological survey data is subjected to graph structure conversion and feature aggregation to obtain an engineering feature vector, including the following steps:
[0071] An electrical professional dictionary containing electrical components, connection relationships and underground laying process parameters of underground pipe networks is constructed, and the input design requirement text is segmented to obtain a word sequence; in the word embedding layer, multiple related entries are found from the electrical professional dictionary for each word in the word sequence, and the vectors of these related entries are weighted and summed to obtain word embedding; based on the word embedding, a distance perception mechanism is introduced in the self-attention layer, and the attention score is distance-weighted, and the context representation of the text is obtained through encoder processing, and the text feature vector is obtained through feature aggregation;
[0072] Perform edge detection on the input underground pipe network reference electrical drawing to obtain an edge map, perform three-dimensional image block division and linear projection on the underground pipe network reference electrical drawing and the edge map respectively; adopt a two-stream attention mechanism to interactively enhance the image block features of the underground pipe network reference electrical drawing and the image block features of the edge map, combine the interactively enhanced image block features with the original image block features through a learnable fusion coefficient, and obtain an image feature vector through feature aggregation;
[0073] The engineering file is converted into a graph structure, with underground pipe network electrical components as nodes and connection relationships as edges, and the node features are extracted to obtain initial node features; the initial node features are updated through an edge-based message passing mechanism; and the updated initial node features are aggregated using a graph-level feature extraction function to obtain an engineering feature vector.
[0074] For example, first, an electrical professional dictionary containing underground pipe network electrical components, connection relationships, and underground laying process parameters is constructed. The dictionary contains common underground pipe network electrical components such as cables, grounding devices, transformers, etc., as well as the connection relationships between them such as parallel and series connection, and also includes underground laying related process parameters such as burial depth, pipe diameter, etc. For example, the dictionary may contain entries such as "10kV power cable", "burial depth 1.2m", "parallel connection", etc.
[0075] The input design requirement text is segmented to obtain a word sequence. For example, the input text "two 10kV power cables are laid underground, with a spacing of 0.3m and a burial depth of 1.2m" is segmented to obtain ["underground", "laying", "two", "10kV", "power cable", "spacing", "0.3m", "burial depth", "1.2m"].
[0076] In the word embedding layer, multiple related terms are found from the electrical professional dictionary for each word in the word sequence. For example, for "10kV power cable", related terms such as "high voltage cable", "insulation layer", "copper core" may be found. The vectors of these related terms are weighted and summed to obtain the word embedding. Assuming that the vector dimension of each term is 100, the word embedding obtained is also a 100-dimensional vector.
[0077] Next, the distance perception mechanism is introduced in the self-attention layer. The distance between words is calculated and the attention score is weighted by distance. The closer the distance is, the higher the attention score is. For example, the distance between "power cable" and "burial depth" is close, and the attention score between them will be relatively high.
[0078] After being processed by multiple layers of encoders, the contextual representation of the text is obtained. Each layer of encoder considers the relationship between words and captures long-distance dependencies. The output of the last layer of encoder is the contextual representation of the text.
[0079] The text feature vector is obtained by feature aggregation. Methods such as average pooling or maximum pooling can be used to aggregate the context representation into a vector of fixed dimension as the final text feature vector.
[0080] For the input underground pipe network reference electrical drawing, edge detection is first performed to obtain an edge map. Algorithms such as Canny edge detection can be used. For example, the cable lines in the original drawing will be highlighted in the edge map.
[0081] Then, the original electrical drawings and edge maps are divided into three-dimensional image blocks. The image is divided into multiple overlapping small blocks, each of which contains information from three channels. These image blocks are linearly projected and mapped to a higher-dimensional feature space.
[0082] The dual-stream attention mechanism is used to interactively enhance the image block features of the original drawing and the image block features of the edge map. The dual streams here refer to the original image stream and the edge image stream. By calculating the attention weights between the two streams, the original image features can focus on important edge information, and the edge features can also be combined with the semantic information of the original image.
[0083] The interactively enhanced image block features are combined with the original image block features through a learnable fusion coefficient. The fusion coefficient determines the importance ratio of the enhanced features and the original features. Finally, the image feature vector is obtained through feature aggregation. The features of all image blocks can be aggregated into one vector using methods such as global average pooling.
[0084] For engineering files containing geological survey data, they are first converted into a graph structure. The electrical components of the underground pipeline network are used as nodes, and the connection relationship is used as an edge. For example, a transformer and a cable can be used as two nodes, and the connection relationship between them is used as an edge.
[0085] Extract the features of the nodes to obtain the initial node features. The node type, parameters and other information can be considered. For example, for a transformer node, its capacity, voltage level and other features can be extracted.
[0086] The initial node features are updated through an edge-based message passing mechanism. Each node transmits its own feature information to adjacent nodes, and the receiving node updates its own features based on the received information. This process can be iterated multiple times so that each node can perceive the global topological structure information.
[0087] Finally, the updated node features are aggregated using the graph-level feature extraction function to obtain the engineering feature vector. Methods such as graph pooling or graph readout can be used to aggregate the features of all nodes into a vector of fixed dimension as the final engineering feature vector.
[0088] By constructing an electrical professional dictionary and introducing a distance perception mechanism, the present invention can more accurately understand the professional terms and contextual relationships in the design requirement text, improve the accuracy and pertinence of text feature extraction, better capture the key line and structure information in the underground pipe network reference electrical drawings, and improve the effect of image feature extraction.
[0089] In an optional embodiment,
[0090] The steps of dynamically assigning weights to the text feature vector, the image feature vector, and the engineering feature vector through an attention mechanism to generate a fused feature vector include:
[0091] Map the text feature vector, image feature vector and engineering feature vector to a semantic space of uniform dimension through a learnable linear mapping matrix and a bias term to obtain semantically aligned text features, image features and engineering features;
[0092] Performing cross-modal attention calculation on text features, image features and engineering features, including: converting text features into a semantic interaction query matrix through a learnable feature transformation matrix, converting image features and engineering features into cross-modal feature key matrices respectively, performing dot product operations on the semantic interaction query matrix and the cross-modal feature key matrix respectively and performing normalization processing to obtain a text-image attention matrix and a text-engineering attention matrix;
[0093] Perform dot product operations on text features, image features, and engineering features, respectively, and normalize them to obtain the text feature internal attention matrix, the image feature internal attention matrix, and the engineering feature internal attention matrix;
[0094] The text feature internal attention matrix is combined with the text-image attention matrix and the text-engineering attention matrix to form a text feature fusion matrix, the image feature internal attention matrix is combined with the text-image attention matrix to form an image feature fusion matrix, and the engineering feature internal attention matrix is combined with the text-engineering attention matrix to form an engineering feature fusion matrix;
[0095] Performing nonlinear transformation on the text feature fusion matrix, the image feature fusion matrix and the engineering feature fusion matrix to dynamically generate text feature weights, image feature weights and engineering feature weights that reflect the importance of features;
[0096] The text feature weights and text features, the image feature weights and image features, and the engineering feature weights and engineering features are weighted and fused respectively and summed up, and the fused feature vector is obtained after normalization.
[0097] For example, first, the input text feature vector, image feature vector and engineering feature vector are preprocessed. The text feature vector is usually generated by a word embedding model with a dimension of 300; the image feature vector is usually extracted by a pre-trained convolutional neural network with a dimension of 2048; the engineering feature vector is usually composed of manually designed features with a dimension of 100. In order to map these three feature vectors of different dimensions to a unified semantic space, three learnable linear mapping matrices and bias terms need to be designed.
[0098] For the text feature vector, it is mapped to the target dimension through the linear mapping matrix and the bias term. Specifically, a linear transformation is applied to the original text feature vector, including multiplication with the mapping matrix and adding the bias term, so as to obtain the mapped text feature vector. Using the same mapping method, the image feature vector and the engineering feature vector are respectively mapped to the same target dimension, and finally three feature vectors with the same dimension are obtained.
[0099] Next, the cross-modal attention is calculated on the mapped feature vector. First, the text features are converted into a semantic interaction query matrix (text query matrix) through a learnable feature transformation matrix. At the same time, the image features and engineering features are converted into cross-modal feature key matrices (image key matrix and engineering key matrix) respectively. Then, the text query matrix and the image key matrix are dot-producted to obtain the text-image attention matrix. Similarly, the dot product of the text query matrix and the engineering key matrix is used to obtain the text-engineering attention matrix.
[0100] For the calculation of internal attention, take text features as an example, use the text features themselves as query, key and value matrices, perform self-attention calculation, and obtain the text feature internal attention matrix. Similar internal attention calculations are also performed for image features and engineering features.
[0101] Then, the attention matrices are combined. For text features, the text feature internal attention matrix, the text-image attention matrix, and the text-engineering attention matrix are concatenated together to form a text feature fusion matrix. Similarly, the image feature fusion matrix and the engineering feature fusion matrix are obtained.
[0102] Next, the three fusion matrices are transformed nonlinearly to generate dynamic weights. Taking text features as an example, a fully connected layer plus a softmax activation function can be used to convert the text feature fusion matrix into text feature weights. Similarly, image feature weights and engineering feature weights are obtained.
[0103] Finally, the feature vector is multiplied by the corresponding weight, summed and L2 normalized to obtain the final fused feature vector.
[0104] For example, assume that the input text feature vector dimension is 300, the image feature vector dimension is 2048, and the engineering feature vector dimension is 100. First, map them to a 512-dimensional unified semantic space. Then calculate the cross-modal attention and internal attention to obtain 9 512x512 attention matrices. Combine these matrices into 3 512x1536 fusion matrices, and obtain 3 512-dimensional weight vectors after nonlinear transformation. Finally, multiply the weight vector and the feature vector and sum them to obtain a 512-dimensional fusion feature vector.
[0105] The present invention realizes the dynamic fusion of text, image and engineering features through the attention mechanism, and adopts learnable linear mapping and feature transformation matrix, so that the model can adaptively adjust the representation and interaction mode of different modal features.
[0106] In an optional embodiment,
[0107] Based on the fused feature vector, a three-dimensional position distribution heat map of underground pipe network electrical components is generated through a layout generation network, and the layout generation network adopts an improved U-Net structure with a spatial self-attention module; the three-dimensional position distribution heat map is converted into a graph structure, and the spatial connection relationship between the graph structure nodes is learned through the multi-head attention mechanism of the connection relationship generation network to generate a connection relationship matrix; the three-dimensional position distribution heat map and the connection relationship matrix are input into the detail optimization network, and the steps of generating an initial underground pipe network electrical drawing through a feature adaptive normalization layer and a residual connection mechanism include:
[0108] The layout generation network adopts an improved U-Net structure, and a self-attention module is set in each layer of the encoder and decoder of the improved U-Net structure. The self-attention module models the long-range spatial dependency relationship of the underground space by calculating the attention weights between each position in the input feature map, including: obtaining an initial feature map by upsampling and convolution operations on the fused feature vector, generating a spatial position query matrix, an underground environment local feature key matrix and a feature transformation value matrix for the initial feature map through a convolution layer, calculating the dot product of the spatial position query matrix and the underground environment local feature key matrix and normalizing them to obtain a spatial attention weight, multiplying the spatial attention weight with the feature transformation value matrix to obtain an attention output, performing a residual connection between the attention output and the initial feature map to obtain an enhanced feature map, and obtaining a three-dimensional position distribution heat map containing deep buried information of the underground pipe network through an activation function on the enhanced feature map;
[0109] Extracting local maximum points in the three-dimensional position distribution heat map as candidate element positions of the underground pipe network and constructing an initial graph structure, calculating the relationship features between nodes in the initial graph structure through a multi-head attention mechanism of a connection relationship generation network, wherein the multi-head attention mechanism includes multiple parallel attention heads, and connecting the relationship features calculated by the multiple attention heads and mapping them through a feedforward network to obtain a connection relationship matrix of the underground pipe network;
[0110] The three-dimensional position distribution heat map and the connection relationship matrix are input into a detail optimization network, the detail optimization network includes multiple residual blocks, and a feature adaptive normalization layer is set in each residual block; the detail optimization network extracts layout features from the three-dimensional position distribution heat map through a convolution layer, and the feature adaptive normalization layer adaptively modulates the layout features according to the connection relationship matrix to obtain optimized layout features, and the underground pipeline layout constraint information of the three-dimensional position distribution heat map is fused with the optimized layout features through a residual connection mechanism to generate an initial underground pipeline electrical drawing that meets the underground pipeline layout constraints and connection relationship constraints.
[0111] Exemplarily, based on the fused feature vector, a three-dimensional position distribution heat map of electrical components in the underground pipe network is generated through a layout generation network. The layout generation network adopts an improved U-Net structure with a spatial self-attention module. A self-attention module is set in each layer of the encoder and decoder of the improved U-Net structure.
[0112] First, the fused feature vector is upsampled and convolved to obtain the initial feature map. The initial feature map is convolved to generate the spatial position query matrix, the underground environment local feature key matrix, and the feature transformation value matrix. The dimension of the spatial position query matrix is HxWxC, where H and W are the height and width of the feature map, respectively, and C is the number of channels. The dimension of the underground environment local feature key matrix is also HxWxC. The dimension of the feature transformation value matrix is HxWxC.
[0113] Then, the dot product of the spatial location query matrix and the local feature key matrix of the underground environment is calculated to obtain the attention score matrix. The attention score matrix is normalized by softmax to obtain the spatial attention weight. The spatial attention weight is multiplied by the feature transformation value matrix to obtain the HxWxC dimensional attention output.
[0114] The attention output is residually connected to the initial feature map to obtain an enhanced feature map. The enhanced feature map is activated by the ReLU function to finally obtain a three-dimensional position distribution heat map containing the buried information of the underground pipeline network. The dimension of the heat map is HxWxD, where D represents the dimension in the depth direction. The value of each position in the heat map represents the probability of the existence of an underground pipeline electrical component at that position.
[0115] Next, the three-dimensional position distribution heat map is converted into a graph structure. Specifically, local maximum points are extracted from the heat map as candidate locations of underground pipe network components, and the initial graph structure G=(V, E) is constructed. V is a node set, representing the candidate component locations; E is an edge set, representing the potential connections between nodes.
[0116] Then, the spatial connection relationship between the nodes of the graph structure is learned through the multi-head attention mechanism of the connection relationship generation network. The multi-head attention mechanism contains 8 parallel attention heads. Each attention head first transforms the node features into three spaces: query, key, and value, and then calculates the similarity between the query and the key to obtain the attention score. The attention score is multiplied by the value to obtain the output of the head. The outputs of the 8 attention heads are concatenated and passed through a feedforward network to finally obtain an NxN connection relationship matrix, where N is the number of nodes. Each element in the connection relationship matrix represents the probability that there is a connection between the corresponding two nodes.
[0117] Finally, the three-dimensional position distribution heat map and the connection relationship matrix are input into the detail optimization network. The network contains 5 residual blocks, and a feature adaptive normalization layer is set in each residual block. First, the layout features are extracted from the heat map through a 3x3 convolution layer. Then the feature adaptive normalization layer modulates the layout features according to the connection relationship matrix, specifically: the connection relationship matrix is encoded as modulation parameters γ and β, and after normalizing the layout feature F, the modulated features are obtained by γ×F+β. Finally, the layout constraint information of the heat map is fused with the optimized layout features through residual connections to generate the initial underground pipe network electrical drawings that meet the layout and connection relationship constraints.
[0118] By introducing the spatial self-attention module, the present invention can effectively capture the long-range dependencies of the underground space and improve the accuracy of layout generation; the multi-head attention mechanism is adopted to learn the connection relationship between nodes, which makes full use of the spatial position information of the nodes and generates a more reasonable connection relationship; the feature adaptive normalization layer modulates the layout features according to the connection relationship, realizes the coordinated optimization of the layout and the connection relationship, and improves the quality of the generated drawings.
[0119] In an optional embodiment,
[0120] The step of adaptively modulating the layout features according to the connection relationship matrix by the feature adaptive normalization layer to obtain optimized layout features includes:
[0121] The connection relationship matrix is input into a parameter generation network, wherein the parameter generation network comprises a three-layer feedforward network structure, wherein the first two layers of the feedforward network are configured with a ReLU activation function for extracting nonlinear features, and the last layer of the feedforward network generates a depth scaling parameter and a burial depth offset parameter based on the real-time connection status between electrical components of the underground pipe network, wherein the depth scaling parameter and the burial depth offset parameter are dynamically updated as the connection relationship of the underground pipe network changes;
[0122] The layout features are subjected to channel-level standardization processing, including: constructing a feature channel attention map based on the connection relationship matrix, calculating the spatial correlation degree between feature channels according to the feature channel attention map, calculating the weighted mean and variance for each feature channel using the spatial correlation degree as a weight, and obtaining standardized features that change with the connection relationship of the underground pipe network;
[0123] Constructing a feature modulation feedback mechanism, the feature modulation feedback mechanism comprising: calculating the deviation value between the actual connection distance and the preset connection distance between the electrical components of the underground pipe network in the current layout scheme, adjusting the depth scaling parameter and the burial depth offset parameter in real time based on the deviation value, normalizing the adjusted depth scaling parameter by a sigmoid function to obtain a normalized scaling parameter, multiplying the normalized scaling parameter by the standardized feature to obtain a proportional modulation feature, weighting the burial depth offset parameter and the position constraint information of the electrical components of the underground pipe network to obtain a position offset feature, and fusing the proportional modulation feature with the position offset feature to obtain a preliminary modulation feature;
[0124] A feature channel adaptive selection module is designed, which includes a gating network. The gating network calculates the channel importance score according to the correlation between each feature channel and the connection relationship between the electrical components of the underground pipeline network, and generates a modulation weight based on the channel importance score; the modulation weight is weightedly fused with the preliminary modulation feature to obtain an optimized layout feature.
[0125] Exemplarily, first, the connection relationship matrix is input into the parameter generation network. The parameter generation network includes a three-layer feedforward network structure. The first two layers are configured with ReLU activation functions to extract nonlinear features. The last layer generates depth scaling parameters and burial depth offset parameters based on the real-time connection status between the electrical components of the underground pipeline network. For example, for an underground pipeline network containing 10 electrical components, the connection relationship matrix is a 10x10 matrix. After input into the parameter generation network, it is processed by the three-layer feedforward network and finally outputs 10 depth scaling parameters and 10 burial depth offset parameters. These parameters are dynamically updated as the connection relationship of the underground pipeline network changes.
[0126] Next, the layout features are normalized at the channel level. First, a feature channel attention map is constructed based on the connection relationship matrix, and a CxC matrix is calculated, where C is the number of feature channels. Then, the spatial correlation between feature channels is calculated based on the feature channel attention map to obtain a vector of length C. This vector is used as a weight to calculate the weighted mean and variance for each feature channel to obtain standardized features that vary with the connection relationship of the underground pipeline network. For example, for 64 feature channels, 64 standardized features are finally obtained.
[0127] Then, a feature modulation feedback mechanism is constructed. First, the deviation between the actual connection distance and the preset connection distance between the electrical components of the underground pipeline network in the current layout scheme is calculated. The depth scaling parameter and the burial depth offset parameter are adjusted in real time based on the deviation value. The adjusted depth scaling parameter is normalized by the sigmoid function to obtain the normalized scaling parameter. The normalized scaling parameter is multiplied by the standardized feature to obtain the proportional modulation feature. The burial depth offset parameter is weighted with the position constraint information of the electrical components of the underground pipeline network to obtain the position offset feature. Finally, the proportional modulation feature and the position offset feature are fused to obtain the preliminary modulation feature.
[0128] Finally, a feature channel adaptive selection module is designed. This module includes a gating network, which calculates the channel importance score based on the correlation between each feature channel and the connection relationship between the electrical components of the underground pipeline network, and generates modulation weights based on the scores. The modulation weights are weighted and fused with the preliminary modulation features to obtain the final optimized layout features. For example, for 64 feature channels, 64 optimized layout features are finally obtained.
[0129] Through the above steps, the adaptive modulation of the layout features by the feature adaptive normalization layer is realized, and the optimized layout features are obtained. In the whole process, each step is closely connected, and the output of the previous step is used as the input of the next step, forming a complete closed-loop logic.
[0130] The present invention dynamically generates depth scaling parameters and burial depth offset parameters through a parameter generation network, so that the feature modulation process can be adapted in real time according to changes in the connection relationship of the underground pipeline network, thereby improving the flexibility and adaptability of layout optimization; secondly, channel-level standardization and feature modulation feedback mechanism are adopted to fully utilize the connection relationship information between electrical components of the underground pipeline network, so that the modulation of layout features is more accurate and effective, which is conducive to generating a more reasonable layout plan; finally, a feature channel adaptive selection module is introduced to achieve differentiated processing of different feature channels by calculating the importance of the channels, further improving the pertinence and effectiveness of feature modulation, and helping to obtain better quality layout features.
[0131] In an optional embodiment,
[0132] The initial underground pipe network electrical drawing is subjected to multi-discriminator collaborative verification, including: using a global discriminator with a spatial pyramid pooling module to evaluate the layout rationality score, using a local discriminator based on contrastive learning to evaluate the detail accuracy score, and using a specification discriminator based on a rule-based attention mechanism to evaluate the specification compliance score; weighted fusion of the layout rationality score, detail accuracy score and specification compliance score to obtain a final evaluation score; when the final evaluation score is greater than or equal to a preset threshold, the step of outputting the final underground pipe network electrical drawing includes:
[0133] The initial underground pipe network electrical drawing is converted into a three-dimensional layout feature map through a feature extraction network, and the rationality of the underground space layout is evaluated by a global discriminator with a spatial pyramid pooling module. The global discriminator obtains a multi-scale feature representation containing depth information from the three-dimensional layout feature map through adaptive pooling layers of different scales, and the multi-scale feature representation is spliced to form a three-dimensional multi-scale fusion feature after feature mapping, and a layout rationality score is output based on the three-dimensional multi-scale fusion feature;
[0134] Determine the area to be evaluated according to the layout rationality score, input the features of the area to be evaluated corresponding to the three-dimensional layout feature map into a local discriminator, the local discriminator uses a contrastive learning method to construct positive and negative sample pairs based on the underground pipe network electrical standard layout, and trains a feature extractor by maximizing the mutual information of positive sample pairs and minimizing the mutual information of negative sample pairs. The feature extractor calculates the matching degree between the area to be evaluated and the underground pipe network electrical standard layout in the local area to obtain a detail accuracy score;
[0135] A rule vector generation network is constructed, which converts the preset underground pipe network electrical laying specifications into rule vectors, and the rule vectors are input into a specification discriminator. The specification discriminator calculates the feature matching attention weights of the three-dimensional layout feature map and the rule vector based on the rule attention mechanism, and weights the three-dimensional layout feature map according to the feature matching attention weights to obtain specification-related features, and performs feature fusion of the detail accuracy score and the specification-related features to obtain a specification compliance score.
[0136] For example, first, the initial underground pipe network electrical drawing is input into the feature extraction network to obtain a three-dimensional layout feature map. The feature extraction network adopts a 3D convolutional neural network structure, which includes multiple convolutional layers, pooling layers and fully connected layers, which can effectively extract the spatial layout features of the drawing.
[0137] Then, a global discriminator with a spatial pyramid pooling module is used to evaluate the layout rationality. The global discriminator contains a spatial pyramid pooling module, which contains three 3D adaptive average pooling layers of different scales: 3x3x3, 5x5x5, and 7x7x7. The three-dimensional layout feature map is passed through these three pooling layers to obtain feature maps of three scales, and then passed through a 1x1x1 convolution layer for feature mapping. Finally, the three scale features are spliced to obtain a three-dimensional multi-scale fusion feature. The global discriminator outputs a layout rationality score between 0 and 1 based on the fusion feature.
[0138] Next, the area to be evaluated is determined based on the layout rationality score. For example, when the score of a certain area is lower than 0.6, it is marked as an area to be evaluated. The features of the area to be evaluated in the three-dimensional layout feature map are input into the local discriminator. The local discriminator is trained using contrastive learning to construct positive and negative sample pairs. The positive sample pair is a local layout that meets the standard, and the negative sample pair is a local layout that does not meet the standard. The feature extractor is trained by maximizing the mutual information of the positive sample pair and minimizing the mutual information of the negative sample pair. The feature extractor calculates the matching degree of the area to be evaluated with the standard layout and outputs a detail accuracy score between 0 and 1.
[0139] Then, a rule vector generation network is constructed to convert the preset underground pipe network electrical laying specifications into rule vectors. The rule vector generation network adopts a transformer structure to convert the textual specifications into vector representations. The specification discriminator calculates the matching degree between the three-dimensional layout feature map and the rule vector based on the rule attention mechanism to obtain the attention weight. The three-dimensional layout feature map is multiplied by the attention weight to obtain the specification-related features. The detail accuracy score is fused with the specification-related features, and the specification compliance score between 0 and 1 is obtained through the fully connected layer.
[0140] Finally, the layout rationality score, detail accuracy score and specification compliance score are weighted and integrated to obtain the final evaluation score. The weighting coefficient can be adjusted according to actual needs, for example, 0.3, 0.3, and 0.4 respectively. When the final evaluation score is greater than or equal to the preset threshold (such as 0.8), the final underground pipe network electrical drawing is output.
[0141] In the specific implementation, the following data cases can be used:
[0142] The initial drawing size is 1000x1000x100 pixels, and the feature extraction network obtains a 256x256x32x64 three-dimensional layout feature map. The output sizes of the three pooling layers of the global discriminator are 32x32x8x64, 16x16x4x64, and 8x8x2x64, respectively. After 1x1x1 convolution and splicing, a 56x56x14x192 fusion feature is obtained. The local discriminator input feature map size is 64x64x8x64. The rule vector dimension is 512. The final layout rationality score is 0.85, the detail accuracy score is 0.78, and the specification compliance score is 0.82. The final evaluation score after weighted fusion is 0.815, which is greater than the preset threshold of 0.8, so the final drawing is output.
[0143] The present invention adopts a multi-discriminator collaborative verification method to comprehensively evaluate the quality of underground pipeline electrical drawings, thereby improving the accuracy and reliability of verification; through advanced technologies such as spatial pyramid pooling module and contrastive learning, the multi-scale features and local detail features of the drawings are effectively extracted, thereby enhancing the robustness of verification; the rule attention mechanism is introduced to integrate normative knowledge into the verification process, thereby ensuring the consistency of the drawings with standard specifications and improving the standardization of the verification results.
[0144] In an optional embodiment,
[0145] The method further comprises:
[0146] The confidence level of the layout rationality score of the underground pipe network electrical layout is obtained by calculating the consistency of the three-dimensional multi-scale fusion features. The confidence level of the detail accuracy score of the pipeline laying is calculated based on the loss function value of contrastive learning. The confidence level of the specification compliance score of the underground pipe network electrical construction is determined according to the distribution entropy value of the feature matching attention weight.
[0147] The confidence of the layout rationality score, the confidence of the detail accuracy score and the confidence of the specification compliance score are normalized to obtain their respective corresponding weight coefficients, and the weight coefficients are smoothed by exponential sliding average to obtain their respective corresponding fusion weights;
[0148] The final evaluation score is obtained by weighted summing the layout rationality score, detail accuracy score and specification compliance score with their respective corresponding fusion weights;
[0149] A preset threshold is determined based on the historical average of the layout rationality score, detail accuracy score and specification compliance score. When the final evaluation score is greater than or equal to the preset threshold, the final underground pipeline network electrical drawing is output. When the final evaluation score is less than the preset threshold, the layout rationality score, detail accuracy score and specification compliance score are used as conditional parameters, and the detail optimization network is re-input, and the underground pipeline network electrical drawing is generated in combination with the three-dimensional position distribution heat map and the connection relationship matrix.
[0150] Exemplarily, first, the confidence of the layout rationality score of the underground pipe network electrical layout is obtained by calculating the consistency of the three-dimensional multi-scale fusion features. Specifically, the three-dimensional multi-scale fusion features are analyzed for consistency, and the correlation coefficients between features of different scales are calculated. The higher the correlation coefficient, the higher the degree of consistency. Taking 0.8 as the threshold, when the correlation coefficient is greater than 0.8, it is considered to have a high consistency. The proportion of highly consistent features is counted as the confidence of the layout rationality score. For example, if 80% of the features have high consistency, the confidence of the layout rationality score is 0.8.
[0151] Secondly, the confidence of the detail accuracy score of pipeline laying is calculated based on the loss function value of contrastive learning. Using the contrastive learning method, the generated pipeline laying details are compared with the standard samples, and the loss function value between the two is calculated. The smaller the loss function value, the higher the detail accuracy. The loss function value is normalized to the range of 0-1, and the confidence of the detail accuracy score is obtained by subtracting the normalized loss function value from 1. For example, if the normalized loss function value is 0.3, the confidence of the detail accuracy score is 0.7.
[0152] Then, the confidence of the code compliance score of underground pipe network electrical construction is determined based on the distribution entropy value of the feature matching attention weight. The distribution entropy value of the feature matching attention weight is calculated. The lower the entropy value, the more concentrated the weight distribution and the higher the code compliance. The entropy value is normalized to the range of 0-1, and the confidence of the code compliance score is obtained by subtracting the normalized entropy value from 1. For example, if the normalized entropy value is 0.4, the confidence of the code compliance score is 0.6.
[0153] Next, the confidence of the layout rationality score, the confidence of the detail accuracy score, and the confidence of the specification compliance score are normalized to obtain their corresponding weight coefficients. The min-max normalization method is used to map the three confidence values to the range of 0-1. The weight coefficients are then smoothed using an exponential sliding average to obtain their corresponding fusion weights. The smoothing coefficient of the exponential sliding average is set to 0.9. For example, if the three normalized weight coefficients are 0.7, 0.6, and 0.5, respectively, the fusion weights obtained after the exponential sliding average are 0.73, 0.66, and 0.55, respectively.
[0154] Then, the layout rationality score, detail accuracy score, and specification compliance score are weightedly summed with their respective corresponding fusion weights to obtain the final evaluation score.
[0155] Finally, the preset threshold is determined based on the historical average of the layout rationality score, detail accuracy score, and specification compliance score. The average of these three scores in the past 100 evaluations is calculated, and the minimum value is taken as the preset threshold. When the final evaluation score is greater than or equal to the preset threshold, the final underground pipe network electrical drawing is output. When the final evaluation score is less than the preset threshold, the layout rationality score, detail accuracy score, and specification compliance score are used as conditional parameters, and the detail optimization network is re-entered. The underground pipe network electrical drawing is generated by combining the three-dimensional position distribution heat map and the connection relationship matrix. The regenerated drawings are evaluated again until the preset threshold requirements are met.
[0156] The present invention calculates the consistency degree of three-dimensional multi-scale fusion features, the loss function value of contrastive learning, and the distribution entropy value of feature matching attention weights, and comprehensively evaluates the underground pipeline network electrical drawings from three dimensions: layout rationality, detail accuracy, and specification compliance, thereby ensuring the comprehensiveness and reliability of the evaluation results; secondly, the weight coefficients are smoothed by an exponential sliding average method, which effectively reduces random fluctuations in the evaluation process and improves the stability and credibility of the evaluation results; the preset threshold is dynamically adjusted according to historical evaluation data, and the underground pipeline network electrical drawings are continuously improved by an iterative optimization method, thereby ensuring that the quality of the final output drawings reaches a high level.
[0157] Figure 2 FIG. 1 is a schematic diagram of the structure of an AI-based underground pipe network electrical drawing generation system according to an embodiment of the present invention. Figure 2 As shown, the system comprises:
[0158] The first unit is used to extract features from the input design requirement text using a multi-layer encoder with an underground pipe network electrical professional dictionary to obtain a text feature vector; process the input underground pipe network reference electrical drawings using a visual feature extraction network with an edge detection branch to obtain an image feature vector; obtain an engineering feature vector through graph structure conversion and feature aggregation for the input engineering file containing geological survey data; dynamically assign weights to the text feature vector, image feature vector and engineering feature vector through an attention mechanism to generate a fused feature vector;
[0159] The second unit is used to generate a three-dimensional position distribution heat map of underground pipe network electrical components through a layout generation network based on the fused feature vector, wherein the layout generation network adopts an improved U-Net structure with a spatial self-attention module; convert the three-dimensional position distribution heat map into a graph structure, learn the spatial connection relationship between the nodes of the graph structure through the multi-head attention mechanism of the connection relationship generation network, and generate a connection relationship matrix; input the three-dimensional position distribution heat map and the connection relationship matrix into a detail optimization network, and generate an initial underground pipe network electrical drawing through a feature adaptive normalization layer and a residual connection mechanism;
[0160] The third unit is used to perform multi-discriminator collaborative verification on the initial underground pipe network electrical drawing, including: using a global discriminator with a spatial pyramid pooling module to evaluate the layout rationality score, using a local discriminator based on contrastive learning to evaluate the detail accuracy score, and using a specification discriminator based on a rule-based attention mechanism to evaluate the specification compliance score; weighted fusion of the layout rationality score, detail accuracy score and specification compliance score to obtain a final evaluation score; and outputting the final underground pipe network electrical drawing when the final evaluation score is greater than or equal to a preset threshold.
[0161] According to a third aspect of the embodiments of the present invention,
[0162] An electronic device is provided, comprising:
[0163] processor;
[0164] a memory for storing processor-executable instructions;
[0165] The processor is configured to call the instructions stored in the memory to execute the aforementioned method.
[0166] A fourth aspect of the embodiments of the present invention is:
[0167] A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.
[0168] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.
[0169] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. The AI-based underground pipe network electrical drawing generation method is characterized by: include: The input design requirement text is subjected to feature extraction using a multi-layer encoder with an underground pipe network electrical professional dictionary to obtain a text feature vector; the input underground pipe network reference electrical drawings are processed using a visual feature extraction network with an edge detection branch to obtain an image feature vector; the input engineering file containing geological survey data is subjected to graph structure conversion and feature aggregation to obtain an engineering feature vector; the text feature vector, image feature vector and engineering feature vector are dynamically weighted by an attention mechanism to generate a fused feature vector; Based on the fused feature vector, a three-dimensional position distribution heat map of underground pipe network electrical components is generated through a layout generation network, and the layout generation network adopts an improved U-Net structure with a spatial self-attention module; the three-dimensional position distribution heat map is converted into a graph structure, and the spatial connection relationship between the nodes of the graph structure is learned through the multi-head attention mechanism of the connection relationship generation network to generate a connection relationship matrix; the three-dimensional position distribution heat map and the connection relationship matrix are input into the detail optimization network, and an initial underground pipe network electrical drawing is generated through a feature adaptive normalization layer and a residual connection mechanism; Performing multi-discriminator collaborative verification on the initial underground pipe network electrical drawings, including: using a global discriminator with a spatial pyramid pooling module to evaluate the layout rationality score, using a local discriminator based on contrastive learning to evaluate the detail accuracy score, and using a specification discriminator based on a rule-based attention mechanism to evaluate the specification compliance score; The layout rationality score, detail accuracy score and specification compliance score are weightedly integrated to obtain a final evaluation score; when the final evaluation score is greater than or equal to a preset threshold, the final underground pipe network electrical drawing is output.
2. The method according to claim 1, characterized in that: The input design requirement text is subjected to feature extraction using a multi-layer encoder with an underground pipe network electrical professional dictionary to obtain a text feature vector; the input underground pipe network reference electrical drawing is subjected to processing using a visual feature extraction network with an edge detection branch to obtain an image feature vector; the input engineering file containing geological survey data is subjected to graph structure conversion and feature aggregation to obtain an engineering feature vector, including the following steps: An electrical professional dictionary containing electrical components, connection relationships and underground laying process parameters of underground pipe networks is constructed, and the input design requirement text is segmented to obtain a word sequence; in the word embedding layer, multiple related entries are found from the electrical professional dictionary for each word in the word sequence, and the vectors of these related entries are weighted and summed to obtain word embedding; based on the word embedding, a distance perception mechanism is introduced in the self-attention layer, and the attention score is distance-weighted, and the context representation of the text is obtained through encoder processing, and the text feature vector is obtained through feature aggregation; Perform edge detection on the input underground pipe network reference electrical drawing to obtain an edge map, perform three-dimensional image block division and linear projection on the underground pipe network reference electrical drawing and the edge map respectively; adopt a two-stream attention mechanism to interactively enhance the image block features of the underground pipe network reference electrical drawing and the image block features of the edge map, combine the interactively enhanced image block features with the original image block features through a learnable fusion coefficient, and obtain an image feature vector through feature aggregation; The engineering file is converted into a graph structure, with underground pipe network electrical components as nodes and connection relationships as edges, and the node features are extracted to obtain initial node features; the initial node features are updated through an edge-based message passing mechanism; and the updated initial node features are aggregated using a graph-level feature extraction function to obtain an engineering feature vector.
3. The method according to claim 1, characterized in that The steps of dynamically assigning weights to the text feature vector, the image feature vector, and the engineering feature vector through an attention mechanism to generate a fused feature vector include: Map the text feature vector, image feature vector and engineering feature vector to a semantic space of uniform dimension through a learnable linear mapping matrix and a bias term to obtain semantically aligned text features, image features and engineering features; Performing cross-modal attention calculation on text features, image features and engineering features, including: converting text features into a semantic interaction query matrix through a learnable feature transformation matrix, converting image features and engineering features into cross-modal feature key matrices respectively, performing dot product operations on the semantic interaction query matrix and the cross-modal feature key matrix respectively and performing normalization processing to obtain a text-image attention matrix and a text-engineering attention matrix; Perform dot product operations on text features, image features, and engineering features, respectively, and normalize them to obtain the text feature internal attention matrix, the image feature internal attention matrix, and the engineering feature internal attention matrix; The text feature internal attention matrix is combined with the text-image attention matrix and the text-engineering attention matrix to form a text feature fusion matrix, the image feature internal attention matrix is combined with the text-image attention matrix to form an image feature fusion matrix, and the engineering feature internal attention matrix is combined with the text-engineering attention matrix to form an engineering feature fusion matrix; Performing nonlinear transformation on the text feature fusion matrix, the image feature fusion matrix and the engineering feature fusion matrix to dynamically generate text feature weights, image feature weights and engineering feature weights that reflect the importance of features; The text feature weights and text features, the image feature weights and image features, and the engineering feature weights and engineering features are weighted and fused respectively and summed up, and the fused feature vector is obtained after normalization.
4. The method according to claim 1, characterized in that Based on the fused feature vector, a three-dimensional position distribution heat map of underground pipe network electrical components is generated through a layout generation network, wherein the layout generation network adopts an improved U-Net structure with a spatial self-attention module; the three-dimensional position distribution heat map is converted into a graph structure, and the spatial connection relationship between the nodes of the graph structure is learned through the multi-head attention mechanism of the connection relationship generation network to generate a connection relationship matrix; The steps of inputting the three-dimensional position distribution heat map and the connection relationship matrix into the detail optimization network and generating an initial underground pipe network electrical drawing through a feature adaptive normalization layer and a residual connection mechanism include: The layout generation network adopts an improved U-Net structure, and a self-attention module is set in each layer of the encoder and decoder of the improved U-Net structure. The self-attention module models the long-range spatial dependency relationship of the underground space by calculating the attention weights between each position in the input feature map, including: obtaining an initial feature map by upsampling and convolution operations on the fused feature vector, generating a spatial position query matrix, an underground environment local feature key matrix and a feature transformation value matrix for the initial feature map through a convolution layer, calculating the dot product of the spatial position query matrix and the underground environment local feature key matrix and normalizing them to obtain a spatial attention weight, multiplying the spatial attention weight with the feature transformation value matrix to obtain an attention output, performing a residual connection between the attention output and the initial feature map to obtain an enhanced feature map, and obtaining a three-dimensional position distribution heat map containing deep buried information of the underground pipe network through an activation function on the enhanced feature map; Extracting local maximum points in the three-dimensional position distribution heat map as candidate element positions of the underground pipe network and constructing an initial graph structure, calculating the relationship features between nodes in the initial graph structure through a multi-head attention mechanism of a connection relationship generation network, wherein the multi-head attention mechanism includes multiple parallel attention heads, and connecting the relationship features calculated by the multiple attention heads and mapping them through a feedforward network to obtain a connection relationship matrix of the underground pipe network; The three-dimensional position distribution heat map and the connection relationship matrix are input into a detail optimization network, the detail optimization network includes multiple residual blocks, and a feature adaptive normalization layer is set in each residual block; the detail optimization network extracts layout features from the three-dimensional position distribution heat map through a convolution layer, and the feature adaptive normalization layer adaptively modulates the layout features according to the connection relationship matrix to obtain optimized layout features, and the underground pipeline layout constraint information of the three-dimensional position distribution heat map is fused with the optimized layout features through a residual connection mechanism to generate an initial underground pipeline electrical drawing that meets the underground pipeline layout constraints and connection relationship constraints.
5. The method according to claim 4, characterized in that The step of adaptively modulating the layout features according to the connection relationship matrix by the feature adaptive normalization layer to obtain optimized layout features includes: The connection relationship matrix is input into a parameter generation network, wherein the parameter generation network comprises a three-layer feedforward network structure, wherein the first two layers of the feedforward network are configured with a ReLU activation function for extracting nonlinear features, and the last layer of the feedforward network generates a depth scaling parameter and a burial depth offset parameter based on the real-time connection status between electrical components of the underground pipe network, wherein the depth scaling parameter and the burial depth offset parameter are dynamically updated as the connection relationship of the underground pipe network changes; The layout features are subjected to channel-level standardization processing, including: constructing a feature channel attention map based on the connection relationship matrix, calculating the spatial correlation degree between feature channels according to the feature channel attention map, calculating the weighted mean and variance for each feature channel using the spatial correlation degree as a weight, and obtaining standardized features that change with the connection relationship of the underground pipe network; Constructing a feature modulation feedback mechanism, the feature modulation feedback mechanism comprising: calculating the deviation value between the actual connection distance and the preset connection distance between the electrical components of the underground pipe network in the current layout scheme, adjusting the depth scaling parameter and the burial depth offset parameter in real time based on the deviation value, normalizing the adjusted depth scaling parameter by a sigmoid function to obtain a normalized scaling parameter, multiplying the normalized scaling parameter by the standardized feature to obtain a proportional modulation feature, weighting the burial depth offset parameter and the position constraint information of the electrical components of the underground pipe network to obtain a position offset feature, and fusing the proportional modulation feature with the position offset feature to obtain a preliminary modulation feature; A feature channel adaptive selection module is designed, which includes a gating network. The gating network calculates the channel importance score according to the correlation between each feature channel and the connection relationship between the electrical components of the underground pipeline network, and generates a modulation weight based on the channel importance score; the modulation weight is weightedly fused with the preliminary modulation feature to obtain an optimized layout feature.
6. The method according to claim 1, characterized in that The initial underground pipe network electrical drawing is subjected to multi-discriminator collaborative verification, including: using a global discriminator with a spatial pyramid pooling module to evaluate the layout rationality score, using a local discriminator based on contrastive learning to evaluate the detail accuracy score, and using a specification discriminator based on a rule-based attention mechanism to evaluate the specification compliance score; weighted fusion of the layout rationality score, detail accuracy score and specification compliance score to obtain a final evaluation score; when the final evaluation score is greater than or equal to a preset threshold, the step of outputting the final underground pipe network electrical drawing includes: The initial underground pipe network electrical drawing is converted into a three-dimensional layout feature map through a feature extraction network, and the rationality of the underground space layout is evaluated by a global discriminator with a spatial pyramid pooling module. The global discriminator obtains a multi-scale feature representation containing depth information from the three-dimensional layout feature map through adaptive pooling layers of different scales, and the multi-scale feature representation is spliced to form a three-dimensional multi-scale fusion feature after feature mapping, and a layout rationality score is output based on the three-dimensional multi-scale fusion feature; Determine the area to be evaluated according to the layout rationality score, input the features of the area to be evaluated corresponding to the three-dimensional layout feature map into a local discriminator, the local discriminator uses a contrastive learning method to construct positive and negative sample pairs based on the underground pipe network electrical standard layout, and trains a feature extractor by maximizing the mutual information of positive sample pairs and minimizing the mutual information of negative sample pairs. The feature extractor calculates the matching degree between the area to be evaluated and the underground pipe network electrical standard layout in the local area to obtain a detail accuracy score; A rule vector generation network is constructed, which converts the preset underground pipe network electrical laying specifications into rule vectors, and the rule vectors are input into a specification discriminator. The specification discriminator calculates the feature matching attention weights of the three-dimensional layout feature map and the rule vector based on the rule attention mechanism, and weights the three-dimensional layout feature map according to the feature matching attention weights to obtain specification-related features, and performs feature fusion of the detail accuracy score and the specification-related features to obtain a specification compliance score.
7. The method according to claim 6, characterized in that The method further comprises: The confidence level of the layout rationality score of the underground pipe network electrical layout is obtained by calculating the consistency of the three-dimensional multi-scale fusion features. The confidence level of the detail accuracy score of the pipeline laying is calculated based on the loss function value of contrastive learning. The confidence level of the specification compliance score of the underground pipe network electrical construction is determined according to the distribution entropy value of the feature matching attention weight. The confidence of the layout rationality score, the confidence of the detail accuracy score and the confidence of the specification compliance score are normalized to obtain their respective corresponding weight coefficients, and the weight coefficients are smoothed by exponential sliding average to obtain their respective corresponding fusion weights; The final evaluation score is obtained by weighted summing the layout rationality score, detail accuracy score and specification compliance score with their respective corresponding fusion weights; A preset threshold is determined based on the historical average of the layout rationality score, detail accuracy score and specification compliance score. When the final evaluation score is greater than or equal to the preset threshold, the final underground pipeline network electrical drawing is output. When the final evaluation score is less than the preset threshold, the layout rationality score, detail accuracy score and specification compliance score are used as conditional parameters, and the detail optimization network is re-input, and the underground pipeline network electrical drawing is generated in combination with the three-dimensional position distribution heat map and the connection relationship matrix.
8. An AI-based underground pipe network electrical drawing generation system, used to implement the method described in any one of claims 1 to 7, characterized in that: include: The first unit is used to extract features from the input design requirement text using a multi-layer encoder with an underground pipe network electrical professional dictionary to obtain a text feature vector; process the input underground pipe network reference electrical drawings using a visual feature extraction network with an edge detection branch to obtain an image feature vector; obtain an engineering feature vector through graph structure conversion and feature aggregation for the input engineering file containing geological survey data; dynamically assign weights to the text feature vector, image feature vector and engineering feature vector through an attention mechanism to generate a fused feature vector; The second unit is used to generate a three-dimensional position distribution heat map of underground pipe network electrical components through a layout generation network based on the fused feature vector, wherein the layout generation network adopts an improved U-Net structure with a spatial self-attention module; convert the three-dimensional position distribution heat map into a graph structure, learn the spatial connection relationship between the nodes of the graph structure through the multi-head attention mechanism of the connection relationship generation network, and generate a connection relationship matrix; input the three-dimensional position distribution heat map and the connection relationship matrix into a detail optimization network, and generate an initial underground pipe network electrical drawing through a feature adaptive normalization layer and a residual connection mechanism; The third unit is used to perform multi-discriminator collaborative verification on the initial underground pipe network electrical drawing, including: using a global discriminator with a spatial pyramid pooling module to evaluate the layout rationality score, using a local discriminator based on contrastive learning to evaluate the detail accuracy score, and using a specification discriminator based on a rule-based attention mechanism to evaluate the specification compliance score; The layout rationality score, detail accuracy score and specification compliance score are weightedly integrated to obtain a final evaluation score; when the final evaluation score is greater than or equal to a preset threshold, the final underground pipe network electrical drawing is output.
9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method described in any one of claims 1 to 7.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
BIM (Building Information Modeling)-based electrical drawing generation method and equipment and medium
CN116257920A
Character vectorization method for engineering drawing
CN116884013A