Fire-fighting pipe diameter reasoning model training method and fire-fighting pipe diameter labeling method and device
Patent Information
- Application Number
- CN202610758016.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2046-05-29
AI Technical Summary
而面对如此庞大的数据量,人工标注的方式存在工作量大效率低、人为错误率高、标注一致性差以及更新维护困难等问题
[0021] The aforementioned training method, pipe diameter labeling method, device, computer equipment, computer-readable storage medium, and computer program product for the fire pipe diameter inference model extract geometric attribute information of target sample components from fire system sample drawings. Based on this geometric attribute information, the spatial proximity relationships between target sample components are calculated, generating structured sample data containing both geometric attribute information and spatial proximity relationships. This structured sample data is then converted into templated natural language description text, which is further segmented and encoded to generate more sample data. A preset masking strategy is used to replace pipe diameter labels in the sample data with mask markers, and these pipe diameter labels are used as training labels corresponding to the mask markers to generate training samples. The training samples are then used to fine-tune the pre-trained mask prediction model, resulting in the fire pipe diameter inference model. This model transforms the geometric topological relationships in CAD drawings into natural language sequences and utilizes the semantic understanding capabilities of the pre-trained language model to model pipe diameter prediction as a mask classification task, achieving an automated and high-precision fire pipe diameter inference model. By combining a layered masking strategy, the model's generalization ability in scenarios with missing data is improved, and efficient sample construction and training with tens of thousands of components are achieved, which has extremely high engineering application value.
Smart Images

Figure CN122311475B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a training method for a fire pipe diameter inference model, a fire pipe diameter annotation method, an apparatus, a computer device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] As a core component of a building's safety and defense system, the rationality of its design and the accuracy of its construction directly affect emergency response capabilities and the safety of life and property during a fire. Accurate marking of pipe diameters is a crucial aspect of the design and construction of fire protection systems. Pipe diameters not only determine the flow rate, velocity, and pressure loss of water, but also directly affect the coverage area of sprinkler heads, fire extinguishing efficiency, and the overall hydraulic balance of the system. Therefore, ensuring the accurate marking of the diameter of every pipe component is a prerequisite for guaranteeing the safety and reliability of the fire protection system.
[0003] However, with the increasing scale and functional complexity of modern buildings, the number of piping components included in fire protection systems is growing exponentially. Fire protection systems in large commercial complexes, high-rise buildings, or industrial parks often contain thousands or even tens of thousands of piping components. If the diameter markings for some piping components are missing in the corresponding fire protection design drawings, manual marking of the pipe diameters is necessary. However, with such a massive amount of data, manual marking suffers from problems such as high workload, low efficiency, high human error rate, poor consistency of markings, and difficulty in updating and maintaining the system. Summary of the Invention
[0004] Therefore, it is necessary to provide a training method for a fire pipe diameter inference model, a fire pipe diameter labeling method, an apparatus, a computer device, a computer-readable storage medium, and a computer program product to address the above-mentioned technical problems.
[0005] Firstly, this application provides a training method for a fire pipe diameter inference model, the method comprising: Extract the geometric attribute information of the target sample components from the fire protection system sample drawings, calculate the spatial proximity relationship between the target sample components based on the geometric attribute information, and generate structured sample data containing geometric attribute information and spatial proximity relationship; The structured sample data is converted into templated natural language description text, and the natural language description text is segmented and encoded to generate sample data; the sample data includes the component identifier, geometric attribute information, spatial proximity relationship encoding, and corresponding pipe diameter label of the target sample component; A preset masking strategy is used to replace the pipe diameter labels in the sample data with mask markers, and the pipe diameter labels in the sample data are used as training labels corresponding to the mask markers to generate training samples. The pre-trained mask prediction model is fine-tuned using the training samples to obtain the fire pipe diameter inference model.
[0006] In one embodiment, calculating the spatial proximity relationship between target sample components based on the geometric attribute information includes: Based on the geometric attribute information, the K-nearest neighbor algorithm is used to calculate the spatial distance and topological relationship between each target sample component. The topological relationship is used to characterize the parallel relationship, perpendicular relationship or connection relationship between each target sample component.
[0007] In one embodiment, the step of calculating the spatial distance and topological relationship between each target sample component using the K-nearest neighbor algorithm based on the geometric attribute information includes: For any target sample component, the K-nearest neighbor algorithm is used to determine the corresponding neighbor components based on the geometric attribute information; Determine the angle constraint value and minimum spacing between any target sample component and its neighboring component; the angle constraint value is used to characterize the absolute value of the cosine of the angle between the direction vector of any target sample component and the direction vector of its neighboring component, and the minimum spacing is used to characterize the minimum Euclidean distance between the endpoint of any target sample component and the endpoint of its neighboring component; If the angle constraint value satisfies the first condition, it is determined that any target sample component and its neighboring component are parallel. If the angle constraint value satisfies the second condition, it is determined that any target sample component and its neighboring component are in a perpendicular relationship. If the minimum spacing satisfies the third condition, it is determined that any target sample component and its neighboring component are in a connected relationship.
[0008] In one embodiment, the step of fine-tuning the pre-trained mask prediction model using the training samples to obtain a fire pipe diameter inference model includes: The training samples are input into the pre-trained mask prediction model for prediction, and the predicted values corresponding to the mask labels in the training samples are obtained. Based on minimizing the cross-entropy loss between the predicted value of the mask label and the training label, the parameters of the pre-trained mask prediction model are adjusted to obtain the fire pipe diameter inference model.
[0009] In one embodiment, after generating the training samples, the method further includes: Based on the training samples, a hierarchical data augmentation strategy is used to determine the training set and the test set. The occlusion rate of the sample data in the training set and the test set is 10% to 60%, and the occlusion rate of the training set is greater than that of the test set.
[0010] Secondly, this application also provides a method for marking the diameter of fire-fighting pipes, the method comprising: Obtain the component data to be annotated from the drawings of the fire protection system. The component data to be annotated includes the component identifier, geometric attribute information and spatial proximity code of each component to be annotated. The fire pipe diameter inference model trained using the method described above is used to make predictions based on the set inference mode and the data of the components to be labeled, so as to obtain the pipe diameter prediction results and corresponding confidence levels of each component to be labeled. Based on the confidence level, the predicted pipe diameter is visualized in the drawings of the fire protection system to be annotated.
[0011] In one embodiment, when the set inference mode is batch prediction mode; the fire pipe diameter inference model trained using the method described above predicts based on the set inference mode and the data of the components to be labeled, and obtains the pipe diameter prediction results and corresponding confidence levels for each component to be labeled, including: The component data to be labeled is organized into batch data based on the component identifier of each component to be labeled, and each batch data includes multiple components to be labeled; The fire pipe diameter inference model is used to perform parallel predictions on multiple components to be labeled in the batch data to obtain the pipe diameter prediction probability distribution for each component to be labeled. Based on the pipe diameter prediction probability distribution of each component to be labeled, the pipe diameter prediction value with the highest probability is selected as the pipe diameter prediction result for labeling, and the corresponding confidence level is calculated.
[0012] In one embodiment, when the set inference mode is an iterative prediction mode; the fire pipe diameter inference model trained using the method described above predicts based on the set inference mode and the data of the components to be labeled, obtaining the pipe diameter prediction results and corresponding confidence levels for each component to be labeled, including: Initialize the maximum number of iterations and the confidence level threshold of the fire pipe diameter inference model; The data of the component to be labeled is input into the initialized fire pipe diameter inference model for prediction, the pipe diameter prediction probability distribution of each component to be labeled is obtained, the pipe diameter prediction value with the highest probability is determined, and the corresponding confidence level is calculated. The predicted pipe diameter values with a confidence level greater than or equal to the confidence level threshold are labeled as pipe diameter prediction results, and the data of the component to be labeled is updated. If it is determined that there are unlabeled components in the updated data of components to be labeled, the updated data of components to be labeled is input into the fire pipe diameter inference model for iterative prediction until the maximum number of iterations is reached or there are no unlabeled components in the updated data of components to be labeled, then the iteration ends.
[0013] In one embodiment, the calculation of the corresponding confidence level includes: Based on the predicted probability distribution of the pipe diameter for each component to be labeled, determine the highest probability value and the second highest probability value; Calculate the difference between the highest probability value and the second highest probability value; The corresponding confidence level is determined based on the highest probability value, the difference, and the preset confidence level classification strategy.
[0014] In one embodiment, determining the corresponding confidence level based on the highest probability value, the difference, and a preset confidence level classification strategy includes: If the highest probability value is greater than or equal to the first probability threshold, and the difference is greater than or equal to the first difference threshold, the corresponding confidence level is determined to be high confidence. If the highest probability value is greater than or equal to the second probability threshold, and the difference is greater than or equal to the second difference threshold, the corresponding confidence level is determined to be medium confidence; the second probability threshold is less than the first probability threshold, and the second difference threshold is less than the first difference threshold. If the highest probability value is greater than or equal to the third probability threshold, and the difference is greater than or equal to the third difference threshold, the corresponding confidence level is determined to be low confidence; the third probability threshold is less than the second probability threshold, and the third difference threshold is less than the second difference threshold. If the highest probability value is determined to be less than the third probability threshold, or if the difference is determined to be less than the third difference threshold, the corresponding confidence level is determined to be extremely low confidence.
[0015] In one embodiment, the step of visualizing the pipe diameter prediction result in the fire protection system drawing to be annotated according to the confidence level includes: The predicted pipe diameters of each component to be annotated are overlaid on the drawings of the fire protection system, and different color codes are used for annotation according to the corresponding confidence level; and / or Based on the predicted pipe diameter of each component to be labeled and the corresponding confidence level, a confidence heatmap based on spatial distribution is generated to show the quality distribution and uncertainty area of the prediction results.
[0016] Thirdly, this application also provides a training device for a fire pipe diameter reasoning model, the device comprising: The information extraction module is used to extract the geometric attribute information of the target sample components from the fire protection system sample drawings, calculate the spatial proximity relationship between the target sample components based on the geometric attribute information, and generate structured sample data containing geometric attribute information and spatial proximity relationship. The data conversion module is used to convert the structured sample data into templated natural language description text, and to perform word segmentation and encoding on the natural language description text to generate sample data; the sample data includes the component identifier, geometric attribute information, spatial proximity relationship encoding, and corresponding pipe diameter label of the target sample component; The training sample generation module is used to replace the pipe diameter labels in the sample data with mask markers using a preset masking strategy, and use the pipe diameter labels of the sample data as training labels corresponding to the mask markers to generate training samples. The training module is used to fine-tune the pre-trained mask prediction model using the training samples to obtain the fire pipe diameter inference model.
[0017] Fourthly, this application also provides a fire pipe diameter marking device, the device comprising: The data acquisition module is used to acquire the component data to be labeled in the drawings of the fire protection system. The component data to be labeled includes the component identifier, geometric attribute information and spatial proximity relationship code of each component to be labeled. The annotation prediction module is used to predict the diameter of the fire pipe using the fire pipe diameter inference model trained by the method described above, based on the set inference mode and the data of the component to be annotated, and to obtain the pipe diameter prediction result and the corresponding confidence level of each component to be annotated. The display module is used to visualize the pipe diameter prediction results in the fire protection system drawings to be annotated according to the confidence level.
[0018] Fifthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the first or second aspect above.
[0019] Sixthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first or second aspect above.
[0020] In a seventh aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in the first or second aspect above.
[0021] The aforementioned training method, pipe diameter labeling method, device, computer equipment, computer-readable storage medium, and computer program product for the fire pipe diameter inference model extract geometric attribute information of target sample components from fire system sample drawings. Based on this geometric attribute information, the spatial proximity relationships between target sample components are calculated, generating structured sample data containing both geometric attribute information and spatial proximity relationships. This structured sample data is then converted into templated natural language description text, which is further segmented and encoded to generate more sample data. A preset masking strategy is used to replace pipe diameter labels in the sample data with mask markers, and these pipe diameter labels are used as training labels corresponding to the mask markers to generate training samples. The training samples are then used to fine-tune the pre-trained mask prediction model, resulting in the fire pipe diameter inference model. This model transforms the geometric topological relationships in CAD drawings into natural language sequences and utilizes the semantic understanding capabilities of the pre-trained language model to model pipe diameter prediction as a mask classification task, achieving an automated and high-precision fire pipe diameter inference model. By combining a layered masking strategy, the model's generalization ability in scenarios with missing data is improved, and efficient sample construction and training with tens of thousands of components are achieved, which has extremely high engineering application value. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart illustrating the training method for a fire pipe diameter inference model in one embodiment. Figure 2 This is a flowchart illustrating a method for marking fire pipe diameters in one embodiment; Figure 3 This is a flowchart illustrating the batch prediction mode steps in one embodiment; Figure 4 This is a flowchart illustrating the iterative prediction pattern steps in one embodiment; Figure 5 This is a flowchart illustrating the steps for calculating the confidence level in one embodiment; Figure 6This is a structural block diagram of a training device for a fire pipe diameter inference model in one embodiment; Figure 7 This is a structural block diagram of a fire pipe diameter marking device in one embodiment; Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0025] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0026] Traditional methods of manually marking pipe diameters suffer from problems such as high workload, low efficiency, high human error rate, poor consistency, and difficulty in updating and maintaining. Rule-based methods, on the other hand, rely on pre-defined formulas or lookup tables to calculate and mark pipe diameters based on single parameters such as pipe length, design flow rate, and velocity limits. While effective in small-scale or highly standardized scenarios, they lack an understanding of complex spatial topologies. For example, when pipes undergo diameter changes, branching, merging, or cross different fire compartments, simple rule engines struggle to handle these complex logical constraints, leading to marking results that do not conform to actual hydraulic conditions or regulatory requirements.
[0027] In one exemplary embodiment, a training method for a fire-fighting pipe diameter inference model is provided, aiming to address the problems of inefficiency and error-proneness in traditional fire-fighting design where pipe diameter labeling relies on manual experience. This method utilizes Masked Language Model (MLM) technology from Natural Language Processing (NLP) to transform the geometric topological features of the fire-fighting pipe network into a text sequence. By fine-tuning a pre-trained model, the implicit rules for pipe diameter selection are learned, thereby achieving high-precision pipe diameter inference and providing intelligent technical support for fire-fighting engineering design. Figure 1 As shown, the method may specifically include the following steps: Step 102: Extract the geometric attribute information of the target sample components from the fire protection system sample drawings, calculate the spatial proximity relationship between the target sample components based on the geometric attribute information, and generate structured sample data containing geometric attribute information and spatial proximity relationship.
[0028] The fire protection system sample drawings can be historical CAD drawings or historical BIM model files with the pipe diameter information of the target sample components already marked. Target sample components include, but are not limited to, sprinkler pipes, fire hydrant pipes, valves, sprinkler heads, and other components related to fire protection pipelines shown in the drawings. It should be noted that the method of this application applies to linear components related to fire protection pipelines; non-linear components, such as irregularly shaped components, are not within the scope of protection of this application.
[0029] Geometric attribute information refers to the key attributes of each target sample component in the drawing, including but not limited to component identifiers (unique identifiers, such as sprinkler head 1, sprinkler head 2, etc., used to uniquely identify and locate each component in the drawing), component type (such as sprinkler pipes, fire hydrant pipes, valves, sprinklers, etc.), geometric position coordinates (such as the coordinates of the two endpoints and the center point of the component), direction vectors, length parameters, pipe diameter values, etc. Specifically, the geometric elements in the DXF format file of the fire protection system sample drawing can be parsed to identify the target sample components and extract their geometric attribute information.
[0030] Spatial proximity refers to the spatial distance and topological relationship between various target sample components. Specifically, it can be calculated using the K-nearest neighbor algorithm based on the geometric attribute information of each target sample component. The topological relationship characterizes the parallel, perpendicular, or adjoining relationships between the target sample components. Spatial proximity is crucial for transforming unstructured spatial data, such as geometric attribute information, into logical relationships that the model can understand.
[0031] For example, the calculation of spatial proximity may include: for any target sample component, the corresponding neighboring components can be determined using the K-nearest neighbor algorithm based on geometric attribute information. The K-nearest neighbor algorithm can use K-nearest neighbors and Euclidean distance, and the value of k can be dynamically configured. For example, the default value of k is 15 (i.e., finding 15 nearby neighboring components), and the distance threshold of the neighboring components can be adjusted according to the actual scenario.
[0032] Specifically, a spatial index can be constructed first. For example, the geometric coordinates of all target sample components (such as the coordinates of the two endpoints and the center point of the component) can be loaded into memory to construct a spatial index structure such as a KD-Tree (K-Dimensional Tree), Ball-Tree, SciPy, or scikit-learn. Compared to brute-force traversal, this method can reduce query complexity from... Reduce to This improves subsequent retrieval efficiency. Then, a K-nearest neighbor search is performed. For example, for any target sample component... The K-Nearest Neighbors (KNN) query is then performed using the constructed spatial index. The number of neighbors is set. (For example (to cover potential front, back, left, right, top, and bottom connectors), to obtain the nearest... The set of indices of each neighboring component and its corresponding Euclidean distance.
[0033] For each target sample component, after obtaining the corresponding neighbor components, the angular constraint value and minimum spacing between the target sample component and the corresponding neighbor component can be calculated. If the angular constraint value satisfies the first condition, the target sample component and the corresponding neighbor component are determined to be parallel. If the angular constraint value satisfies the second condition, the target sample component and the corresponding neighbor component are determined to be perpendicular. If the minimum spacing satisfies the third condition, the target sample component and the corresponding neighbor component are determined to be connected.
[0034] The angular constraint value between the target sample component and its corresponding neighboring component is used to characterize the absolute value of the cosine of the angle between the direction vector of the target sample component and the direction vector of its corresponding neighboring component. For example, if the absolute value of the cosine of the angle between the direction vector of the target sample component and the direction vector of its corresponding neighboring component is greater than or equal to the first constraint value... If the angle constraint value satisfies the first condition, it can be determined that the target sample component and its corresponding neighbor component are parallel.
[0035] If the absolute value of the cosine of the angle between the direction vector of the target sample component and the direction vector of its corresponding neighboring component is less than or equal to the second constraint value If the angle constraint value satisfies the second condition, it can be determined that the target sample component and its corresponding neighboring component are perpendicular. and The system defaults to the pre-configured constraint values. 0.98 The value is 0.08, but it can be adjusted based on the accuracy of CAD drawings, pipe line noise, drawing scale, and recognition tolerance requirements.
[0036] For example, if the target sample component The direction vector is A neighboring component The direction vector is If satisfied This indicates the target sample component. With corresponding neighbor components They are parallel relationships. If they satisfy... This indicates the target sample component. With corresponding neighbor components They are in a vertical relationship.
[0037] The minimum distance between the target sample component and its corresponding neighboring component is used to characterize the minimum Euclidean distance between the endpoints of the target sample component and the endpoints of its corresponding neighboring component. In this embodiment, if the minimum distance between the endpoint of the target sample component and the endpoint of a certain neighboring component is less than or equal to the tolerance distance, it indicates that the minimum distance meets the third condition, and it can be determined that the target sample component and its corresponding neighboring component are connected. The tolerance distance is a pre-configured distance threshold, with a system default of 10, and the unit is consistent with the geometric data coordinate unit (e.g., millimeters). It can be adjusted through the configuration file.
[0038] For example, if the target sample component The two endpoints are and A neighboring component The two endpoints are and Then the target sample component With corresponding neighbor components Minimum spacing between It can be determined by the following formula (1): (1) This formula represents the target sample component. With corresponding neighbor components The minimum absolute value of the Euclidean distance between the endpoints. If this minimum distance... If the minimum spacing is less than or equal to the tolerance distance, it means that the minimum spacing meets the third condition, and it can be determined that the target sample component and its corresponding neighbor component are connected.
[0039] This embodiment addresses the spatial relationships of fire protection pipeline components. It determines whether the components are parallel or perpendicular based on the angular constraints between the target sample component and its corresponding neighboring components, and determines whether they are connected based on the minimum distance between them. This accurately determines the spatial proximity relationship between the target sample components, providing support for subsequent natural language description text conversion.
[0040] Structured sample data organizes extracted geometric attribute information and calculated spatial proximity relationships into a standardized JSON data structure. The structured sample data for each target sample component can include fields such as component identifier, component type, geometric location coordinates, pipe diameter, and k-nearest neighbor relationship. It supports data validation and format verification to ensure data consistency and parsability.
[0041] In this embodiment, before model training, the geometric attribute information of the target sample components can first be extracted from the fire protection system CAD drawings. Specifically, by parsing the DXF format fire protection system design file, all target sample component information related to pipelines is extracted, including the unique identifier (id) of each component, geometric coordinates, component type, direction information, length parameters, pipe diameter, number of downstream sprinklers, and other key attributes. Then, the spatial proximity relationship of each target sample component is analyzed using the K-nearest neighbor algorithm, and the upstream and downstream spatial connection relationship of the pipeline is calculated accordingly. Finally, the extracted geometric attribute information of all target sample components and the calculated spatial proximity relationship information are saved into a unified JSON format data structure to generate structured sample data, providing a data foundation for subsequent model training.
[0042] Step 104: Convert the structured sample data into templated natural language description text, and perform word segmentation and encoding on the natural language description text to generate sample data.
[0043] Templating can be a representation based on a preset standard format, such as "component: attribute". Specifically, the structured sample data can be converted into natural language description text such as "nozzle 0: pipe diameter 25", "nozzle 1: pipe diameter 32", "nozzle 2: pipe diameter 25", etc., while retaining the component's identification information, attribute information, and proximity information (such as parallel, perpendicular, connected, upstream, downstream, etc.) to ensure semantic integrity. This achieves cross-modal mapping from geometric space to semantic logic, improving feature expression capabilities.
[0044] Furthermore, the converted natural language description text can be segmented and encoded using a text segmenter, dividing it into token sequences. These tokens are then mapped to pipe diameter indices in the vocabulary. Pipe diameter prediction is defined as a multi-classification task within the vocabulary, generating tensors such as `input_ids` (input identifier tensor), `attention_mask` (attention mask tensor to distinguish valid text from padding characters), and `position_ids` (position identifier tensor to preserve sequence order information). Maximum length truncation (default 512) and dynamic padding strategies are supported. This yields complete sample data, each including the component identifier, geometric attribute information, spatial proximity encoding, and corresponding pipe diameter label for the target component, thus providing sufficient contextual semantic information for the mask prediction task.
[0045] Step 106: Use a preset masking strategy to replace the pipe diameter labels in the sample data with mask markers, and use the pipe diameter labels in the sample data as the training labels corresponding to the mask markers to generate training samples.
[0046] The preset masking strategy is a strategy for masking pipe diameter labels in the sample data. This preset masking strategy can be a pre-set fixed masking strategy or a random masking strategy. For example, a fixed masking strategy can mask pipe diameter labels in all sample data, while a random masking strategy can mask pipe diameter labels in the sample data based on a certain proportion (such as 15%, 25%, 50%, 80%, etc.). In one scenario, multiple strategy combinations and probability adjustment can be supported.
[0047] In this embodiment, a preset masking strategy can be used to generate training samples for model training. For example, the pipe diameter labels in the sample data can be replaced with mask markers based on the preset masking strategy, and the pipe diameter labels in the sample data can be used as the training labels corresponding to the mask markers to generate training samples.
[0048] In an exemplary embodiment, to improve the model's robustness to sparse data and its generalization ability, a hierarchical data augmentation strategy can be employed to enhance the diversity of training samples. This hierarchical data augmentation strategy involves dividing the training samples into training and testing sets, and configuring different nozzle occlusion probabilities and pipe diameter occlusion probabilities on the training and testing sets respectively. This simulates various data loss scenarios in real-world applications, enhancing the diversity of training data and improving the model's robustness to sparse data. Specifically, the occlusion rate (e.g., nozzle occlusion probability and / or pipe diameter occlusion probability) of the sample data in the training and testing sets is between 10% and 60%, with the occlusion rate of the training set being greater than that of the testing set.
[0049] For example, a nozzle identification information in the input text can be randomly masked during training using a nozzle masking strategy (the masking probability can be dynamically adjusted according to the dataset type, such as 15%-25% masking for the training set and 10%-20% masking for the test or validation set). This replaces the nozzle identification with a mask, simulating the situation of missing nozzle data in real-world scenarios, thus forcing the model to learn deeper contextual dependencies rather than simply memorizing fixed patterns. Then, a pipe diameter masking strategy can be used to randomly mask pipe diameter labels in the text, training the model's reasoning ability when key label information is missing. Next, a hierarchical augmentation configuration is adopted, which allows setting different augmentation probabilities for the training set and the validation / test set. The training set uses a higher augmentation probability to improve the model's generalization ability, while the validation / test set is closer to the real application scenario. The augmentation intensity can be dynamically adjusted according to the actual missing rate of the real application scenario (e.g., 10% to 60%) to adapt to data environments with different sparsity levels. This includes various adjustment strategies such as linear decay and exponential decay, thereby ensuring that the model can adapt to scenarios with various data sparsity levels. This improves the model's robustness and generalization ability when facing noisy data, incomplete drawings, or complex edge cases, and prevents overfitting.
[0050] Step 108: Fine-tune the pre-trained mask prediction model using training samples to obtain the fire pipe diameter inference model.
[0051] The pre-trained mask prediction model can be a BERT (Bidirectional Encoder Representations from Transformers) model trained using the MLM (Masked Language Model, a deep learning technique widely used in natural language processing tasks, which randomly masks or replaces parts of the input text and trains the model to predict these masked or replaced words based on context, thereby learning deep representations of language) method. Specifically, BERT can be a BERT-Base with a 12-layer Transformer encoder. The fire pipe diameter inference model is obtained by fine-tuning the pre-trained mask prediction model using training samples. The core function of this model is to predict the diameter of a specified pipe based on the geometric information and spatial context of the fire pipeline system. In this embodiment, fine-tuning training can employ LoRA (Low-Rank Adaptation) parameter fine-tuning technology to significantly reduce training costs and storage requirements.
[0052] For example, using a pre-trained mask prediction model as the baseline model, the Low-Rank Adaptive (LoRA) technique is employed. This involves freezing the backbone parameters of the pre-trained mask prediction model and training only the injected low-rank matrix parameters. Specifically, training samples from the training set can be input into the pre-trained mask prediction model. After processing by a multi-layer Transformer encoder, the model outputs the hidden state vector for each token position and extracts the vector corresponding to the mask position. This vector is then mapped to the pipe diameter category space through a fully connected layer (Classification Head) to obtain the predicted probability distribution. Since pipe diameter selection is essentially a multi-classification problem (categories include standard DN25, DN32, ..., DN200, etc.), the cross-entropy loss function is used to calculate the cross-entropy loss between the predicted values of the masked labels and the training labels. Based on the calculated loss value, the model parameters are adjusted using the backpropagation algorithm and an optimizer (such as AdamW). During this process, through multiple iterations (Epochs), the model minimizes the error between the predicted pipe diameter and the true label, thereby learning the rule of "which standard pipe diameter should be selected under what geometric topology and proximity relationships," thus obtaining the trained fire protection pipe diameter inference model for inferring and predicting pipe diameter information in fire protection systems.
[0053] In one scenario, a hierarchical data augmentation strategy can be employed during the training process described above. The samples are divided into training and test sets, with different occlusion rates (e.g., 15%-25% for the training set and 10%-20% for the test set). A higher training set occlusion rate prevents overfitting and forces the model to utilize broader contextual information for reasoning; a lower test set occlusion rate is used to more accurately evaluate the model's performance under normal conditions. After this training, a fire-fighting pipe diameter inference model is finally obtained. This model can receive multimodal text sequences describing fire-fighting components and their surrounding environment and accurately predict standard pipe diameters conforming to specifications.
[0054] In one scenario, parallel training (DDP) based on distributed data can also be performed to compute gradients in parallel across multiple graphics processors and synchronize model parameters, ensuring flexibility and reliability in configuration.
[0055] The training method for the aforementioned fire pipe diameter inference model involves extracting geometric attribute information of target sample components from fire system sample drawings, calculating spatial proximity relationships between these components based on this information, and generating structured sample data containing both geometric attribute information and spatial proximity relationships. This structured sample data is then converted into templated natural language description text, which is further segmented and encoded to generate more sample data. A pre-defined masking strategy is used to replace pipe diameter labels in the sample data with mask markers, and these labels are used as training labels for the mask markers to generate training samples. The training samples are then used to fine-tune the pre-trained mask prediction model, resulting in the fire pipe diameter inference model. This innovative approach transforms the geometric topological relationships in CAD drawings into natural language sequences, leveraging the semantic understanding capabilities of the pre-trained language model to model pipe diameter prediction as a mask classification task, thus achieving an automated and high-precision fire pipe diameter inference model. By combining a layered masking strategy, the model's generalization ability in data-deficient scenarios is improved, and efficient sample construction and training on a scale of tens of thousands of components are achieved, demonstrating significant engineering application value.
[0056] For illustrative purposes, to aid understanding, the model training process described above is further illustrated below with a specific embodiment. In this embodiment, a sample drawing shows a main pipe connecting two sprinkler heads. Assume the geometric attribute information of the target sample component extracted from the drawing includes: Sprinkler A: coordinates (0, 0), type = sprinkler; Sprinkler B: coordinates (100, 0), type = sprinkler; Pipe C: endpoints (0,0) to (100,0), type = pipe, actual pipe diameter = DN32.
[0057] Based on this, the K-nearest neighbor algorithm can be used to calculate the spatial distance and topological relationship between each target sample component to obtain the spatial proximity relationship between the target sample components. For example, if the K-nearest neighbor algorithm is used to calculate the distance, it is found that nozzle A and nozzle B are closest to pipe C, then nozzle A and nozzle B can be determined to be neighbor components of pipe C. Further topological relationship calculation is then performed. Since the endpoints of pipe C coincide with the coordinates of nozzles A and B, the calculated minimum distance is 0, which is less than the tolerance of 10, thus indicating a connected relationship. Furthermore, since the direction of the line connecting nozzle A and nozzle B is completely consistent with the direction of pipe C, the calculated angle constraint value, i.e., the cosine value, is 1, which is greater than the constraint value of 0.98, thus indicating a parallel relationship.
[0058] The aforementioned geometric attribute information and spatial proximity relationships can then be converted into structured sample data, such as standard JSON data. For example, the structured sample data obtained after conversion can be in the following format: [ { Component Identifier: "Pipe C" Component Type: "Sprinkler Pipe" "Geometric properties":{"Start point":[0,0],"End point":[100,0],"Length":100}, "Spatial Proximity":[ {"Neighbor":"Sprinkler A","Relationship":"Connected"}, {"Neighbor":"Sprinkler B","Relationship":"Connected"} ], Pipe diameter label: "DN32" }, { Component Identification: "Nozzle A" "Component Type": "Sprayer", "Spatial Proximity":[ {"Neighbor":"Pipe C","Relationship":"Connected"}, {"Neighbor":"Sprinkler B","Relationship":"Parallel"} ] }, { Component Identification: "Nozzle B" "Component Type": "Sprayer", "Spatial Proximity":[ {"Neighbor":"Pipe C","Relationship":"Connected"}, {"Neighbor":"Sprinkler A","Relationship":"Parallel"} ] } ] Furthermore, the structured sample data can be converted into natural language descriptive text similar to human speech, and the natural language descriptive text can be segmented and encoded to generate sample data that the model can understand.
[0059] For example, the structured sample data mentioned above can be concatenated into a coherent text based on a preset template (e.g., "[Identifier] is [Type], it [Relationship] [Neighbor]", etc.). The converted natural language description text would then be: "Pipe C is a sprinkler pipe, it runs from the starting point (0,0) to the ending point (100,0), with a length of 100. It connects to sprinkler A, it connects to sprinkler B, and its diameter is DN32. Sprinkler A is a sprinkler, it connects to pipe C, and it is parallel to sprinkler B. Sprinkler B is a sprinkler, it connects to pipe C, and it is parallel to sprinkler A." Since the model cannot recognize Chinese characters, a tokenizer is needed to segment and encode the aforementioned natural language description text. This involves dividing the text into small units (Tokens) and mapping them to numerical IDs in the vocabulary to generate sample data. For example, the generated sample data could look like this: [101,5021,2003,8832,1010,2009,4512,3015,1010,...] In this embodiment, training samples for model training can be generated based on the aforementioned sample data using a preset masking strategy. For example, the pipe diameter labels in the sample data can be replaced with mask markers based on the preset masking strategy, and the pipe diameter labels in the sample data can be used as the training labels corresponding to the mask markers to generate training samples.
[0060] For example, for the sample data above, the code corresponding to the pipe diameter label such as "DN32" can be replaced with a MASK marker (such as "MASK" or other specified identifier), and the code of the pipe diameter label such as "DN32" can be used as the training label corresponding to the mask marker such as "MASK" to generate training samples. The training samples could be in the following format: [(101,5021,2003,8832,1010,2009,4512,...,MASK,...);(MASK:XXXX)] Here, "XXXX" represents the code corresponding to the pipe diameter label such as "DN32".
[0061] Finally, the pre-trained mask prediction model is fine-tuned using training samples to obtain a fire pipe diameter inference model. This allows the trained model to predict the pipe diameter based on the geometric properties and spatial proximity of components in the fire piping system.
[0062] Based on the same inventive concept, this application also provides a method for marking the diameter of fire-fighting pipes, such as... Figure 2 As shown, the method may specifically include: Step 202: Obtain the component data to be annotated in the drawing of the fire protection system.
[0063] The drawings to be annotated for the fire protection system can be CAD drawings, BIM model files, etc., without pipe diameter information. The data for the components to be annotated includes the component identifier, geometric attribute information, and spatial proximity code of each component. The components to be annotated are those that require pipe diameter annotation, such as sprinkler pipes, fire hydrant pipes, valves, sprinkler heads, and other components related to fire protection pipelines.
[0064] Specifically, by parsing the DXF format fire protection system drawings to be annotated, the geometric attribute information of all pipeline-related components is extracted, including the unique identifier (id) of each component, geometric coordinates, component type, direction information, length parameters, pipe diameter (if applicable), and the number of downstream sprinklers, among other key attributes. Then, the spatial proximity relationship of each component is analyzed using the K-nearest neighbor algorithm to deduce the upstream and downstream spatial connections of the pipeline. The extracted geometric attribute information of all components and the calculated spatial proximity relationship information are then saved into a unified JSON format data structure to generate structured data. The structured data is converted into templated natural language description text, and the natural language description text is segmented and encoded to obtain the component data to be annotated. For details, refer to steps 102 and 104 above, the difference being that steps 102 and 104 process sample drawings with annotated pipe diameter information, while this embodiment processes drawings without annotated pipe diameter information, and the pipe diameter positions are marked using a mask.
[0065] Step 204: Using the fire pipe diameter inference model trained by the above method, prediction is made based on the set inference mode and the data of the components to be labeled, and the pipe diameter prediction results and corresponding confidence levels of each component to be labeled are obtained.
[0066] The inference mode refers to the method by which the model performs inference and prediction, specifically including batch prediction mode and iterative prediction mode. Batch prediction mode organizes multiple components to be labeled into a batch for parallel prediction to obtain the pipe diameter prediction result and corresponding confidence level for each component, thus completing the pipe diameter prediction task for all components at once. This is suitable for situations where the data is relatively complete (e.g., only a small number of components in the drawing need pipe diameter labeling, while most pipe diameter information is known). Iterative prediction mode, on the other hand, adopts a confidence-based progressive inference strategy, gradually improving the inference quality through multiple iterations to obtain high-quality pipe diameter inference results. This is suitable for scenarios requiring high-precision labeling.
[0067] The pipe diameter prediction result is the predicted pipe diameter value of the component to be labeled, which is obtained by reasoning based on the fire pipe diameter inference model. The confidence level is used to characterize the reliability of the corresponding pipe diameter prediction result.
[0068] In this embodiment, the data of the components to be labeled are input into the fire pipe diameter inference model trained by the above method based on the set inference mode, so as to obtain the pipe diameter prediction results and corresponding confidence levels of each component to be labeled output by the model.
[0069] Step 206: Visualize the pipe diameter prediction results in the fire protection system drawings to be annotated according to the confidence level.
[0070] For example, the predicted pipe diameters of each component can be overlaid on the drawings (such as CAD) of the fire protection system to be annotated, and labeled using different color codes according to the corresponding confidence levels. For instance, different colors can be used to display the predicted pipe diameters at different confidence levels. High-confidence-level predictions are displayed in green, medium-confidence-level predictions in yellow, and low-confidence-level or very low-confidence-level predictions in red or highlighted. This display method not only provides a visual representation of the predicted pipe diameters but also offers an intuitive quality assessment.
[0071] In one scenario, a spatially distributed confidence heatmap can be generated based on the predicted pipe diameter and corresponding confidence level of each component to be labeled, displaying the quality distribution and uncertainty areas of the prediction results. For example, a red area indicates that the pipe network in that area is complex and the model prediction uncertainty is high, prompting designers to pay close attention; a green area indicates that the prediction is stable and reliable, etc.
[0072] In one scenario, interactive corrections to the heatmap can also be supported. For example, engineers can click on components with low confidence to view the top-3 candidate pipe diameters and their probabilities provided by the model, and manual corrections are supported. The corrected data can then be used as new training samples for continuous iterative optimization of the model.
[0073] In the aforementioned method for annotating fire-fighting pipe diameters, data of the components to be annotated on the drawings of the fire-fighting system are obtained. A fire-fighting pipe diameter inference model trained using the above method is then used to predict the pipe diameter based on a set inference mode and the component data. This yields the predicted pipe diameter and corresponding confidence level for each component. The predicted pipe diameter is then visualized on the drawings of the fire-fighting system according to the confidence level. This fully automated processing from CAD drawings to inference results significantly reduces manual annotation workload. It provides batch and iterative prediction modes to adapt to different computing resources and application scenarios. Visualizing the pipe diameter prediction results through confidence levels not only provides the prediction results but also clearly indicates their reliability, effectively reducing engineering risks caused by model misjudgments, maximizing the efficiency of automated annotation, and achieving a highly efficient closed loop of human-machine collaboration.
[0074] In an exemplary embodiment, taking batch prediction mode as an example, the specific inference prediction process is as follows: Figure 3 As shown, it includes the following steps: Step 302: Organize the component data to be labeled into batch data based on the component identifier of each component to be labeled, with each batch data including multiple components to be labeled.
[0075] The size of the batch data can be dynamically configured based on computing resources. In this embodiment, the data of all components to be labeled can be organized into multiple batches based on component identifiers, with each batch containing a fixed number of components (e.g., 32 or 64).
[0076] Step 304: Use the fire pipe diameter inference model to perform parallel prediction on multiple components to be labeled in the batch data, and obtain the pipe diameter prediction probability distribution of each component to be labeled.
[0077] For example, the open-source BERT Chinese base model (bert-base-chinese) can be loaded as the backbone network; then, the trained LoRA adapter weights can be loaded and merged into the base model using PeftModel from the PEFT library. The merging method is to superimpose the reduced-rank matrix product of LoRA (i.e., W+BA) on the Query and Value matrices of each Transformer layer; finally, the merged complete model (BERT+LoRA) is loaded, which is the fire pipe diameter inference model trained above.
[0078] For each batch of data (input text processed according to the same masking strategy as training), it is fed into the fire pipe diameter inference model. Parallel forward propagation is performed using GPU acceleration to obtain the logits output of each component at the [MASK] position in the batch of data output by the model. Then, the softmax function is executed on the logits to obtain the probability distribution of the entire vocabulary (i.e. pipe diameter classification), which is the pipe diameter prediction probability distribution.
[0079] Step 306: Based on the pipe diameter prediction probability distribution of each component to be labeled, select the pipe diameter prediction value with the highest probability as the pipe diameter prediction result for labeling, and calculate the corresponding confidence level.
[0080] Specifically, based on the pipe diameter prediction probability distribution of each component to be labeled, the category of the pipe diameter prediction value with the highest probability is selected as the pipe diameter prediction result for labeling, and the corresponding confidence level is calculated. This enables batch processing prediction of the component data to be labeled.
[0081] In an exemplary embodiment, taking the iterative prediction mode as an example, the specific inference prediction process is as follows: Figure 4 As shown, it includes the following steps: Step 402: Initialize the maximum number of iterations and the confidence level threshold of the fire pipe diameter inference model.
[0082] The maximum number of iterations is the maximum allowed number of times the model can perform iterative predictions, while the confidence level threshold is a condition used to filter the predicted pipe diameter value during each iteration. For example, the confidence level can specifically include high confidence, medium confidence, low confidence, and very low confidence; the process of classifying confidence levels will be described in detail in subsequent embodiments.
[0083] For example, the confidence level threshold can be configured to a specific confidence level based on the actual application scenario. For instance, for scenarios with high prediction accuracy requirements, the confidence level threshold can be configured to high confidence to improve the reliability of pipe diameter prediction results; for scenarios with general prediction accuracy requirements, the confidence level threshold can be configured to medium or low confidence to balance accuracy and efficiency in pipe diameter prediction.
[0084] For example, the open-source BERT Chinese base model (bert-base-chinese) can be loaded as the backbone network; then, the trained LoRA adapter weights can be loaded and merged into the base model using PeftModel from the PEFT library. The merging method is to superimpose the reduced-rank product of LoRA matrices (i.e., W+BA) onto the Query and Value matrices of each Transformer layer; finally, the merged complete model (BERT+LoRA) is loaded, which is the fire pipe diameter inference model trained above. During initialization, the maximum number of iterations of the fire pipe diameter inference model can be set. (e.g., 5 times) and confidence level threshold (e.g., medium confidence level).
[0085] Step 404: Input the data of the component to be labeled into the initialized fire pipe diameter inference model for prediction.
[0086] Step 406: Obtain the pipe diameter prediction probability distribution for each component to be labeled in the model output, determine the pipe diameter prediction value with the highest probability, and calculate the corresponding confidence level.
[0087] For example, in the first round of prediction, the prediction probability distribution of the pipe diameter of each component to be labeled is obtained by inputting the data of the component to be labeled into the initialized fire pipe diameter inference model, and the pipe diameter prediction value with the highest probability is determined, and the confidence level corresponding to the pipe diameter prediction value with the highest probability is calculated.
[0088] Step 408: Label the pipe diameter prediction values with a confidence level greater than or equal to the confidence level threshold as pipe diameter prediction results, and update the component data to be labeled.
[0089] For example, confidence level The predicted pipe diameter is used as the predicted pipe diameter for the corresponding component and labeled. This labeled pipe diameter information is then backfilled into the text description of the component data to be labeled to update the component data. For example, "Sprinkler 1: Pipe diameter is [MASK]" in the text is updated to "Sprinkler 1: Pipe diameter DN100", where "DN100" is the pipe diameter prediction value with the highest probability in the pipe diameter prediction probability distribution of sprinkler 1, and its corresponding confidence level is greater than or equal to the confidence level threshold.
[0090] For example, if the confidence level threshold For medium confidence, based on the above steps, the pipe diameter prediction probability distribution of each component to be labeled is obtained from the model output. After determining the pipe diameter prediction value with the highest probability and its corresponding confidence level, if the confidence level corresponding to the pipe diameter prediction value with the highest probability in the pipe diameter prediction probability distribution of a certain component to be labeled is medium confidence or high confidence, then the confidence level corresponding to the pipe diameter prediction value of that component to be labeled is (medium confidence or high confidence). Confidence level threshold (Medium confidence level) indicates that the confidence level corresponding to the predicted pipe diameter of the component to be labeled meets the confidence level threshold. This confirms that the predicted pipe diameter of the component to be labeled meets the labeling requirements in this iteration prediction. Therefore, the predicted pipe diameter of the component to be labeled can be used as the pipe diameter prediction result for labeling.
[0091] If the confidence level threshold For medium confidence levels, if the confidence level corresponding to the pipe diameter prediction value with the highest probability in the probability distribution of the pipe diameter prediction for a certain component to be labeled is low confidence or very low confidence, that is, the confidence level (low confidence or very low confidence) corresponding to the pipe diameter prediction value of the component to be labeled is less than the confidence level threshold. (Medium confidence level) indicates that the confidence level corresponding to the predicted pipe diameter of the component to be labeled does not meet the confidence level threshold. Therefore, it can be determined that the predicted pipe diameter of the component to be labeled does not meet the labeling requirements in this iteration prediction. Therefore, the predicted pipe diameter of the component to be labeled does not need to be labeled, but iterative prediction and labeling can be performed in subsequent iterations.
[0092] Step 410: Determine whether there are any unlabeled pipe diameter components in the updated component data.
[0093] Specifically, if the updated data of components to be labeled does not contain any components with unlabeled pipe diameters, it means that the pipe diameters of all components have been labeled through the above reasoning and prediction, and the confidence levels of the corresponding labeled pipe diameter prediction results all meet the confidence level threshold requirements. Therefore, step 416 can be executed to end the prediction process. If the updated data of components to be labeled contains components with unlabeled pipe diameters, then step 412 is executed.
[0094] Step 412: Determine whether the maximum number of iterations has been reached.
[0095] Specifically, if the maximum number of iterations has been reached, proceed to step 416 to end the prediction process. If the maximum number of iterations has not been reached, proceed to step 414.
[0096] Step 414: Input the updated component data to be labeled into the fire pipe diameter inference model for iterative prediction.
[0097] Specifically, if the maximum number of iterations has not been reached, the updated data of the components to be labeled is input into the fire pipe diameter inference model for iterative prediction, and the process returns to step 406. The iteration ends when the maximum number of iterations is reached or when there are no unlabeled components in the updated data of components to be labeled. After one or more predictions, the pipe diameter predictions that meet the requirements have been labeled as pipe diameter prediction results, thus updating the context information of the component data to be labeled, making the context of the component data richer (e.g., the pipe diameters of some neighbors are known). Furthermore, as the iteration progresses, more and more components are labeled, and the context information of the remaining unlabeled components becomes increasingly rich, thereby improving the accuracy of the model's predictions.
[0098] Step 416: End the prediction process.
[0099] Specifically, the iteration ends, i.e. the prediction process ends, if the maximum number of iterations is reached or there are no unlabeled pipe diameter components in the updated component data.
[0100] This embodiment, through an iterative prediction mode, dynamically transforms high-confidence local prediction results into global context information, simulating the logical deduction process of manually inferring the unknown from the known. It effectively utilizes the cascading characteristics of pipeline network topology, significantly improving the overall consistency and accuracy of pipe diameter labeling in complex systems.
[0101] In one exemplary embodiment, such as Figure 5 As shown, the confidence levels corresponding to the above calculations can specifically include: Step 502: Based on the predicted probability distribution of the pipe diameter for each component to be labeled, determine the highest probability value and the second highest probability value.
[0102] In this embodiment, a refined confidence calculation strategy can be adopted to quantify the reliability of the prediction results. Specifically, based on the predicted probability distribution of the pipe diameter for each component to be labeled, the highest probability value and the second highest probability value are determined.
[0103] Since fire pipe diameter prediction is essentially a classification selection (the category is a standard fire pipe diameter such as DN25, DN32, ..., DN200, etc.), the pipe diameter prediction probability distribution is the probability of predicting each pipe diameter category for a given component to be labeled. For example, if there are pipe diameter categories DN25, DN32, and DN80, and the predicted pipe diameter probability distribution for a given component is P1 for selecting DN25, P2 for selecting DN32, and P3 for selecting DN80, then the highest and second-highest values are determined from P1, P2, and P3.
[0104] Step 504: Calculate the difference between the highest probability value and the second highest probability value.
[0105] For example, if the highest probability value determined above... P2, the second highest probability value If the value is P1, then calculate the difference between the highest probability value and the second highest probability value, i.e., calculate... A larger difference indicates that the model is more confident in its prediction. This is then used as the basis for subsequent steps to classify the confidence level.
[0106] Step 506: Determine the corresponding confidence level based on the highest probability value, the difference, and the preset confidence level classification strategy.
[0107] The confidence level classification strategy can be a pre-set condition for classifying confidence levels, which may include a threshold condition for the highest probability value and a threshold condition for the difference.
[0108] For example, if the highest probability value is greater than or equal to a first probability threshold, and the difference is greater than or equal to a first difference threshold, the corresponding confidence level can be determined as high confidence. If the highest probability value is greater than or equal to a second probability threshold, and the difference is greater than or equal to a second difference threshold, the corresponding confidence level can be determined as medium confidence; wherein the second probability threshold is less than the first probability threshold, and the second difference threshold is less than the first difference threshold. If the highest probability value is greater than or equal to a third probability threshold, and the difference is greater than or equal to a third difference threshold, the corresponding confidence level is determined as low confidence; wherein the third probability threshold is less than the second probability threshold, and the third difference threshold is less than the second difference threshold. If the highest probability value is less than the third probability threshold, or if the difference is less than the third difference threshold, the corresponding confidence level is determined as very low confidence.
[0109] The first, second, and third probability thresholds are primarily used to define the baseline of absolute confidence, determining the model's basic level of trust in the current prediction result. The first, second, and third difference thresholds introduce the concept of competition exclusion; a larger difference indicates that the second-place result is significantly inferior to the first, thus demonstrating the robustness of the model's judgment. It is understood that these thresholds can be flexibly configured based on the actual scenario. This embodiment introduces a two-factor evaluation mechanism, simultaneously considering absolute probability (… ) and relative discrimination (difference) This can avoid potential risks of misjudgment.
[0110] For example, in this embodiment, the first probability threshold is 0.8, the second probability threshold is 0.6, the third probability threshold is 0.4, the first difference threshold is 0.3, the second difference threshold is 0.2, and the third difference threshold is 0.1. If the highest probability value of the predicted pipe diameter in the predicted pipe diameter probability distribution of a certain component to be labeled is... The difference between the highest probability value and the second highest probability value As shown below, we have: like and If the predicted pipe diameter (i.e., the predicted pipe diameter with the highest probability) is high confidence, it means that the model is very confident and can be directly adopted.
[0111] like and If the confidence level of the predicted pipe diameter is 0, then the confidence level of the predicted pipe diameter is medium confidence, indicating that the model has a clear bias.
[0112] like and If the confidence level of the predicted pipe diameter is low, it indicates that the uncertainty of the model prediction is high.
[0113] like or If the confidence level of the predicted pipe diameter is very low, it means the prediction is unreliable and requires manual verification.
[0114] During the model inference process, confidence level thresholds can be configured based on the accuracy requirements of the actual scenario, and the predicted pipe diameter of the component can be labeled based on the confidence level of the predicted pipe diameter and the configured confidence level threshold, so as to improve the reliability of the fire pipe diameter labeling results.
[0115] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0116] Based on the same inventive concept, this application also provides an apparatus for implementing the training method of the fire pipe diameter reasoning model mentioned above. The solution provided by this apparatus is similar to the solution described in the above method. Therefore, the specific limitations of one or more embodiments of the fire pipe diameter reasoning model training apparatus provided below can be found in the limitations of the training method of the fire pipe diameter reasoning model above, and will not be repeated here.
[0117] In one exemplary embodiment, such as Figure 6 As shown, a training device for a fire pipe diameter inference model is provided, comprising: an information extraction module 602, a data conversion module 604, a training sample generation module 606, and a training module 608, wherein: The information extraction module 602 is used to extract the geometric attribute information of the target sample components from the fire protection system sample drawings, calculate the spatial proximity relationship between the target sample components based on the geometric attribute information, and generate structured sample data containing geometric attribute information and spatial proximity relationship. The data conversion module 604 is used to convert the structured sample data into templated natural language description text, and to perform word segmentation and encoding processing on the natural language description text to generate sample data; the sample data includes the component identifier, geometric attribute information, spatial proximity relationship encoding, and corresponding pipe diameter label of the target sample component; The training sample generation module 606 is used to replace the pipe diameter label in the sample data with a masking mark using a preset masking strategy, and use the pipe diameter label of the sample data as the training label corresponding to the masking mark to generate training samples. The training module 608 is used to fine-tune the pre-trained mask prediction model using the training samples to obtain the fire pipe diameter inference model.
[0118] In an exemplary embodiment, the information extraction module is further configured to: calculate the spatial distance and topological relationship between each target sample component using the K-nearest neighbor algorithm based on the geometric attribute information, wherein the topological relationship is used to characterize the parallel relationship, perpendicular relationship or connection relationship between each target sample component.
[0119] In an exemplary embodiment, the information extraction module is further configured to: for any target sample component, determine the corresponding neighbor component using the K-nearest neighbor algorithm based on the geometric attribute information; determine the angle constraint value and minimum spacing between the target sample component and the neighbor component; the angle constraint value is used to characterize the absolute value of the cosine of the angle between the direction vector of the target sample component and the direction vector of the neighbor component, and the minimum spacing is used to characterize the minimum Euclidean distance between the endpoint of the target sample component and the endpoint of the neighbor component; if the angle constraint value satisfies a first condition, determine that the target sample component and the neighbor component are parallel; if the angle constraint value satisfies a second condition, determine that the target sample component and the neighbor component are perpendicular; if the minimum spacing satisfies a third condition, determine that the target sample component and the neighbor component are connected.
[0120] In an exemplary embodiment, the training module is further configured to: input the training samples into the pre-trained mask prediction model for prediction, and obtain the predicted values corresponding to the mask labels in the training samples; and adjust the parameters of the pre-trained mask prediction model based on minimizing the cross-entropy loss between the predicted values of the mask labels and the training labels, to obtain a fire pipe diameter inference model.
[0121] In an exemplary embodiment, the training sample generation module is further configured to: determine a training set and a test set based on the training samples using a hierarchical data augmentation strategy, wherein the occlusion rate of the sample data in the training set and the test set is 10% to 60%, and the occlusion rate of the training set is greater than the occlusion rate of the test set.
[0122] Each module in the training device for the aforementioned fire pipe diameter reasoning model can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can call and execute the corresponding operations of each module.
[0123] Based on the same inventive concept, this application also provides an apparatus for implementing the fire pipe diameter marking method described above. The solution provided by this apparatus is similar to the solution described in the above method; therefore, the specific limitations of one or more fire pipe diameter marking apparatus embodiments provided below can be found in the limitations of the fire pipe diameter marking method described above, and will not be repeated here.
[0124] In one exemplary embodiment, such as Figure 7As shown, a fire pipe diameter marking device is provided, including: a data acquisition module 702, a marking prediction module 704, and a display module 706, wherein: The data acquisition module 702 is used to acquire the component data to be labeled in the drawings of the fire protection system. The component data to be labeled includes the component identifier, geometric attribute information and spatial proximity relationship code of each component to be labeled. The annotation prediction module 704 is used to predict the diameter of each fire pipe using the fire pipe diameter inference model trained by the method described above, based on the set inference mode and the data of the component to be annotated, and to obtain the pipe diameter prediction result and the corresponding confidence level of each component to be annotated. The display module 706 is used to visualize the pipe diameter prediction results in the fire protection system drawing to be annotated according to the confidence level.
[0125] In an exemplary embodiment, when the inference mode is set to batch prediction mode, the annotation prediction module is specifically used to: organize the data of the components to be annotated into batch data based on the component identifier of each component to be annotated, with each batch data including multiple components to be annotated; use the fire pipe diameter inference model to perform parallel prediction on multiple components to be annotated in the batch data to obtain the pipe diameter prediction probability distribution of each component to be annotated; based on the pipe diameter prediction probability distribution of each component to be annotated, select the pipe diameter prediction value with the highest probability as the pipe diameter prediction result for annotation, and calculate the corresponding confidence level.
[0126] In an exemplary embodiment, when the inference mode is set to iterative prediction mode, the annotation prediction module is specifically used to: initialize the maximum number of iterations and the confidence level threshold of the fire pipe diameter inference model; input the data of the component to be annotated into the initialized fire pipe diameter inference model for prediction, obtain the pipe diameter prediction probability distribution of each component to be annotated, determine the pipe diameter prediction value with the highest probability, and calculate the corresponding confidence level; annotate the pipe diameter prediction values with the confidence level greater than or equal to the confidence level threshold as the pipe diameter prediction results, and update the data of the component to be annotated; if it is determined that there are unannotated components in the updated data of the component to be annotated, input the updated data of the component to be annotated into the fire pipe diameter inference model for iterative prediction, until the maximum number of iterations is reached or there are no unannotated components in the updated data of the component to be annotated, and then end the iteration.
[0127] In an exemplary embodiment, the calculation of the corresponding confidence level includes: determining the highest probability value and the second highest probability value based on the predicted probability distribution of the pipe diameter of each component to be labeled; calculating the difference between the highest probability value and the second highest probability value; and determining the corresponding confidence level according to the highest probability value, the difference, and a preset confidence level classification strategy.
[0128] In an exemplary embodiment, determining the corresponding confidence level based on the highest probability value, the difference, and a preset confidence level classification strategy includes: determining a high confidence level when the highest probability value is greater than or equal to a first probability threshold and the difference is greater than or equal to a first difference threshold; determining a medium confidence level when the highest probability value is greater than or equal to a second probability threshold and the difference is greater than or equal to a second difference threshold, wherein the second probability threshold is less than the first probability threshold and the second difference threshold is less than the first difference threshold; determining a low confidence level when the highest probability value is greater than or equal to a third probability threshold and the difference is greater than or equal to a third difference threshold, wherein the third probability threshold is less than the second probability threshold and the third difference threshold is less than the second difference threshold; and determining an extremely low confidence level when the highest probability value is less than the third probability threshold or when the difference is less than the third difference threshold.
[0129] In an exemplary embodiment, the display module is further configured to: overlay the pipe diameter prediction results of each component to be labeled on the fire protection system drawing to be labeled, and label them with different color codes according to the corresponding confidence level; and / or, generate a confidence heat map based on spatial distribution according to the pipe diameter prediction results and the corresponding confidence level of each component to be labeled, and display the quality distribution and uncertainty area of the prediction results.
[0130] Each module in the aforementioned fire pipe diameter marking device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0131] In one exemplary embodiment, a computer device is provided, the internal structure of which can be as shown in the figure. Figure 8As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a training method for a fire pipe diameter inference model or a fire pipe diameter labeling method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0132] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0133] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0134] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0135] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0136] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0137] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0138] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0139] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A training method for a fire-fighting pipe diameter inference model, characterized in that, The method includes: Extract the geometric attribute information of the target sample component from the sample drawings of the fire protection system. The target sample component is a linear component related to fire protection pipelines. The geometric attribute information includes component identification, component type, geometric position coordinates, direction vector, length parameter and pipe diameter value. Based on the geometric attribute information, the K-nearest neighbor algorithm is used to calculate the spatial proximity relationship between each target sample component, generating structured sample data containing geometric attribute information and spatial proximity relationship; the spatial proximity relationship includes the spatial distance and topological relationship between each target sample component, and the topological relationship is used to characterize the parallel relationship, perpendicular relationship or adjoining relationship between each target sample component; The structured sample data is converted into templated natural language description text, and the natural language description text is segmented and encoded to generate sample data; the sample data includes the component identifier, geometric attribute information, spatial proximity relationship encoding, and corresponding pipe diameter label of the target sample component; A preset masking strategy is used to replace the pipe diameter labels in the sample data with mask markers, and the pipe diameter labels in the sample data are used as training labels corresponding to the mask markers to generate training samples. The pre-trained mask prediction model is fine-tuned using the training samples to obtain the fire pipe diameter inference model; The step of calculating the spatial proximity relationship between each target sample component using the K-nearest neighbor algorithm based on the geometric attribute information includes: For any target sample component, the K-nearest neighbor algorithm is used to determine the corresponding neighbor components based on the geometric attribute information; Determine the angle constraint value and minimum spacing between any target sample component and its neighboring component; the angle constraint value is used to characterize the absolute value of the cosine of the angle between the direction vector of any target sample component and the direction vector of its neighboring component, and the minimum spacing is used to characterize the minimum Euclidean distance between the endpoint of any target sample component and the endpoint of its neighboring component; If the angle constraint value satisfies the first condition, it is determined that any target sample component and its neighboring component are parallel. If the angle constraint value satisfies the second condition, it is determined that any target sample component and its neighboring component are in a perpendicular relationship. If the minimum spacing satisfies the third condition, it is determined that any target sample component and its neighboring component are in a connected relationship.
2. The method according to claim 1, characterized in that, The preset masking strategy includes a fixed masking strategy or a random masking strategy; the fixed masking strategy is a strategy to mask the pipe diameter labels in all sample data, and the random masking strategy is a strategy to mask the pipe diameter labels in the sample data based on a preset ratio.
3. The method according to claim 1, characterized in that, The process of fine-tuning the pre-trained mask prediction model using the training samples to obtain the fire pipe diameter inference model includes: The training samples are input into the pre-trained mask prediction model for prediction, and the predicted values corresponding to the mask labels in the training samples are obtained. Based on minimizing the cross-entropy loss between the predicted value of the mask label and the training label, the parameters of the pre-trained mask prediction model are adjusted to obtain the fire pipe diameter inference model.
4. The method according to claim 1, characterized in that, After generating the training samples, the method further includes: Based on the training samples, a hierarchical data augmentation strategy is used to determine the training set and the test set. The occlusion rate of the sample data in the training set and the test set is 10% to 60%, and the occlusion rate of the training set is greater than that of the test set.
5. A method for marking the diameter of fire-fighting pipes, characterized in that, The method includes: Obtain the component data to be annotated from the drawings of the fire protection system. The component data to be annotated includes the component identifier, geometric attribute information and spatial proximity code of each component to be annotated. The fire pipe diameter inference model trained by the method described in any one of claims 1 to 4 is used to make predictions based on the set inference mode and the data of the components to be labeled, so as to obtain the pipe diameter prediction results and corresponding confidence levels of each component to be labeled. Based on the confidence level, the pipe diameter prediction results are visualized in the fire protection system drawings to be annotated. Wherein, when the set inference mode is the iterative prediction mode, the fire pipe diameter inference model trained by the method as described in any one of claims 1 to 4, based on the set inference mode and the data of the components to be labeled, performs prediction to obtain the pipe diameter prediction results and corresponding confidence levels of each component to be labeled, including: Initialize the maximum number of iterations and the confidence level threshold of the fire pipe diameter inference model; The data of the component to be labeled is input into the initialized fire pipe diameter inference model for prediction, the pipe diameter prediction probability distribution of each component to be labeled is obtained, the pipe diameter prediction value with the highest probability is determined, and the corresponding confidence level is calculated. The predicted pipe diameter values with a confidence level greater than or equal to the confidence level threshold are labeled as pipe diameter prediction results, and the data of the component to be labeled is updated. If it is determined that there are unlabeled components in the updated data of components to be labeled, the updated data of components to be labeled is input into the fire pipe diameter inference model for iterative prediction until the maximum number of iterations is reached or there are no unlabeled components in the updated data of components to be labeled, then the iteration ends.
6. The method according to claim 5, characterized in that, The component data to be labeled is organized into batch data based on the component identifier of each component to be labeled, and each batch data includes multiple components to be labeled; The fire pipe diameter inference model is used to perform parallel predictions on multiple components to be labeled in the batch data to obtain the pipe diameter prediction probability distribution for each component to be labeled. Based on the pipe diameter prediction probability distribution of each component to be labeled, the pipe diameter prediction value with the highest probability is selected as the pipe diameter prediction result for labeling, and the corresponding confidence level is calculated.
7. The method according to claim 5, characterized in that, The confidence level corresponding to the calculation includes: Based on the predicted probability distribution of the pipe diameter for each component to be labeled, determine the highest probability value and the second highest probability value; Calculate the difference between the highest probability value and the second highest probability value; The corresponding confidence level is determined based on the highest probability value, the difference, and the preset confidence level classification strategy.
8. The method according to claim 7, characterized in that, The step of determining the corresponding confidence level based on the highest probability value, the difference, and a preset confidence level classification strategy includes: If the highest probability value is greater than or equal to the first probability threshold, and the difference is greater than or equal to the first difference threshold, the corresponding confidence level is determined to be high confidence. If the highest probability value is greater than or equal to the second probability threshold, and the difference is greater than or equal to the second difference threshold, the corresponding confidence level is determined to be medium confidence; the second probability threshold is less than the first probability threshold, and the second difference threshold is less than the first difference threshold. If the highest probability value is greater than or equal to the third probability threshold, and the difference is greater than or equal to the third difference threshold, the corresponding confidence level is determined to be low confidence; the third probability threshold is less than the second probability threshold, and the third difference threshold is less than the second difference threshold. If the highest probability value is determined to be less than the third probability threshold, or if the difference is determined to be less than the third difference threshold, the corresponding confidence level is determined to be extremely low confidence.
9. The method according to claim 5, characterized in that, The step of visualizing the pipe diameter prediction results in the fire protection system drawings to be annotated according to the confidence level includes: The predicted pipe diameters of each component to be annotated are overlaid on the drawings of the fire protection system, and different color codes are used for annotation according to the corresponding confidence level; and / or Based on the predicted pipe diameter of each component to be labeled and the corresponding confidence level, a confidence heatmap based on spatial distribution is generated to show the quality distribution and uncertainty area of the prediction results.
10. A training device for a fire-fighting pipe diameter reasoning model, characterized in that, The device includes: The information extraction module is used to extract the geometric attribute information of target sample components from fire protection system sample drawings. The target sample components are linear components related to fire protection pipelines. The geometric attribute information includes component identification, component type, geometric position coordinates, direction vector, length parameter, and pipe diameter value. Based on the geometric attribute information, the K-nearest neighbor algorithm is used to calculate the spatial proximity relationship between each target sample component, generating structured sample data containing geometric attribute information and spatial proximity relationship. The spatial proximity relationship includes the spatial distance and topological relationship between each target sample component. The topological relationship is used to characterize the parallel relationship, perpendicular relationship, or connection relationship between each target sample component. The data conversion module is used to convert the structured sample data into templated natural language description text, and to perform word segmentation and encoding on the natural language description text to generate sample data; the sample data includes the component identifier, geometric attribute information, spatial proximity relationship encoding, and corresponding pipe diameter label of the target sample component; The training sample generation module is used to replace the pipe diameter labels in the sample data with masking markers using a preset masking strategy, and use the pipe diameter labels of the sample data as training labels corresponding to the masking markers to generate training samples. The training module is used to fine-tune the pre-trained mask prediction model using the training samples to obtain the fire pipe diameter inference model. The information extraction module is further used for: For any target sample component, the K-nearest neighbor algorithm is used to determine the corresponding neighbor components based on the geometric attribute information; Determine the angle constraint value and minimum spacing between any target sample component and its neighboring component; the angle constraint value is used to characterize the absolute value of the cosine of the angle between the direction vector of any target sample component and the direction vector of its neighboring component, and the minimum spacing is used to characterize the minimum Euclidean distance between the endpoint of any target sample component and the endpoint of its neighboring component; If the angle constraint value satisfies the first condition, it is determined that any target sample component and its neighboring component are parallel. If the angle constraint value satisfies the second condition, it is determined that any target sample component and its neighboring component are in a perpendicular relationship. If the minimum spacing satisfies the third condition, it is determined that any target sample component and its neighboring component are in a connected relationship.
11. A fire pipe diameter marking device, characterized in that, The device includes: The data acquisition module is used to acquire the component data to be labeled in the drawings of the fire protection system. The component data to be labeled includes the component identifier, geometric attribute information and spatial proximity relationship code of each component to be labeled. The annotation prediction module is used to use the fire pipe diameter inference model trained by the method as described in any one of claims 1 to 4 to make predictions based on the set inference mode and the data of the components to be annotated, so as to obtain the pipe diameter prediction results and corresponding confidence levels of each component to be annotated. The display module is used to visualize the pipe diameter prediction results in the fire protection system drawings to be annotated according to the confidence level. Wherein, when the set inference mode is iterative prediction mode, the annotation prediction module is further used for: Initialize the maximum number of iterations and the confidence level threshold of the fire pipe diameter inference model; The data of the component to be labeled is input into the initialized fire pipe diameter inference model for prediction, the pipe diameter prediction probability distribution of each component to be labeled is obtained, the pipe diameter prediction value with the highest probability is determined, and the corresponding confidence level is calculated. The predicted pipe diameter values with a confidence level greater than or equal to the confidence level threshold are labeled as pipe diameter prediction results, and the data of the component to be labeled is updated. If it is determined that there are unlabeled components in the updated data of components to be labeled, the updated data of components to be labeled is input into the fire pipe diameter inference model for iterative prediction until the maximum number of iterations is reached or there are no unlabeled components in the updated data of components to be labeled, then the iteration ends.
12. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4 or 5 to 9.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4 or 5 to 9.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4 or 5 to 9.