Tunnel fire accident classification method, system and equipment based on graph neural network, and medium
Through the tunnel fire accident classification method based on graph neural network, the problem of low classification accuracy and robustness in the prior art is solved, and more efficient tunnel fire accident image processing and classification effects are achieved.
Patent Information
- Application Number
- CN202510304931.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-06-27
AI Technical Summary
In the prior art, the classification accuracy and robustness of tunnel fire accidents are low, making it difficult to effectively deal with complex correlation spatio-temporal data.
The tunnel fire accident classification method based on graph neural network is adopted, and the graph fire accident classification method is preprocessed by pre-processing the collected field images, and the graph convolutional network and deep neural network are used for feature extraction and classification model training. The method includes randomly dividing image datasets, building preliminary models, conducting supervised learning and performance evaluation to ensure the accuracy and reliability of the model.
It improves the accuracy and robustness of tunnel fire accident classification, can process complex image data more effectively, reduce the missed and false alarm rates of traditional monitoring systems, and improves the fire recognition rate and emergency response time.
Smart Images

Figure CN120219841A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image classification, and particularly relates to a tunnel fire accident classification method, system, device and medium based on a graph neural network. Background Art
[0002] In recent years, the scale, quantity and construction speed of highway tunnels have achieved unprecedented breakthrough development. While providing convenience for people's travel, the complex structure and enclosed space of highway tunnels increase the potential threat of tunnel fire accidents. Once a tunnel fire accident occurs, it is likely to cause a large number of casualties and serious property losses, resulting in immeasurable social impacts. Therefore, the risk assessment of tunnel fires is of extremely important significance. Previous tunnel fire accident classifications mainly relied on rule engines based on expert experience and classification models driven by big data and machine learning. However, tunnel fire accidents usually involve multiple factors and require processing a large amount of complex correlated spatio-temporal data, and traditional classification methods are difficult to provide sufficient accuracy and robustness.
[0003] With the development of artificial intelligence, deep learning methods have achieved explosive development in various fields, and have also achieved increasingly remarkable results in the field of image recognition and classification. Due to the complexity of tunnel fire accidents and the correlation of multi-dimensional data, the graph neural network method has gradually become an important research direction in tunnel fire accident classification and has received extensive attention based on its advantages in processing graph structure data.
[0004] Due to the development of existing technologies, the monitoring data of tunnel fire accidents is becoming increasingly rich. Currently, existing technologies basically rely solely on images for the monitoring of fire accidents, resulting in low classification accuracy and robustness. Summary of the Invention
[0005] The purpose of the present invention is to provide a tunnel fire accident classification method, system, device and medium based on a graph neural network, which solves the problem of low classification accuracy and robustness.
[0006] The present invention is realized through the following technical solutions: The present invention discloses a tunnel fire accident classification method based on a graph neural network, including the following processes: Collect on-site images of tunnel fire accidents, preprocess the on-site images to obtain preprocessed images; Input the preprocessed images into the constructed tunnel fire accident classification model, and output the tunnel fire accident classification results; The construction process of the tunnel fire accident classification model specifically includes the following steps: S1. Collect an image dataset of tunnel fire accidents of different types, randomly partition the image dataset to obtain a first image dataset, a second image dataset, and a third image dataset; S2. Construct a preliminary graph neural network classification model based on the first image dataset; S3. Perform supervised learning on the neural network classification model constructed from the first dataset according to the second image dataset to obtain a target graph neural network classification model; S4. Perform performance evaluation on the target graph neural network classification model according to the third image dataset to obtain an evaluation result; until the evaluation result determines that the target graph neural network classification model meets the preset performance indicators, a constructed tunnel fire accident classification model is obtained.
[0007] Further, preprocess the on-site images. The preprocessing specifically includes image denoising, image enhancement, color space conversion, edge detection, and data augmentation performed in sequence.
[0008] Further, S2 includes the following sub-steps: Step 1. Perform image preprocessing on the first image dataset to obtain preprocessed images; Step 2. Perform image conversion on the preprocessed images to obtain a graph structure. The specific process is as follows: Perform image segmentation on the preprocessed images to obtain multiple region segmentation images of the same size; each region segmentation image is regarded as a graph node, and the spatial position and feature similarity of the image pixels are used as the edge set to connect the nodes, and a graph structure is constructed according to the graph nodes and the edge set; Perform multi-scale feature description on each graph structure to obtain feature vectors; Step 3. Use a convolutional neural network for the current scale to process its corresponding graph structure and extract spatial features; Use a deep neural network to process the feature vectors at the previous scale to obtain abstract features, and splice the spatial features and the abstract features to obtain the node features at the current scale; Step 4. Calculate the Euclidean distance between two node features at the same scale and transform it through a Gaussian function to obtain a similarity weight based on feature similarity; Adjust the similarity weight based on feature similarity according to the relationship weight of the prior knowledge between different node types to obtain a more accurate similarity weight; Step 5. Apply a high-order graph convolution process to each node to expand the range of the current node's neighbors, so as to aggregate information from nodes at a farther distance, converge various sensor information, and update the node features of the nodes; Step 6: Based on the attention mechanism, dynamically adjust the weights of information aggregation according to the importance of neighbor nodes, and calculate the weighted features of each updated node when aggregating the information of neighbor nodes; aggregate the weighted features through a dynamic aggregation function to form a new node feature representation; Step 7: Process the new node feature representation of each node based on the hierarchical graph neural network, and this node feature representation will be passed to the classification layer; The classification layer maps the final features of the nodes to a spatial score of a category through a weight matrix and bias parameters, and finally passes through The function converts the spatial score into a normalized probability distribution to obtain the preliminary graph neural network classification model constructed from the first image dataset.
[0009] Furthermore, Step 3 is specifically as follows: Use the graph structure For convolutional neural network operations to obtain the spatial features of this node at the current scale; where is the set of nodes, is the set of edges; Then use a deep neural network to process the feature vector at the previous scale to obtain the abstract features of the current node; Use the following formula to concatenate the spatial features and the abstract features to obtain the node features at the current scale:
[0010] where is the node feature of node at scale , is the convolutional neural network at scale , is the deep neural network at scale , represents the concatenation operation, is the node feature of node at scale , is node corresponding pixel region or image patch.
[0011] Furthermore, in Step 4, the expression for calculating the Euclidean distance between two nodes is:
[0012] where is the Euclidean distance of the node features between node and node , is the scale at which the node feature of node is located, is the scale lower node of the node features; k = 1, 2... d, where k represents the number of layers of the graph neural network; After that, the similarity weight based on feature similarity is calculated through the following Gaussian function conversion formula:
[0013] where, is the scale lower node and node of the similarity weight; is the standard deviation of the Gaussian distribution, which controls the influence degree of distance on the weight; is the natural exponential function.
[0014] Furthermore, S3 is specifically as follows: Input the second image dataset into the preliminary graph neural network classification model, perform image preprocessing and graph structure conversion on the second image dataset, and then obtain the tunnel fire accident image classification result of the second image dataset output by the preliminary graph neural network classification model through forward propagation, as the predicted tunnel fire accident type; Calculate the cross-entropy loss function according to the true tunnel fire accident type and the predicted tunnel fire accident type of the second image dataset. According to the calculated loss, calculate the gradient through the backpropagation algorithm, and adjust the model parameter values of the preliminary graph neural network classification model according to these gradients to obtain the target graph neural network classification model.
[0015] Furthermore, S4 is specifically as follows: Input the third image dataset into the target graph neural network classification model, output the tunnel fire accident image classification result of the third image dataset, compare it with the true tunnel fire accident type corresponding to the third image dataset, and evaluate the performance metrics of the target graph neural network classification model; when all evaluation metrics meet the preset requirements, the target graph neural network classification model is qualified.
[0016] The present invention also discloses a tunnel fire accident classification system based on a graph neural network, including: A data acquisition module for collecting on-site images of tunnel fire accidents; An image preprocessing module for preprocessing the on-site images to obtain preprocessed images; An accident classification module for inputting the graph structure into the constructed tunnel fire accident classification model and outputting the tunnel fire accident classification result; The construction process of the tunnel fire accident classification model specifically includes the following steps: S1. Collect an image dataset of tunnel fire accidents of different types, randomly divide the image dataset to obtain a first image dataset, a second image dataset, and a third image dataset; S2. Construct a preliminary graph neural network classification model based on the first image dataset; S3. Perform supervised learning on the neural network classification model constructed from the first dataset according to the second image dataset to obtain a target graph neural network classification model; S4. Perform performance evaluation on the target graph neural network classification model according to the third image dataset to obtain an evaluation result; until the evaluation result determines that the target graph neural network classification model meets the preset performance indicators, the constructed tunnel fire accident classification model is obtained.
[0017] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the tunnel fire accident classification method based on the graph neural network is implemented.
[0018] The present invention also discloses a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the tunnel fire accident classification method based on the graph neural network is implemented.
[0019] Compared with the prior art, the present invention has the following beneficial technical effects: The present invention discloses a tunnel fire accident classification method based on a graph neural network. First, preprocess the collected tunnel fire accident scene images, which can improve the image quality, reduce the interference of factors such as noise and uneven illumination on subsequent analysis, make the image features more prominent, and help improve the accuracy of the classification model. At the model construction and training level, the image dataset is randomly divided into three subsets, ensuring the randomness and similarity of the data distribution of each subset, and avoiding model training deviation caused by uneven data division. Different subsets perform different functions. The first image dataset is used to construct a preliminary model to lay a foundation for subsequent training; the second image dataset is used for supervised learning to optimize the model in the correct classification direction; the third image dataset is used for performance evaluation to ensure that the model meets the actual application requirements.
[0020] Supervised learning is performed on the preliminary graph neural network classification model based on the second image dataset, which can continuously adjust the model parameters using the known label information, enabling the model to learn the mapping relationship between the features and labels of different types of tunnel fire accident images, thereby improving the accuracy and reliability of model classification. Performance evaluation of the target graph neural network classification model using the third image dataset can promptly identify deficiencies in the model, such as overfitting, underfitting, etc. Only when the evaluation results meet the preset performance indicators is it determined that the model construction is complete, which ensures the effectiveness and stability of the final model in actual tunnel fire accident classification tasks and enhances its application value in real scenarios.
[0021] Through the structured modeling and feature learning of the graph neural network method, the present invention can fully grasp the spatial correlation and complex features in tunnel fire accident images; compared with traditional fire monitoring methods based on manual observation and rules, the automated fire accident classification model based on the graph neural network method can effectively reduce the false negative rate and false positive rate of traditional monitoring systems, improve the fire recognition rate, and reduce the emergency response time.
[0022] Furthermore, when constructing the preliminary graph neural network classification model, data from multiple sensors is integrated to enhance the model's adaptability to complex tunnel fire scenarios; combined with multi-scale feature extraction and attention mechanism, the present invention can dynamically assign importance weights to neighbor nodes, enhance the extraction of local key features of tunnel fire accidents, and for complex backgrounds of different fire types (such as light changes, smoke occlusion), can adaptively adjust the aggregation strategy without strict predefined fire scenarios, and the present invention is applicable to diverse tunnel fire scenarios. Brief Description of the Drawings
[0023] Figure 1 It is a flowchart of a method for classifying tunnel fire accidents based on a graph neural network according to the present invention; Figure 2 It is a block diagram of a system for classifying tunnel fire accidents based on a graph neural network. Detailed Embodiment
[0024] In order to make the objectives, technical solutions and advantages of the present invention clearer, the following further detailed description is provided in conjunction with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention, that is, the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments.
[0025] The detailed description of the embodiments of the present invention provided in the following drawings is not intended to limit the scope of the claimed invention, but merely represents a selected embodiment of the present invention. Based on the drawings and embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present invention.
[0026] It should be noted that the term "comprising", "including" or any other variant is intended to cover non-exclusive inclusion, so that a process, element, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or also includes elements inherent in the process, element, method, article or device.
[0027] The features and performance of the present invention will be further described in detail below in conjunction with embodiments.
[0028] Embodiment 1 The present invention discloses a method for constructing a tunnel fire accident classification model based on a graph neural network, which includes the following steps: S1. Collect an image data set with different types of tunnel fire accidents, and randomly divide the image data set to obtain a first image data set, a second image data set, and a third image data set; S2. Construct a preliminary graph neural network classification model based on the first image data set; S3. Perform supervised learning on the neural network classification model constructed from the first data set according to the second image data set to obtain a target graph neural network classification model; S4. Perform performance evaluation on the target graph neural network classification model according to the third image data set to obtain an evaluation result; determine that the target graph neural network classification model meets the preset performance index according to the evaluation result.
[0029] Embodiment 2 In S2, constructing a preliminary graph neural network classification model based on the first image data set specifically includes the following sub-steps: Step 1: Perform image preprocessing on the obtained first image data set to obtain a preprocessed data set; Among them, the preprocessing steps successively include: image denoising, image enhancement, color space conversion (graying), edge detection, and data enhancement; Step 2: Perform image segmentation on the preprocessed data set obtained from the first image data set to obtain multiple region segmentation images of a unified size; Among them, the region segmentation image includes a feature primitive data set of a tunnel fire accident in any image; each region of a frame of image is defined as a node of a graph, and each node is described by its multi-scale features in the tunnel fire accident image; Based on spatial proximity, the relationships between adjacent nodes in an image frame define edges, and the image data in the preprocessed first image dataset is converted into a graph structure.
[0030] Step 3: For each node in the graph structure, considering that different features of tunnel fires (such as flames, smoke, heat sources, etc.) may appear at different scales, first use a graph convolutional neural network for the current scale to process its corresponding pixel segmentation or predefined region to extract spatial features; then, use a deep neural network (another CNN or other forms of deep learning models) to process the feature vectors at the previous scale to obtain abstract features, and concatenate the spatial features and abstract features to obtain the node features at the current scale. Step 4: Calculate the Euclidean distance between the node features of two nodes at the same scale, and transform it through a Gaussian function to obtain the similarity weight based on feature similarity. Adjust the similarity weight based on feature similarity according to the relationship weight of prior knowledge between different node types to obtain the final similarity weight. Step 5: Apply a high-order graph convolution process to each node to expand the range of the current node's neighbors, so as to aggregate information from nodes at farther distances, converge information from multiple sensors (temperature, smoke, gas, etc.), and update the node features of the nodes. Step 6: Based on the attention mechanism, dynamically adjust the weight of information aggregation according to the importance of neighbor nodes, calculate the weighted features of each node when aggregating neighbor node information; aggregate the weighted features through a dynamic aggregation function to form a new node feature representation. Step 7: Process the new node feature representation of each node based on the hierarchical graph neural network (HGNN), and this node feature representation will be passed to the classification layer. The classification layer maps the final features of the nodes to a spatial score of a category through a weight matrix and bias parameters, and finally converts the spatial score into a normalized probability distribution through a function; thus, a preliminary graph neural network classification model constructed from the first image dataset is obtained.
[0031] This idea constructs an end-to-end graph neural network classification framework through graph structure modeling, multi-scale feature fusion, high-order information aggregation, and dynamic attention mechanism. Its core innovation lies in combining data-driven and prior knowledge, and enhancing the model's expressive ability through hierarchical processing. In practical applications, details need to be optimized for specific tasks (such as segmentation methods, modality fusion strategies), and the computational efficiency and accuracy need to be balanced.
[0032] Converting the preprocessed image into a graph structure can utilize the powerful ability of graph neural networks to process non-Euclidean data. The graph structure can better capture the topological relationships and semantic associations between elements in the image, providing richer and more effective information for the model compared to traditional pixel-based processing methods. For example, in tunnel fire images, the spatial positions and interrelationships between objects such as flames, smoke, and vehicles can be clearly represented by the graph structure, enabling more accurate classification.
[0033] Embodiment 3 In S3, the construction process of the target graph neural network classification model is specifically as follows: Input the second image dataset into the preliminary graph neural network classification model, perform image preprocessing and graph structure conversion on the second image dataset, and then obtain the tunnel fire accident image classification result of the second image dataset output by the preliminary graph neural network classification model through forward propagation as the predicted tunnel fire accident type; Calculate the cross-entropy loss function based on the true tunnel fire accident type and the predicted tunnel fire accident type of the second image dataset. According to the calculated loss, calculate the gradients through the backpropagation algorithm, and adjust the model parameter values (weight matrix and bias term) of the preliminary graph neural network classification model based on these gradients to obtain the target graph neural network classification model.
[0034] In S4, evaluate the performance of the target graph neural network classification model based on the third image dataset to obtain the evaluation result, specifically: Input the third image dataset into the target graph neural network classification model, output the tunnel fire accident image classification result of the third image dataset, and compare it with the true tunnel fire accident type corresponding to the third image dataset to evaluate performance indicators such as the classification accuracy and classification precision of the target graph neural network classification model.
[0035] Embodiment 4 On the basis of Embodiment 2, introduce the relevant sub-step content.
[0036] Furthermore, in step 2, the expression of the constructed graph structure is , where is the set of nodes, is the set of edges, represents a node in the graph, represents node and node belong to the same edge in the graph.
[0037] In addition, the node in the graph has a feature vector, and the matrix is required to store the feature vectors of the graph nodes, and the dimension of the feature vectors is , .
[0038] Next, input the adjacency matrix into the graph convolutional layer, denoted as: , and the matrix element represents the edge from vertex to . The magnitude of represents the weight of the edge, represents that there is an edge connection between node and node , otherwise ; for an undirected graph (weights defined by feature similarity (such as Euclidean distance)), the adjacency matrix is a symmetric matrix, where is the number of nodes in the graph. For a directed graph (asymmetric between nodes in the image), . The degree matrix is a diagonal matrix representing the degree of each node in the graph, denoted as , that is, the elements on the diagonal are all 1 and the rest are 0. The degree of vertex represents the number of edges associated with that vertex.
[0039] Furthermore, in step 3, the graph structure is used for convolutional neural network operations to obtain the spatial features of the node at the current scale. Then, the feature vector at the previous scale is processed by a deep neural network to obtain the abstract features of the current node. Using the following formula, the spatial features and abstract features are concatenated to obtain the node features at the current scale:
[0040] where, is the node feature of node at scale , is the convolutional neural network at scale , is the deep neural network at scale , represents the concatenation operation, is the node feature of node at scale , is the pixel region or image patch corresponding to node .
[0041] Furthermore, step 4 uses the following formula to calculate the Euclidean distance between two nodes:
[0042] Among them, is the Euclidean distance of the node features between and ; is the scale at which the node has node features; is the scale at which the node has node features; k = 1, 2... d, where k represents the number of layers of the graph neural network; Then, the similarity weight based on feature similarity is calculated through the following Gaussian function conversion formula:
[0043] Among them, is the similarity weight between the node and the node at the scale ; is the standard deviation of the Gaussian distribution, which controls the influence degree of the distance on the weight; is the natural exponential function.
[0044] The prior knowledge of the node type can reflect the strength of the relationship between nodes. Assuming the prior weight is (obtained from domain knowledge or training data statistics), combined with the similarity weight based on feature similarity, it is adjusted to obtain the final weight: .
[0045] Furthermore, in step 5, to expand the neighbor range of each node , the graph convolution is applied multiple times. To aggregate the node features of all layers of its neighbor nodes, through iterations of neighbor nodes, the graph convolution operation is recursively expressed as: , where is the node feature of the th layer, is the th power of the adjacency matrix, indicating the node information of the farther neighbors that the node can reach during the convolution of the th layer. By performing a weighted sum on the node feature and transforming the feature through a weight matrix , the updated node feature is obtained using the following formula:
[0046] Among them, represents the set of neighbor nodes of the node , is the adjacency matrix adjusted by feature similarity and prior knowledge, is the weight matrix of the current layer. represents the neighbor nodes at the layer node features, represents the node at the layer updated node features.
[0047] Furthermore, attention weights are introduced in step 6, and the formula is:
[0048] where and are the feature vectors of nodes and node respectively, is the weight matrix of the linear transformation, is a single-layer feed-forward neural network, is the importance of node to node . An activation function is added to the output layer of the feed-forward neural network. To enable each node to better allocate attention weights and compare the weights between different nodes, the relevance degrees of all neighbors calculated are normalized to obtain :
[0049] According to the obtained weight distribution of adjacent nodes, the feature vectors of nodes are weighted and summed to obtain the updated feature of each node .
[0050] Furthermore, in step 7, the node feature is processed and aggregated layer by layer based on the multi-layer graph convolution of the hierarchical graph neural network, and finally the high-level node feature is generated. The feature update formula for each layer is , where is the node feature matrix of the layer, is the normalized adjacency matrix, is the weight matrix of the l-th layer. The node features after multi-layer processing contain the comprehensive information of neighboring nodes and can represent the global features of the nodes.
[0051] The final layer node feature is passed to the classification layer, and the class score is obtained through the following calculation formula:
[0052] Among them, is the score vector of the category of the node at scale . is the weight matrix of the classification layer at scale s, and is the bias vector of the classification layer at scale
[0053] The category score is converted into a normalized probability distribution through the function:
[0054] Among them, is the probability that the node at scale belongs to the category .
[0055] Specifically, in S3, the graph converted from the second image dataset is input into the preliminary graph neural network classification model; the predicted category probability distribution of each node in the second image dataset is calculated through forward propagation, and based on the true tunnel fire accident category label of the second image dataset, the cross-entropy loss is calculated:
[0056] Among them, is the total number of nodes in the second image dataset.
[0057] Then, using the backpropagation method, starting from the output layer, the error of each layer is calculated, and the error is propagated backward to each layer of the preliminary graph neural network classification model. According to the gradient of the error, the model parameters of each layer of the graph neural network are updated based on the gradient descent algorithm. After multiple iterative trainings, the value of the target loss function is reduced to obtain the target graph neural network classification model.
[0058] Furthermore, in S4, the graph converted from the third image dataset is input into the target graph neural network classification model; the predicted category probability distribution of each node in the third image dataset is calculated through forward propagation, and the final predicted category of each node is:
[0059] The performance metrics of the target model are evaluated: Classification accuracy:
[0060] Among them, is an indicator function. If takes the value of , otherwise it is ; is the total number of nodes.
[0061] The classification accuracy is:
[0062] The classification recall rate is:
[0063] The F1 value is:
[0064] Then, take the average of the F1 scores for each category:
[0065] In summary, in the present invention, first, image datasets of tunnel fire accidents in different forms are collected. Then, the image datasets are randomly divided to obtain the first image dataset, the second image dataset, and the third image dataset, ensuring that all fire types are representative and improving the generalization ability of the model. Through the second image dataset, supervised learning is performed on the graph neural network classification model obtained from the first image dataset to adjust the parameters, improving the accuracy and robustness of the classification results. The third image dataset is used to evaluate the adjusted graph neural network classification model to verify the effectiveness of the model and enhance the credibility of the classification results.
[0066] As Figure 1 shown, in actual use, a method for classifying tunnel fire accidents based on a graph neural network according to the present invention includes the following processes: Collect on-site images of tunnel fire accidents and preprocess the on-site images to obtain preprocessed images; Input the preprocessed images into the constructed tunnel fire accident classification model to output the tunnel fire accident classification results.
[0067] Example 5 As Figure 2 shown, the present invention discloses a system for classifying tunnel fire accidents based on a graph neural network, including: A data acquisition module for collecting on-site images of tunnel fire accidents; An image preprocessing module for preprocessing the on-site images to obtain preprocessed images; An accident classification module for inputting the graph structure into the constructed tunnel fire accident classification model to output the tunnel fire accident classification results; The construction process of the tunnel fire accident classification model specifically includes the following steps: S1. Collect an image data set of different types of tunnel fire accidents, randomly divide the image data set to obtain a first image data set, a second image data set, and a third image data set; S2. Construct a preliminary graph neural network classification model based on the first image data set; S3. Perform supervised learning on the neural network classification model constructed from the first data set according to the second image data set to obtain a target graph neural network classification model; S4. Perform performance evaluation on the target graph neural network classification model according to the third image data set to obtain an evaluation result; until the evaluation result determines that the target graph neural network classification model meets the preset performance indicators, then obtain the constructed tunnel fire accident classification model.
[0068] Example 6 The present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the tunnel fire accident classification method based on the graph neural network. Among them, the memory may include a memory, such as a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk memory, etc.; the processor, network interface, and memory are interconnected through an internal bus, and this internal bus can be an Industry Standard Architecture bus, a Peripheral Component Interconnect standard bus, an Extended Industry Standard Architecture bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory is used to store programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory can include a memory and a non-volatile memory, and provide instructions and data to the processor.
[0069] Example 7 The present invention also discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the tunnel fire accident classification method based on the graph neural network. Specifically, the computer-readable storage medium includes, but is not limited to, for example, a volatile memory and / or a non-volatile memory. The volatile memory may include a random access memory and / or a cache memory, etc. The non-volatile memory may include a read-only memory, a hard disk, a flash memory, an optical disc, a magnetic disk, etc.
[0070] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: modifications or equivalent replacements can still be made to the specific implementation manners of the present invention, and any modification or equivalent replacement that does not depart from the spirit and scope of the present invention shall be covered by the protection scope of the claims of the present invention.
Claims
1. A tunnel fire accident classification method based on graph neural network, characterized in that: The process includes: Collecting on-site images of the tunnel fire accident, preprocessing the on-site images to obtain preprocessed images; Input the preprocessed image into the constructed tunnel fire accident classification model, and output the tunnel fire accident classification result; The construction process of the tunnel fire accident classification model specifically includes the following steps: S1, collecting image data sets of different types of tunnel fire accidents, and randomly dividing the image data sets to obtain a first image data set, a second image data set, and a third image data set; S2. Construct a preliminary graph neural network classification model based on the first image data set; S3, performing supervised learning on the neural network classification model constructed by the first data set based on the second image data set to obtain a target graph neural network classification model; S4. Perform a performance evaluation on the target graph neural network classification model based on the third image data set to obtain an evaluation result; until the evaluation result determines that the target graph neural network classification model meets the preset performance indicators, a constructed tunnel fire accident classification model is obtained.
2. According to claim 1, a tunnel fire accident classification method based on graph neural network is characterized in that: The on-site images are preprocessed, and the preprocessing specifically includes image denoising, image enhancement, color space conversion, edge detection and data enhancement in sequence.
3. According to the method for classifying tunnel fire accidents based on graph neural network in claim 1, it is characterized in that: S2 includes the following sub-steps: Step 1, performing image preprocessing on the first image data set to obtain a preprocessed image; Step 2: Perform image conversion on the preprocessed image to obtain the graph structure. The specific process is as follows: The preprocessed image is segmented to obtain multiple region segmentation images of uniform size; each region segmentation image is regarded as a graph node, the spatial position and feature similarity of the image pixels are used as edge sets to connect the nodes, and the graph structure is constructed based on the graph nodes and edge sets; Perform multi-scale feature description on each graph structure to obtain feature vectors; Step 3: Use the convolutional neural network for the current scale to process the corresponding graph structure and extract spatial features; Use a deep neural network to process the feature vector at the previous scale to obtain abstract features, and then concatenate the spatial features and abstract features to obtain the node features at the current scale. Step 4: Calculate the Euclidean distance between the features of two nodes at the same scale, and transform it through a Gaussian function to obtain a similarity weight based on feature similarity; The similarity weight based on feature similarity is adjusted according to the relationship weight of the prior knowledge between different node types to obtain a more accurate similarity weight; Step 5: Apply a high-order graph convolution process to each node to expand the range of the current node’s neighbors to aggregate information from more distant nodes, gather multiple sensor information, and update the node’s node features; Step 6: Based on the attention mechanism, dynamically adjust the weight of information aggregation according to the importance of neighbor nodes, calculate the weighted features of each updated node when aggregating neighbor node information; aggregate the weighted features through a dynamic aggregation function to form a new node feature representation; Step 7: Process the new node feature representation of each node based on the hierarchical graph neural network, and the node feature representation will be passed to the classification layer; The classification layer maps the final features of the node to the spatial score of a category through the weight matrix and bias parameters, and finally The function converts the spatial score into a normalized probability distribution to obtain a preliminary graph neural network classification model constructed for the first image dataset.
4. A tunnel fire accident classification method based on graph neural network according to claim 3, characterized in that: Step 3 is as follows: The graph structure Used for convolutional neural network operation to obtain the spatial features of the node at the current scale; where: is a collection of nodes, is the set of edges; Then use the deep neural network to process the feature vector at the previous scale to obtain the abstract features of the current node; Use the following formula to combine spatial features with abstract features to obtain node features at the current scale: in, It is a scale Next Node The node characteristics of It is a scale Convolutional neural network, It is a scale A deep neural network, represents the concatenation operation, It is a scale Next Node The node characteristics of Is a node The corresponding pixel area or image block.
5. The tunnel fire accident classification method based on graph neural network according to claim 3 is characterized in that: In step 4, the expression for calculating the Euclidean distance between two nodes is: in, Is a node and nodes The Euclidean distance between node features, It is a scale Next Node The node characteristics of It is a scale Next Node Node features; k=1,2...d, k represents the number of layers of the graph neural network; Then the similarity weight based on feature similarity is calculated by the following Gaussian function conversion formula: in, It is a scale Next Node and nodes Similar weights of is the standard deviation of the Gaussian distribution, which controls the influence of distance on the weight; is a natural exponential function.
6. The tunnel fire accident classification method based on graph neural network according to claim 1 is characterized in that: S3 is specifically: The second image data set is input into the preliminary graph neural network classification model, the second image data set is subjected to image preprocessing and graph structure conversion, and then the tunnel fire accident image classification result of the second image data set output by the preliminary graph neural network classification model is obtained by forward propagation as a prediction of the tunnel fire accident type; The cross entropy loss function is calculated according to the actual tunnel fire accident types and the predicted tunnel fire accident types of the second image data set. According to the calculated loss, the gradient is calculated through the back propagation algorithm, and the model parameter values of the preliminary graph neural network classification model are adjusted according to these gradients to obtain the target graph neural network classification model.
7. The tunnel fire accident classification method based on graph neural network according to claim 1 is characterized in that: S4 is specifically: inputting the third image data set into the target graph neural network classification model, outputting the tunnel fire accident image classification result of the third image data set, comparing it with the actual tunnel fire accident type corresponding to the third image data set, and evaluating the performance indicators of the target graph neural network classification model; when all evaluation indicators meet the preset requirements, the target graph neural network classification model is qualified.
8. A tunnel fire accident classification system based on graph neural network, characterized in that: include: A data acquisition module, used to collect on-site images of tunnel fire accidents; An image preprocessing module is used to preprocess the on-site image to obtain a preprocessed image; The accident classification module is used to input the graph structure into the constructed tunnel fire accident classification model and output the tunnel fire accident classification results; The construction process of the tunnel fire accident classification model specifically includes the following steps: S1, collecting image data sets of different types of tunnel fire accidents, and randomly dividing the image data sets to obtain a first image data set, a second image data set, and a third image data set; S2. Construct a preliminary graph neural network classification model based on the first image data set; S3, performing supervised learning on the neural network classification model constructed by the first data set based on the second image data set to obtain a target graph neural network classification model; S4. Perform a performance evaluation on the target graph neural network classification model based on the third image data set to obtain an evaluation result; until the evaluation result determines that the target graph neural network classification model meets the preset performance indicators, a constructed tunnel fire accident classification model is obtained.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the tunnel fire accident classification method based on graph neural network as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the tunnel fire accident classification method based on graph neural network as described in any one of claims 1 to 7.
Citation Information
Cited By
Electrical fire monitoring and detecting method and system based on image processing
CN120599390A