A method and system for predicting engineering construction risks based on Transformer

By applying the Transformer-based construction risk prediction method in engineering construction, using multi-modal data and construction risk-hidden hazard knowledge graphs, the problems of low accuracy and low efficiency of construction risk prediction in the existing technology are solved, and more efficient construction is achieved. Risk identification and control.

CN119067459BActive Publication Date: 2025-01-24中国铁建昆仑投资集团有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411583747.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-01-24
Estimated Expiration
2044-11-07

AI Technical Summary

Technical Problem

The existing engineering construction risk prediction methods rely on manual inspection, video surveillance and sensor monitoring, and have limitations, such as it is difficult to achieve all-weather-free coverage, time-consuming data processing and low prediction accuracy.

Method used

Put forward a TRANSFORMER-based engineering construction risk prediction method. Through real-time collection of multi-mode data, build hidden dangers and potential hidden dangers, embed the construction risk-hidden danger knowledge map into the Transformer model, build a construction risk prediction model, gradually predict potential hidden dangers and gradually predict potential hidden dangers and gradually predict potential hidden dangers and gradually predict potential hidden dangers and gradually predict potential hidden dangers. Update hidden danger sequences to output the final potential hidden danger collection and construction risk judgment results.

Benefits of technology

It improves the accuracy and efficiency of construction risk prediction, enables more effective identification and control of construction risks, and enhances the model's knowledge reasoning ability and ability to analyze the correlation of complex hidden dangers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119067459B_ABST
    Figure CN119067459B_ABST
Patent Text Reader

Abstract

The present invention proposes a method and system for predicting engineering construction risks based on Transformer, the method comprising: collecting multimodal data, constructing a hidden danger set including known hidden dangers and a potential hidden danger set including potential hidden dangers based on the multimodal data, embedding the construction risk-hidden danger knowledge graph into the input layer of the Transformer model, and using the Transformer model architecture to build a construction risk prediction model, gradually predicting each potential hidden danger through the model to update the hidden danger sequence, and performing inference prediction in combination with the updated hidden danger sequence to output the final potential hidden danger set and construction risk judgment results. The present invention uses the structured information of the knowledge graph to enhance the model's ability to understand hidden dangers, and also uses the self-attention mechanism and powerful learning ability of the Transformer model to achieve efficient processing and accurate prediction of the hidden danger sequence, thereby improving the accuracy and reliability of construction risk prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of construction risk prediction, and in particular to a Transformer-based engineering construction risk prediction method and system. Background Art

[0002] Construction safety has always been the top priority of project management. With the expansion of construction scale and the increase of complexity, accurately predicting and effectively managing construction risks has become the key to ensuring the smooth progress of the project and the safety of personnel. The construction risk prediction task aims to identify the risk points that may cause safety accidents in advance by analyzing various hidden dangers at the construction site, so as to take preventive measures to reduce the probability of accidents and potential losses.

[0003] At present, the risk prediction of construction projects mainly relies on traditional means such as manual inspection, video surveillance, and sensor monitoring to collect information on known hidden dangers. These methods can detect obvious safety hazards at the construction site to a certain extent, but they have obvious limitations: manual inspection and video surveillance are easily restricted by human factors and environmental conditions, and it is difficult to achieve all-weather and no-dead-angle coverage, resulting in some hidden dangers being missed; the large amount of data collected needs to be manually screened and analyzed, which is not only time-consuming and labor-intensive, but also difficult to respond to risk changes in real time; existing technologies often predict risks based on empirical judgment or simple statistical models, lacking in-depth analysis of the correlation between complex hidden dangers, resulting in low prediction accuracy. Summary of the invention

[0004] Based on this, the purpose of the present invention is to propose a Transformer-based engineering construction risk prediction method and system to solve the above-mentioned problems.

[0005] According to a Transformer-based engineering construction risk prediction method proposed in the present invention, the method includes:

[0006] Real-time collection and pre-processing of multi-modal data during construction;

[0007] Based on the multimodal data, construct a hidden danger set including known hidden dangers and a potential hidden danger set including potential hidden dangers;

[0008] Embed the construction risk-hidden danger knowledge graph into the input layer of the Transformer model, and use the Transformer model architecture to build a construction risk prediction model;

[0009] Based on the input hidden danger set and potential hidden danger set, each potential hidden danger is gradually predicted through the construction risk prediction model to update the hidden danger sequence, and the updated hidden danger sequence is combined for inference prediction to output the final potential hidden danger set and construction risk judgment result.

[0010] Furthermore, the construction risk-hidden danger knowledge graph is embedded into the input layer of the Transformer model, and the construction risk prediction model is constructed using the Transformer model architecture, including:

[0011] Inputting the risk set and the potential risk set into a risk encoder to convert the known risks and potential risks therein into token inputs and generate a risk sequence;

[0012] Construct a construction risk-hidden danger knowledge graph, match and link the entities between the hidden danger sequence and the construction risk-hidden danger knowledge graph, and obtain the corresponding entity embedding;

[0013] The hidden danger sequence output of the hidden danger encoder is fused with the entity embedding using the cross attention mechanism to obtain a fused embedding vector.

[0014] Based on the fused embedding vector, each potential hidden danger is gradually detected in the hidden danger classification layer and the hidden danger detection loss is calculated, and construction risk detection is performed in the construction risk classification layer and the construction risk loss is calculated. The sum of all hidden danger detection losses and construction risk losses is taken as the final training loss, and the model parameters are optimized through back propagation to finally obtain the optimized construction risk prediction model.

[0015] Furthermore, the hidden danger set and the potential hidden danger set are input into a hidden danger encoder to convert the known hidden dangers and potential hidden dangers therein into token inputs and generate a hidden danger sequence, in the steps:

[0016] The hidden danger encoder is a risk detection sequence generation model constructed by using multiple stacked Transformer blocks, wherein each Transformer block contains a feedforward network and a multi-sensor head attention mechanism;

[0017] In each multi-head attention of the Transformer block, set the attention mask.

[0018] Furthermore, in the multi-head attention of each Transformer block, attention masking is set, including:

[0019] In each Transformer block’s multi-head attention, the mutual visibility of queries and keys in self-attention is determined by modifying the attention weights so that each known risk can only see known risks, and each potential risk can see known risks and previously detected potential risks.

[0020] Furthermore, after inputting the hidden danger set and the potential hidden danger set into a hidden danger encoder to convert the known hidden dangers and the potential hidden dangers therein into token inputs with position embedding removed and generating a hidden danger sequence representation, the method further includes:

[0021] After the hidden danger sequence, an [R] sequence of length n+1 is inserted, where n is the number of potential hidden dangers. The [R] sequence contains n [R] tokens for triggering potential hidden danger predictions and one [R] token for predicting an end-inquiry action. The i-th [R] in the [R] sequence is used to trigger the prediction of the i-th potential hidden danger, and the last [R] in the [R] sequence is used to predict an end-inquiry action.

[0022] After the [R] sequence, an [E] token is added to trigger the prediction of construction risks.

[0023] Furthermore, based on the fused embedding vector, each potential hidden danger is gradually detected at the hidden danger classification layer and the hidden danger detection loss is calculated, and construction risk detection is performed at the construction risk classification layer and the construction risk loss is calculated. The sum of all hidden danger detection losses and construction risk losses is used as the final training loss, and the model parameters are optimized through back propagation, and finally an optimized construction risk prediction model is obtained, including:

[0024] Based on the fused embedding vector, using the [R] sequence to learn to generate potential hidden dangers;

[0025] When the i-th [R] token in the [R] sequence is triggered, the i-th potential hidden danger is predicted using the attention weight between the i-th [R] token and the known hidden dangers and the previously predicted potential hidden dangers;

[0026] For each [R] token in the [R] sequence, apply a hidden danger classification layer including linear layer weights to classify the last layer output after processing by the hidden danger encoder, apply a hidden danger classification layer including linear layer weights to classify, convert the classification result into a probability distribution through a softmax function and calculate a cross entropy loss as part of the hidden danger detection loss;

[0027] When the last [R] token in the [R] sequence is triggered, the hidden danger prediction ends and a complete hidden danger sequence is obtained;

[0028] When the [E] token of the hidden danger sequence is triggered, the construction risk classification layer is used to classify all known hidden dangers and predicted potential hidden dangers in the hidden danger sequence, and the classification results are converted into probability distribution through the softmax function and the cross entropy loss is calculated as the construction risk loss;

[0029] The sum of all hidden danger detection losses and construction risk losses is taken as the final training loss. The model parameters are optimized through back propagation, so that the model gradually converges during the training process, and finally the optimized construction risk prediction model is obtained.

[0030] Furthermore, the step of inputting the risk set and the potential risk set into a risk encoder to convert the known risks and potential risks therein into token inputs and generate a risk sequence includes:

[0031] For known hazards and potential hazards in the hazard set and potential hazard set, calculating the input representation of each hazard by summing corresponding token embeddings, hazard state embeddings, and hazard type embeddings, wherein the hazard state includes the presence of a hazard and the absence of a hazard, and the hazard type includes a known hazard and a potential hazard;

[0032] Remove the position embedding and generate a hidden danger sequence based on the input representation of all hidden dangers.

[0033] Furthermore, the construction of the construction risk-hidden danger knowledge graph matches and links the entities between the hidden danger sequence and the construction risk-hidden danger knowledge graph, and obtains the corresponding entity embedding, including:

[0034] Construct a construction risk-hazard knowledge graph and store semantic facts in the form of triples, where the triples represent physical construction risks, physical hazards, and the relationship between them;

[0035] Matching entities in the hidden danger sequence with nodes in the construction risk-hidden danger knowledge graph;

[0036] Based on the matching results, the entities in the hidden danger sequence are linked to corresponding nodes in the construction risk-hidden danger knowledge graph;

[0037] Based on the graph convolutional neural network, the relationship type perception mechanism is introduced to build the RAGCN model;

[0038] Through the RAGCN model, the construction risk-hidden danger knowledge graph is used for information dissemination, aggregation, and relationship type perception to obtain the embedding expression of each node and the corresponding relationship embedding;

[0039] The node embedding and relationship embedding of the entities in the hidden danger sequence are obtained, fused in the joint embedding space, and formed into a matrix to obtain an entity embedding matrix.

[0040] Furthermore, the cross-attention mechanism is used to fuse the hidden danger sequence output of the hidden danger encoder with the entity embedding to obtain a fused embedding vector, including:

[0041] Calculate the similarity between the hidden danger sequence and the entity embedding, obtain a similarity matrix, and scale it;

[0042] Apply the softmax function to the scaled similarity matrix to obtain the normalized weights;

[0043] Perform matrix multiplication of the normalized weights and the current hidden danger sequence to obtain the weighted sequence embedding;

[0044] The weighted sequence embedding is added to the entity embedding to obtain the fused embedding vector.

[0045] The present invention also proposes a Transformer-based engineering construction risk prediction system, the system comprising:

[0046] Acquisition module: used for real-time acquisition and preprocessing of multimodal data during engineering construction;

[0047] A collection module: used for constructing a hidden danger set including known hidden dangers and a potential hidden danger set including potential hidden dangers based on the multimodal data;

[0048] Model building module: used to embed the construction risk-hidden danger knowledge graph into the input layer of the Transformer model, and build a construction risk prediction model using the Transformer model architecture;

[0049] Prediction module: Based on the input hidden danger set and potential hidden danger set, each potential hidden danger is gradually predicted through the construction risk prediction model to update the hidden danger sequence, and perform inference prediction in combination with the updated hidden danger sequence to output the final potential hidden danger set and construction risk judgment result.

[0050] In summary, the Transformer-based engineering construction risk prediction method of the present invention models the engineering construction risk prediction task as a combined task of hidden danger generation and construction risk classification. This generative model can gradually detect potential hidden dangers and predict construction risks based on the hidden dangers. Since the quality of hidden danger prediction directly determines the effect of construction risk classification, by decomposing the problem, the goal is decomposed into the prediction of each potential hidden danger and the prediction of construction risk. In the process of gradually predicting each potential hidden danger and optimizing the hidden danger prediction, the accuracy of construction risk prediction is indirectly improved, so that construction risks can be more effectively identified and controlled in practical applications.

[0051] The construction risk-hidden danger knowledge graph is embedded into the input layer of the Transformer model. The construction risk-hidden danger knowledge graph stores the factual information, semantic relationship information and contextual information of the hidden danger sequence and the corresponding construction risks in a structured manner. The embedding of the knowledge graph enables the Transformer model to have stronger knowledge reasoning capabilities. During the prediction process, it can infer potential hidden dangers and risks based on known hidden danger information to improve the predictability of risk prediction.

[0052] The Transformer model architecture is used to build a risk prediction model. Its self-attention mechanism can process all positions in the input sequence at the same time and capture long-distance dependencies in the sentence. In construction risk prediction, this means that the model can better capture the complex associations and mutual influences between hidden dangers and hidden dangers, and hidden dangers and risk points, thereby improving the accuracy of the prediction.

[0053] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description or will be learned through embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0055] Figure 1 This is a flowchart of a method for predicting engineering construction risks based on Transformer according to the first embodiment of the present invention;

[0056] Figure 2 Another flow chart of a method for predicting engineering construction risks based on Transformer according to the first embodiment of the present invention;

[0057] Figure 3 This is a system block diagram of a Transformer-based engineering construction risk prediction system according to Embodiment 2 of the present invention. DETAILED DESCRIPTION

[0058] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0059] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.

[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0061] Example 1: Please refer to Figure 1 The present invention proposes a method for predicting engineering construction risks based on Transformer, which includes steps S101 to S104:

[0062] S101, real-time collection and pre-processing of multimodal data in the engineering construction process.

[0063] Understandably, multimodal data usually includes but is not limited to the following types: On-site monitoring video: It can provide intuitive pictures of the construction site, which helps to identify visual hazards such as the wearing of safety helmets and protection for working at heights. Sensor data: Such as vibration sensors, pressure sensors, etc., can monitor physical parameters such as structural stability and equipment operating status in real time to detect potential mechanical failures or structural safety hazards. Construction logs and reports: Recording key events, inspection results and corrective measures during the construction process is an important basis for analyzing human factors and management loopholes. Environmental data: Such as temperature, humidity, wind speed, etc., may affect construction safety, especially outdoor operations and high-altitude operations.

[0064] After the multimodal data is collected, it is preprocessed. The preprocessing stage mainly includes data cleaning to remove invalid or erroneous data, data synchronization to ensure the consistency of timestamps of data from different sources, data normalization to convert data of different dimensions to a unified scale, etc., to provide high-quality data input for subsequent analysis.

[0065] S102: constructing a hidden danger set including known hidden dangers and a potential hidden danger set including potential hidden dangers based on the multimodal data.

[0066] Understandably, key information is extracted from multimodal data and two core sets are constructed: a hidden danger set and a potential hidden danger set.

[0067] The known hazards in the hazard set may be safety hazards directly discovered through on-site inspections, video recognition, sensor perception, etc., such as not wearing a safety helmet, improper scaffolding erection, etc. These hazards have been identified and recorded.

[0068] The potential hazards in the potential hazard set may be possible hazards that are estimated based on historical data and expert experience but have not yet been verified, such as foundation settlement, material fatigue, etc., which can then be estimated and verified through subsequent steps.

[0069] S103, embed the construction risk-hidden danger knowledge graph into the input layer of the Transformer model, and use the Transformer model architecture to build a construction risk prediction model.

[0070] It can be understood that the construction risk-hidden danger knowledge graph is embedded into the input layer of the Transformer model. The construction risk-hidden danger knowledge graph is a structured knowledge base, which stores the factual information, semantic relationship information and context information of the hidden danger sequence and the corresponding construction risk of the hidden danger in a structured manner. The embedding of the knowledge graph enables the Transformer model to have stronger knowledge reasoning ability. In the prediction process, it can infer potential hidden dangers and risks based on the known hidden danger information to improve the predictability of risk prediction.

[0071] The Transformer model architecture is used to build a risk prediction model. Its self-attention mechanism can process all positions in the input sequence at the same time and capture long-distance dependencies in the sentence. In construction risk prediction, this means that the model can better capture the complex associations and mutual influences between hidden dangers and hidden dangers, and hidden dangers and risk points, thereby improving the accuracy of predictions.

[0072] S104, based on the input hidden danger set and potential hidden danger set, each potential hidden danger is gradually predicted through the construction risk prediction model to update the hidden danger sequence, and reasoning prediction is performed in combination with the updated hidden danger sequence to output the final potential hidden danger set and construction risk judgment result.

[0073] It can be understood that in the specific reasoning and prediction process, the model first receives a set of hidden dangers and a set of potential hidden dangers, encodes them, and generates an initial hidden danger sequence.

[0074] An [R] sequence is inserted after the hidden danger sequence. Each [R] token in the [R] sequence is used to gradually trigger the prediction of each potential hidden danger, and an [E] token is added after the [R] sequence to trigger the prediction of construction risks.

[0075] Match and link the entities of the hidden danger sequence with the entities of the construction risk-hidden danger knowledge graph, and obtain the corresponding entity embedding. Then, use the cross-attention mechanism to fuse the current hidden danger sequence with the entity embedding to obtain the fused embedding vector.

[0076] Based on the fused embedding vector, the model calculates the probability distribution of all hidden dangers. From the calculated probability distribution, the hidden danger with the highest probability is selected as the currently predicted hidden danger. This hidden danger may be a known hidden danger, a potential hidden danger or an end symbol. If the predicted hidden danger is a known hidden danger or a detected hidden danger, it will be masked (i.e., its impact will not be considered) and the next hidden danger with the highest probability will be queried. If the predicted hidden danger is a potential hidden danger, the user simulator will determine whether the state of the hidden danger is True or False, and insert it into the hidden danger sequence to update the hidden danger sequence. The new hidden danger probability distribution is based on the updated hidden danger sequence. Once the model predicts the end symbol ( ) with a probability greater than the first preset threshold or predicts a potential hidden danger with a probability less than the second preset threshold, the hidden danger prediction is stopped, and the construction risk is predicted and judged based on the complete hidden danger sequence (including all known hidden dangers and predicted potential hidden dangers).

[0077] In construction risk prediction, construction risk categories can be classified, and the model ultimately outputs a complete hidden danger sequence and construction risk judgment results. These results can provide decision support for construction managers and help them take effective risk management measures.

[0078] Based on steps S101 to S104, the construction risk prediction task is modeled as a combined task of hidden danger generation and construction risk classification. This generative model can gradually detect potential hidden dangers and predict construction risks based on the hidden dangers. Since the quality of hidden danger prediction directly determines the effect of construction risk classification, by decomposing the problem, the goal is decomposed into the prediction of each potential hidden danger and the prediction of construction risk. In the process of gradually predicting each potential hidden danger and optimizing the hidden danger prediction, the accuracy of construction risk prediction is indirectly improved, so that construction risks can be more effectively identified and controlled in practical applications.

[0079] The following is a further detailed introduction to a Transformer-based engineering construction risk prediction method according to an embodiment of the present invention:

[0080] Further optional, such as Figure 2 As shown, in step S103, the construction risk-hidden danger knowledge graph is embedded into the input layer of the Transformer model, and the construction risk prediction model is constructed using the Transformer model architecture, including steps S201 to S204:

[0081] S201, inputting the hidden danger set and the potential hidden danger set into a hidden danger encoder to convert the known hidden dangers and potential hidden dangers therein into token inputs, and generating a hidden danger sequence;

[0082] S202, constructing a construction risk-hidden danger knowledge graph, matching and linking entities between the hidden danger sequence and the construction risk-hidden danger knowledge graph, and obtaining corresponding entity embeddings;

[0083] S203, using a cross attention mechanism to fuse the hidden danger sequence output of the hidden danger encoder with the entity embedding to obtain a fused embedding vector;

[0084] S204, based on the fused embedding vector, perform step-by-step detection of each potential hidden danger at the hidden danger classification layer and calculate the hidden danger detection loss, and perform construction risk detection at the construction risk classification layer and calculate the construction risk loss. The sum of all hidden danger detection losses and construction risk losses is taken as the final training loss. The model parameters are optimized through back propagation to finally obtain an optimized construction risk prediction model.

[0085] Based on steps S201 to S204, first, the known hidden danger set and the potential hidden danger set are input into the hidden danger encoder, and these hidden dangers are converted into token form and the corresponding hidden danger sequence is generated. Then, the construction risk-hidden danger knowledge graph is constructed, and the generated hidden danger sequence is accurately matched and linked with the entities in the graph to obtain the corresponding entity embedding representation to enhance the model's ability to understand the complex relationship between hidden dangers. Then, the hidden danger sequence output by the hidden danger encoder is effectively fused with the entity embedding using the cross-attention mechanism to generate a fused embedding vector. Based on this vector, the model performs step-by-step prediction and detection of each potential hidden danger at the hidden danger classification layer, and calculates the hidden danger detection loss in each prediction process respectively; at the same time, the construction risk is predicted and detected at the construction risk classification layer, and the corresponding construction risk loss is calculated. The two parts of the loss are added together as the final loss of the model training, and the model parameters are continuously optimized through the back propagation algorithm until a construction risk prediction model with superior performance and optimization is obtained. This scheme not only makes full use of the structured information of the knowledge graph to enhance the model's ability to understand construction risks, but also realizes efficient processing and accurate prediction of complex hidden danger sequences through the powerful learning ability of the Transformer model. This deep integration strategy not only improves the accuracy and reliability of construction risk prediction, but also provides strong decision-making support for construction safety management.

[0086] Further optionally, in step S201, the hidden danger set and the potential hidden danger set are input into a hidden danger encoder to convert the known hidden dangers and potential hidden dangers therein into token inputs and generate a hidden danger sequence, in which:

[0087] The hidden danger encoder is a risk detection sequence generation model constructed by using multiple stacked Transformer blocks, wherein each Transformer block contains a feedforward network and a multi-sensor head attention mechanism;

[0088] In each multi-head attention of the Transformer block, set the attention mask.

[0089] Understandably, the hidden danger encoder is built with multiple stacked Transformer blocks. Transformer blocks build deep models by stacking multiple identical layers to capture complex features and long-distance dependencies in the input data. Each Transformer block contains two main components: a feedforward network (also known as a forward neural network) and a multi-sensory head attention mechanism (commonly known as multi-head attention). The feedforward network is responsible for processing the local features of each token, while the multi-head attention mechanism is responsible for capturing the global dependencies between tokens. In the Transformer block, all token inputs share parameters through the self-attention mechanism, which means that each token updates its representation based on the importance of other tokens. This mechanism enables the model to handle variable-length inputs and automatically focus on the most relevant parts of the task.

[0090] Attention shielding is set in the multi-head attention mechanism of the Transformer block to control the mutual visibility between each hidden danger. It can prevent the model from allocating too much attention to positions that should not be paid attention to, thereby improving the efficiency and accuracy of the model. Attention shielding can be achieved by modifying the attention weights.

[0091] Further optionally, in the multi-head attention of each Transformer block, setting an attention mask includes:

[0092] In the multi-head attention of each Transformer block, the mutual visibility of queries and keys in self-attention is determined by modifying the attention weights so that each known risk can only see known risks, and each potential risk can see known risks and previously detected potential risks. The specific modifications are as follows:

[0093] ,

[0094] Modify the attention weight according to the attention masking matrix, and the calculation formula is: , where W is the attention weight of the Transformer block, Q, K represent the check and key in the multi-sensor head attention, respectively, and d k is the dimension of the key and M is the attention masking matrix.

[0095] For attention between known hazards, set If both i and j are indices of known hazards

[0096] For the attention of a potential hazard to a known hazard, also set If i is the index of a potential hazard and j is the index of a known hazard

[0097] For the attention of a potential hazard to a previously detected potential hazard, set If both i and j are indices of potential hazards and j < i, i.e., only allowing attention to previous potential hazards

[0098] For all other non - allowed attention cases, set such that after softmax calculation, the attention weight is close to 0

[0099] The attention weight is close to 0, so these positions will not be attended to, while the positions of

[0100] The role of the attention masking matrix in the autoregressive hazard sequence generation is to ensure that the model does not utilize future information when predicting potential hazards, thereby improving the accuracy and fairness of the prediction.

[0101] Further optionally, in another implementation, setting the attention mask in the multi - head attention of each Transformer block further includes:

[0102] Define a parameter matrix, where each element in the parameter matrix corresponds to the weight of a hazard in the attention calculation, and its dimension is the same as the length of the input hazard sequence;

[0103] Randomly initialize the parameter matrix;

[0104] During the model training process, calculate the gradient of the loss function with respect to the parameter matrix through the backpropagation algorithm, and use the optimization algorithm to update the value of the parameter matrix. As the training progresses, the parameter matrix gradually learns the appropriate weights of different hazards in the attention calculation;

[0105] In the multi - head attention mechanism of the Transformer model, modify the original attention calculation process to introduce adaptive attention masking. The specific steps include:

[0106] According to the original input hazard sequence, obtain the query matrix, key matrix, and value matrix through linear transformation;

[0107] Multiplying the parameter matrix by the key matrix to adjust the weight of each hidden danger in the attention calculation to obtain the attention weight of each hidden danger;

[0108] Apply the softmax function to normalize the attention weight of each hidden danger to obtain the attention distribution;

[0109] The value matrix is ​​weightedly summed using the attention distribution to obtain a final attention output.

[0110] It is understandable that this embodiment can also introduce an adaptive attention shielding mechanism into the multi-head attention of the Transformer model to achieve dynamic weight adjustment of different hidden dangers in the attention calculation. As the training proceeds, the gradient of the loss function to the parameter matrix is ​​calculated by the back propagation algorithm, and the value of the parameter matrix is ​​updated by the optimization algorithm, so that the parameter matrix can gradually learn the weights that different hidden dangers should have in the attention calculation, thereby achieving adaptive attention shielding. In the traditional multi-head attention mechanism, the attention weight is calculated based on the similarity of the query matrix and the key matrix. In this scheme, by multiplying the parameter matrix with the key matrix, the weight of each hidden danger in the attention calculation is adjusted. This modification enables the model to more flexibly control the attention to different hidden dangers. The adjusted attention weights are normalized to ensure that the sum of all weights is 1, thereby obtaining an effective attention distribution, which is used to weighted sum the value matrix to obtain the final attention output. In this way, the model can adaptively focus on key information and suppress noise according to the learned weights.

[0111] Further optionally, after step S201, the hidden danger set and the potential hidden danger set are input into a hidden danger encoder to convert the known hidden dangers and potential hidden dangers therein into token inputs with position embedding removed, and after generating a hidden danger sequence representation, the method further includes:

[0112] After the hidden danger sequence, insert an [R] sequence of length n+1, where n is the number of potential hidden dangers, the [R] sequence includes n [R] tokens for triggering potential hidden danger prediction and one [R] token for predicting the end of inquiry action, the i-th [R] in the [R] sequence is used to trigger the prediction of the i-th potential hidden danger, and the last [R] in the [R] sequence is used to predict the end of inquiry action;

[0113] After the [R] sequence, an [E] token is added to trigger the prediction of construction risks.

[0114] It can be understood that by inserting a specific [R] sequence after the hidden danger sequence representation, not only the potential hidden dangers are predicted one by one, but also an additional [R] token is used to trigger the end of the prediction process, that is, the END symbol, to ensure the integrity and orderliness of the hidden danger sequence generation, so that after the model predicts all potential hidden dangers, there is a clear signal to end the generation of the hidden danger sequence, which improves the accuracy and efficiency of the prediction. Furthermore, the [E] token is added after the [R] sequence to trigger the prediction of construction risks after the potential hidden danger prediction is completed.

[0115] Further optionally, in step S201, the hidden danger set and the potential hidden danger set are input into a hidden danger encoder to convert the known hidden dangers and potential hidden dangers therein into token inputs and generate a hidden danger sequence, including:

[0116] For the known hazards and potential hazards in the hazard set and the potential hazard set, the input representation of each hazard is calculated by summing the corresponding token embedding, hazard state embedding and hazard type embedding, wherein the hazard state includes the presence of a hazard and the absence of a hazard, the hazard type includes a known hazard and a potential hazard, the hazard state embedding: [True] indicates that a hazard exists, [False] indicates that a hazard does not exist, the hazard type embedding: [Exp] indicates that the hazard is a known hazard, and [Imp] indicates that the hazard is a potential hazard;

[0117] Remove the position embedding and generate a hidden danger sequence based on the input representation of all hidden dangers.

[0118] It is understandable that, usually, when the Transformer model processes sequence data, position embedding is used to identify the position information of the element in the sequence, but in this embodiment, the position embedding is removed, so as not to limit the prediction order of each potential hidden danger in the hidden danger sequence. Because in the prediction process, the model will calculate the probability distribution of all hidden dangers, and select the hidden danger with the highest probability from the probability distribution as the currently predicted hidden danger. If the predicted hidden danger belongs to one of the potential hidden dangers, it will be inserted into the hidden danger sequence to update the hidden danger sequence. The prediction of each potential hidden danger is not performed in an exact order.

[0119] By combining three types of embeddings - token embedding, hidden danger state embedding and hidden danger type embedding, the input representation of each hidden danger is constructed. This not only retains the basic information of the hidden danger (through token embedding), but also clearly distinguishes the existence status of the hidden danger (through hidden danger state embedding), and further distinguishes whether the hidden danger is known or potential (through hidden danger type embedding). This enables the model to understand and process hidden danger information more accurately, thereby improving the accuracy of hidden danger detection and risk prediction.

[0120] Further optionally, in step S202, the construction risk-hidden danger knowledge graph is constructed, the entities between the hidden danger sequence and the construction risk-hidden danger knowledge graph are matched and linked, and the corresponding entity embedding is obtained, including:

[0121] Construct a construction risk-hazard knowledge graph and store semantic facts in the form of triples, where the triples represent physical construction risks, physical hazards, and the relationship between them;

[0122] Matching entities in the hidden danger sequence with nodes in the construction risk-hidden danger knowledge graph;

[0123] Based on the matching results, the entities in the hidden danger sequence are linked to corresponding nodes in the construction risk-hidden danger knowledge graph;

[0124] Based on the graph convolutional neural network, a relation type perception mechanism is introduced to build the RAGCN (Relation-Aware GCN) model;

[0125] Through the RAGCN model, the construction risk-hidden danger knowledge graph is used for information dissemination, aggregation, and relationship type perception to obtain the embedding expression of each node and the corresponding relationship embedding;

[0126] The node embedding and relationship embedding of the entities in the hidden danger sequence are obtained, fused in the joint embedding space, and formed into a matrix to obtain an entity embedding matrix.

[0127] Understandably, building a knowledge graph is a complex process that requires collecting, organizing and structuring a large amount of construction risk and hidden danger data, but once it is built, it will provide strong factual knowledge support for subsequent analysis and prediction. Matching entities in the hidden danger sequence with nodes in the knowledge graph usually involves string similarity calculation, semantic matching and other technologies. Based on the matching results, the entities in the hidden danger sequence are linked to the corresponding nodes in the knowledge graph, thereby establishing a connection between the hidden danger sequence and the knowledge graph. Introducing a relationship type perception mechanism based on the graph convolutional neural network enables the model to distinguish and process different types of entity relationships, which is crucial for understanding the complex and diverse relationships between construction risks and hidden dangers. The RAGCN model can effectively propagate and integrate information in the knowledge graph, thereby obtaining the embedding expression of each node and the corresponding relationship embedding. These embedding expressions contain the characteristics of the node itself and its contextual information and relationship in-depth understanding in the knowledge graph. The node embedding and relationship embedding of the entity in the hidden danger sequence are fused in the joint embedding space to further integrate information and enhance the model's understanding of the hidden danger sequence. The fused embeddings are combined into a matrix to obtain the entity embedding matrix.

[0128] Further optionally, in step S203, the cross-attention mechanism is used to fuse the hidden danger sequence output of the hidden danger encoder with the entity embedding to obtain a fused embedding vector, including:

[0129] Calculate the similarity between the hidden danger sequence and the entity embedding, obtain a similarity matrix, and scale it;

[0130] Apply the softmax function to the scaled similarity matrix to obtain the normalized weights;

[0131] Perform matrix multiplication of the normalized weights and the current hidden danger sequence to obtain the weighted sequence embedding;

[0132] The weighted sequence embedding is added to the entity embedding to obtain the fused embedding vector.

[0133] It can be understood that by fusing the output of the hidden danger sequence with the entity embedding through the cross-attention mechanism, the model can learn the association between each element in the hidden danger sequence and the entity embedding, so as to have a deeper understanding of the interaction between the hidden dangers and their potential connection with construction risks, so that the model can capture more comprehensive features and improve the accuracy of the prediction.

[0134] Further optionally, in step S204, based on the fused embedding vector, each potential hidden danger is gradually detected at the hidden danger classification layer and the hidden danger detection loss is calculated, and construction risk detection is performed at the construction risk classification layer and the construction risk loss is calculated, the sum of all hidden danger detection losses and construction risk losses is taken as the final training loss, and the model parameters are optimized by back propagation, and finally an optimized construction risk prediction model is obtained, including:

[0135] Based on the fused embedding vector, using the [R] sequence to learn to generate potential hidden dangers;

[0136] When the i-th [R] token in the [R] sequence is triggered, the i-th potential hidden danger is predicted using the attention weight between the i-th [R] token and the known hidden dangers and the previously predicted potential hidden dangers;

[0137] For each [R] token in the [R] sequence, apply a hidden danger classification layer including linear layer weights to classify the last layer output after processing by the hidden danger encoder, apply a hidden danger classification layer including linear layer weights to classify, convert the classification result into a probability distribution through a softmax function and calculate a cross entropy loss as part of the hidden danger detection loss;

[0138] When the last [R] token in the [R] sequence is triggered, the hidden danger prediction ends and a complete hidden danger sequence is obtained;

[0139] When the [E] token of the hidden danger sequence is triggered, the construction risk classification layer is used to classify all known hidden dangers and predicted potential hidden dangers in the hidden danger sequence, and the classification results are converted into probability distribution through the softmax function and the cross entropy loss is calculated as the construction risk loss;

[0140] The sum of all hidden danger detection losses and construction risk losses is taken as the final training loss. The model parameters are optimized through back propagation, so that the model gradually converges during the training process, and finally the optimized construction risk prediction model is obtained.

[0141] It is understandable that by introducing the [R] sequence, potential hazards are predicted one by one. Whenever a [R] token is triggered, the model uses the attention weights between the token and the known hazards and the previously predicted potential hazards to accurately predict the current potential hazards. This mechanism not only enhances the model's ability to capture the complex relationships between hazards, but also improves the accuracy and consistency of hazard prediction. In the process of predicting each potential hazard, a classifier containing linear layer weights is used for classification, and the hazard detection loss is calculated.

[0142] When the [E] token of the hidden danger sequence is triggered, the model will classify all known hidden dangers and predicted potential hidden dangers using the construction risk classification layer and calculate the construction risk loss. This will closely link the hidden danger information with the construction risk, improving the comprehensiveness and accuracy of risk prediction.

[0143] Finally, the sum of all hidden danger detection losses and construction risk losses is taken as the final training loss. The model parameters are optimized through back propagation, so that the model can gradually converge during the training process, and finally an optimized construction risk prediction model is obtained. This model not only has powerful hidden danger detection capabilities, but also can accurately predict construction risks.

[0144] Example 2: Please refer to Figure 3 The present invention proposes a Transformer-based engineering construction risk prediction system, which includes:

[0145] Acquisition module: used for real-time acquisition and preprocessing of multimodal data during engineering construction;

[0146] A collection module: used for constructing a hidden danger set including known hidden dangers and a potential hidden danger set including potential hidden dangers based on the multimodal data;

[0147] Model building module: used to embed the construction risk-hidden danger knowledge graph into the input layer of the Transformer model, and build a construction risk prediction model using the Transformer model architecture;

[0148] Prediction module: based on the input hidden danger set and potential hidden danger set, each potential hidden danger is gradually predicted through the construction risk prediction model to update the hidden danger sequence, and perform inference prediction in combination with the updated hidden danger sequence to output the final potential hidden danger set and construction risk judgment result.

[0149] Optionally, the above model building module is also used to:

[0150] Inputting the risk set and the potential risk set into a risk encoder to convert the known risks and potential risks therein into token inputs and generate a risk sequence;

[0151] Construct a construction risk-hidden danger knowledge graph, match and link the entities between the hidden danger sequence and the construction risk-hidden danger knowledge graph, and obtain the corresponding entity embedding;

[0152] The hidden danger sequence output of the hidden danger encoder is fused with the entity embedding using the cross attention mechanism to obtain a fused embedding vector.

[0153] Based on the fused embedding vector, each potential hidden danger is gradually detected in the hidden danger classification layer and the hidden danger detection loss is calculated, and construction risk detection is performed in the construction risk classification layer and the construction risk loss is calculated. The sum of all hidden danger detection losses and construction risk losses is taken as the final training loss, and the model parameters are optimized through back propagation to finally obtain the optimized construction risk prediction model.

[0154] Optionally, the above model building module is also used to:

[0155] The hidden danger encoder is a risk detection sequence generation model constructed by using multiple stacked Transformer blocks, wherein each Transformer block contains a feedforward network and a multi-sensor head attention mechanism;

[0156] In each multi-head attention of the Transformer block, set the attention mask.

[0157] Optionally, the above model building module is also used to:

[0158] In each Transformer block’s multi-head attention, the mutual visibility of queries and keys in self-attention is determined by modifying the attention weights so that each known risk can only see known risks, and each potential risk can see known risks and previously detected potential risks.

[0159] Optionally, the above model building module is also used to:

[0160] After the hidden danger sequence, an [R] sequence of length n+1 is inserted, where n is the number of potential hidden dangers. The [R] sequence contains n [R] tokens for triggering potential hidden danger predictions and one [R] token for predicting an end-inquiry action. The i-th [R] in the [R] sequence is used to trigger the prediction of the i-th potential hidden danger, and the last [R] in the [R] sequence is used to predict an end-inquiry action.

[0161] After the [R] sequence, an [E] token is added to trigger the prediction of construction risks.

[0162] Optionally, the above model building module is also used to:

[0163] Based on the fused embedding vector, using the [R] sequence to learn to generate potential hidden dangers;

[0164] When the i-th [R] token in the [R] sequence is triggered, the i-th potential hidden danger is predicted using the attention weight between the i-th [R] token and the known hidden dangers and the previously predicted potential hidden dangers;

[0165] For each [R] token in the [R] sequence, apply a hidden danger classification layer including linear layer weights to classify the last layer output after processing by the hidden danger encoder, apply a hidden danger classification layer including linear layer weights to classify, convert the classification result into a probability distribution through a softmax function and calculate a cross entropy loss as part of the hidden danger detection loss;

[0166] When the last [R] token in the [R] sequence is triggered, the hidden danger prediction ends and a complete hidden danger sequence is obtained;

[0167] When the [E] token of the hidden danger sequence is triggered, the construction risk classification layer is used to classify all known hidden dangers and predicted potential hidden dangers in the hidden danger sequence, and the classification results are converted into probability distribution through the softmax function and the cross entropy loss is calculated as the construction risk loss;

[0168] The sum of all hidden danger detection losses and construction risk losses is taken as the final training loss. The model parameters are optimized through back propagation, so that the model gradually converges during the training process, and finally the optimized construction risk prediction model is obtained.

[0169] Optionally, the above model building module is also used to:

[0170] For known hazards and potential hazards in the hazard set and potential hazard set, calculating an input representation of each hazard by summing corresponding token embeddings, hazard state embeddings, and hazard type embeddings;

[0171] Remove the position embedding and generate a hidden danger sequence based on the input representation of all hidden dangers.

[0172] Optionally, the above model building module is also used to:

[0173] Construct a construction risk-hazard knowledge graph and store semantic facts in the form of triples, where the triples represent physical construction risks, physical hazards, and the relationship between them;

[0174] Matching entities in the hidden danger sequence with nodes in the construction risk-hidden danger knowledge graph;

[0175] Based on the matching results, the entities in the hidden danger sequence are linked to corresponding nodes in the construction risk-hidden danger knowledge graph;

[0176] Based on the graph convolutional neural network, the relationship type perception mechanism is introduced to build the RAGCN model;

[0177] Through the RAGCN model, the construction risk-hidden danger knowledge graph is used for information dissemination, aggregation, and relationship type perception to obtain the embedding expression of each node and the corresponding relationship embedding;

[0178] The node embedding and relationship embedding of the entities in the hidden danger sequence are obtained, fused in the joint embedding space, and formed into a matrix to obtain an entity embedding matrix.

[0179] Optionally, the above model building module is also used to:

[0180] Calculate the similarity between the hidden danger sequence and the entity embedding, obtain a similarity matrix, and scale it;

[0181] Apply the softmax function to the scaled similarity matrix to obtain the normalized weights;

[0182] Perform matrix multiplication of the normalized weights and the current hidden danger sequence to obtain the weighted sequence embedding;

[0183] The weighted sequence embedding is added to the entity embedding to obtain the fused embedding vector.

[0184] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A Transformer-based engineering construction risk prediction method, characterized in that: The method comprises: Real-time collection and pre-processing of multi-modal data during construction; Based on the multimodal data, construct a hidden danger set including known hidden dangers and a potential hidden danger set including potential hidden dangers; Embed the construction risk-hidden danger knowledge graph into the input layer of the Transformer model, and use the Transformer model architecture to build a construction risk prediction model; Based on the input hidden danger set and potential hidden danger set, each potential hidden danger is gradually predicted by the construction risk prediction model to update the hidden danger sequence, and reasoning prediction is performed in combination with the updated hidden danger sequence to output the final potential hidden danger set and construction risk judgment result; The construction risk-hidden danger knowledge graph is embedded into the input layer of the Transformer model, and the construction risk prediction model is constructed using the Transformer model architecture, including: Inputting the risk set and the potential risk set into a risk encoder to convert the known risks and potential risks therein into token inputs and generate a risk sequence; Construct a construction risk-hidden danger knowledge graph, match and link the entities between the hidden danger sequence and the construction risk-hidden danger knowledge graph, and obtain the corresponding entity embedding; The hidden danger sequence output of the hidden danger encoder is fused with the entity embedding using the cross attention mechanism to obtain a fused embedding vector. Based on the fused embedding vector, each potential hidden danger is gradually detected at the hidden danger classification layer and the hidden danger detection loss is calculated, and construction risk detection is performed at the construction risk classification layer and the construction risk loss is calculated. The sum of all hidden danger detection losses and construction risk losses is used as the final training loss, and the model parameters are optimized through back propagation to finally obtain an optimized construction risk prediction model; After inputting the risk set and the potential risk set into a risk encoder to convert the known risks and potential risks therein into token inputs and generating a risk sequence, the method further includes: After the hidden danger sequence, insert an [R] sequence of length n+1, where n is the number of potential hidden dangers, the [R] sequence includes n [R] tokens for triggering potential hidden danger prediction and one [R] token for predicting the end of inquiry action, the i-th [R] in the [R] sequence is used to trigger the prediction of the i-th potential hidden danger, and the last [R] in the [R] sequence is used to predict the end of inquiry action; After the [R] sequence, an [E] token is added to trigger the prediction of construction risks; Based on the fused embedding vector, each potential hidden danger is gradually detected at the hidden danger classification layer and the hidden danger detection loss is calculated, and construction risk detection is performed at the construction risk classification layer and the construction risk loss is calculated. The sum of all hidden danger detection losses and construction risk losses is used as the final training loss, and the model parameters are optimized by back propagation to finally obtain an optimized construction risk prediction model, including: Based on the fused embedding vector, using the [R] sequence to learn to generate potential hidden dangers; When the i-th [R] token in the [R] sequence is triggered, the i-th potential hidden danger is predicted using the attention weight between the i-th [R] token and the known hidden dangers and the previously predicted potential hidden dangers; For each [R] token in the [R] sequence, apply a hidden danger classification layer including linear layer weights to classify the last layer output after processing by the hidden danger encoder, apply a hidden danger classification layer including linear layer weights to classify, convert the classification result into a probability distribution through a softmax function and calculate a cross entropy loss as part of the hidden danger detection loss; When the last [R] token in the [R] sequence is triggered, the hidden danger prediction ends and a complete hidden danger sequence is obtained; When the [E] token of the hidden danger sequence is triggered, the construction risk classification layer is used to classify all known hidden dangers and predicted potential hidden dangers in the hidden danger sequence, and the classification results are converted into probability distribution through the softmax function and the cross entropy loss is calculated as the construction risk loss; The sum of all hidden danger detection losses and construction risk losses is taken as the final training loss. The model parameters are optimized through back propagation, so that the model gradually converges during the training process, and finally an optimized construction risk prediction model is obtained; The construction risk-hidden danger knowledge graph is constructed, and entities between the hidden danger sequence and the construction risk-hidden danger knowledge graph are matched and linked, and corresponding entity embeddings are obtained, including: Construct a construction risk-hazard knowledge graph and store semantic facts in the form of triples, where the triples represent physical construction risks, physical hazards, and the relationship between them; Matching entities in the hidden danger sequence with nodes in the construction risk-hidden danger knowledge graph; Based on the matching results, the entities in the hidden danger sequence are linked to corresponding nodes in the construction risk-hidden danger knowledge graph; Based on the graph convolutional neural network, the relationship type perception mechanism is introduced to build the RAGCN model; Through the RAGCN model, the construction risk-hidden danger knowledge graph is used for information dissemination, aggregation, and relationship type perception to obtain the embedding expression of each node and the corresponding relationship embedding; The node embedding and relationship embedding of the entities in the hidden danger sequence are obtained, fused in the joint embedding space, and formed into a matrix to obtain an entity embedding matrix.

2. The engineering construction risk prediction method based on Transformer according to claim 1 is characterized in that: The step of inputting the hidden danger set and the potential hidden danger set into a hidden danger encoder to convert the known hidden dangers and potential hidden dangers therein into token inputs and generate a hidden danger sequence, wherein: The hidden danger encoder is a risk detection sequence generation model constructed by using multiple stacked Transformer blocks, wherein each Transformer block contains a feedforward network and a multi-sensor head attention mechanism; In each multi-head attention of the Transformer block, set the attention mask.

3. The engineering construction risk prediction method based on Transformer according to claim 2 is characterized in that: In each multi-head attention of the Transformer block, an attention mask is set, including: In each Transformer block’s multi-head attention, the mutual visibility of queries and keys in self-attention is determined by modifying the attention weights so that each known risk can only see known risks, and each potential risk can see known risks and previously detected potential risks.

4. The Transformer-based engineering construction risk prediction method according to claim 1 is characterized in that: The step of inputting the risk set and the potential risk set into a risk encoder to convert the known risks and potential risks therein into token inputs and generate a risk sequence includes: For known hazards and potential hazards in the hazard set and potential hazard set, calculating the input representation of each hazard by summing corresponding token embeddings, hazard state embeddings, and hazard type embeddings, wherein the hazard state includes the presence of a hazard and the absence of a hazard, and the hazard type includes a known hazard and a potential hazard; Remove the position embedding and generate a hidden danger sequence based on the input representation of all hidden dangers.

5. The Transformer-based engineering construction risk prediction method according to claim 1 is characterized in that: The cross-attention mechanism is used to fuse the hidden danger sequence output of the hidden danger encoder with the entity embedding to obtain a fused embedding vector, including: Calculate the similarity between the hidden danger sequence and the entity embedding, obtain a similarity matrix, and scale it; Apply the softmax function to the scaled similarity matrix to obtain the normalized weights; Perform matrix multiplication of the normalized weights and the current hidden danger sequence to obtain the weighted sequence embedding; The weighted sequence embedding is added to the entity embedding to obtain the fused embedding vector.

6. A Transformer-based engineering construction risk prediction system, characterized in that: The system comprises: Acquisition module: used for real-time acquisition and preprocessing of multimodal data during engineering construction; A collection module: used for constructing a hidden danger set including known hidden dangers and a potential hidden danger set including potential hidden dangers based on the multimodal data; Model building module: used to embed the construction risk-hidden danger knowledge graph into the input layer of the Transformer model, and build a construction risk prediction model using the Transformer model architecture; Prediction module: used to gradually predict each potential hazard based on the input hazard set and potential hazard set through the construction risk prediction model to update the hazard sequence, and perform inference prediction in combination with the updated hazard sequence to output the final potential hazard set and construction risk judgment result; Wherein, the model building module is also used for: Inputting the risk set and the potential risk set into a risk encoder to convert the known risks and potential risks therein into token inputs and generate a risk sequence; Construct a construction risk-hidden danger knowledge graph, match and link the entities between the hidden danger sequence and the construction risk-hidden danger knowledge graph, and obtain the corresponding entity embedding; The hidden danger sequence output of the hidden danger encoder is fused with the entity embedding using the cross attention mechanism to obtain a fused embedding vector. Based on the fused embedding vector, each potential hidden danger is gradually detected at the hidden danger classification layer and the hidden danger detection loss is calculated, and construction risk detection is performed at the construction risk classification layer and the construction risk loss is calculated. The sum of all hidden danger detection losses and construction risk losses is used as the final training loss, and the model parameters are optimized through back propagation to finally obtain an optimized construction risk prediction model; The model building module is also used to: After the hidden danger sequence, insert an [R] sequence of length n+1, where n is the number of potential hidden dangers, the [R] sequence includes n [R] tokens for triggering potential hidden danger prediction and one [R] token for predicting the end of inquiry action, the i-th [R] in the [R] sequence is used to trigger the prediction of the i-th potential hidden danger, and the last [R] in the [R] sequence is used to predict the end of inquiry action; After the [R] sequence, an [E] token is added to trigger the prediction of construction risks; The model building module is also used to: Based on the fused embedding vector, using the [R] sequence to learn to generate potential hidden dangers; When the i-th [R] token in the [R] sequence is triggered, the i-th potential hidden danger is predicted using the attention weight between the i-th [R] token and the known hidden dangers and the previously predicted potential hidden dangers; For each [R] token in the [R] sequence, apply a hidden danger classification layer including linear layer weights to classify the last layer output after processing by the hidden danger encoder, apply a hidden danger classification layer including linear layer weights to classify, convert the classification result into a probability distribution through a softmax function and calculate a cross entropy loss as part of the hidden danger detection loss; When the last [R] token in the [R] sequence is triggered, the hidden danger prediction ends and a complete hidden danger sequence is obtained; When the [E] token of the hidden danger sequence is triggered, the construction risk classification layer is used to classify all known hidden dangers and predicted potential hidden dangers in the hidden danger sequence, and the classification results are converted into probability distribution through the softmax function and the cross entropy loss is calculated as the construction risk loss; The sum of all hidden danger detection losses and construction risk losses is taken as the final training loss. The model parameters are optimized through back propagation, so that the model gradually converges during the training process, and finally an optimized construction risk prediction model is obtained; The model building module is also used to: Construct a construction risk-hazard knowledge graph and store semantic facts in the form of triples, where the triples represent physical construction risks, physical hazards, and the relationship between them; Matching entities in the hidden danger sequence with nodes in the construction risk-hidden danger knowledge graph; Based on the matching results, the entities in the hidden danger sequence are linked to corresponding nodes in the construction risk-hidden danger knowledge graph; Based on the graph convolutional neural network, the relationship type perception mechanism is introduced to build the RAGCN model; Through the RAGCN model, the construction risk-hidden danger knowledge graph is used for information dissemination, aggregation, and relationship type perception to obtain the embedding expression of each node and the corresponding relationship embedding; The node embedding and relationship embedding of the entities in the hidden danger sequence are obtained, fused in the joint embedding space, and formed into a matrix to obtain an entity embedding matrix.

Citation Information

Patent Citations

  • Automatic driving model, training method, automatic driving method and vehicle

    CN116880462A

  • Chemical enterprise hidden danger prediction method and system based on graph neural network

    CN118428745A