Power distribution room fire warning method, device, equipment, medium and program product
By processing images of power distribution rooms using a deep learning model and combining embedding, encoder, and classification layers, a quantitative assessment of fire risk is achieved. This solves the problems of lag and false alarms/missed alarms in existing power distribution room fire early warning methods, providing earlier and more reliable early warnings.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUIZHOU POWER SUPPLY BUREAU OF GUANGDONG POWER GRID CO LTD
- Filing Date
- 2026-04-17
- Publication Date
- 2026-07-14
AI Technical Summary
Existing fire early warning methods for power distribution rooms are not accurate enough in the early stages of a fire, making it difficult to capture subtle changes in characteristics in a timely manner. This results in delayed warnings, which cannot provide enough time for personnel evacuation and initial firefighting. In addition, there are problems with false alarms and missed alarms.
A deep learning model is used to process the collected images of the power distribution room. The images are converted into word sequences through the embedding layer, and deep features are extracted using the multi-layer structure of the encoder layer. The most representative attention calculation results are selected through attention calculation, and the fire prediction results are combined with the classification layer to achieve a quantitative assessment of fire risk.
It enables early detection and accurate warning of fires in power distribution rooms, and can capture subtle changes in characteristics in the early stages of a fire, providing more timely and reliable early warning information, thus solving the problem of lag in traditional methods.
Smart Images

Figure CN122392268A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of fire early warning technology, and in particular to a method, device, equipment, medium and program product for fire early warning in power distribution rooms. Background Technology
[0002] The fire early warning mechanism in the power distribution room mainly focuses on real-time monitoring using devices such as smoke detectors, temperature sensors, and gas concentration sensors. These traditional sensors will immediately trigger the fire alarm system when they detect abnormal values, such as excessive smoke concentration, a sharp rise in temperature, or dangerous levels of harmful gas concentration.
[0003] However, its accuracy needs improvement. Because the initial signs of a fire are often subtle, traditional smoke sensors often struggle to detect these minute changes in time. They typically only trigger an alarm after the fire has grown to a certain size and generated significant amounts of smoke and heat. This lag significantly reduces the effectiveness of early warning systems, failing to provide sufficient time for evacuation and initial firefighting efforts. Summary of the Invention
[0004] This application provides a method, device, equipment, medium, and program product for early warning of fires in power distribution rooms, which can detect subtle changes in characteristics in the early stages of a fire, thereby achieving an earlier warning effect.
[0005] In a first aspect, embodiments of this application provide a method for early warning of fires in a power distribution room, including:
[0006] The collected images of the power distribution room are input into the embedding layer of the pre-trained fire early warning model, and the images of the power distribution room are represented as corresponding word sequences based on the embedding layer;
[0007] The word sequence is input into the encoder layer of the fire early warning model, and the encoder layer contains multiple sub-layers;
[0008] Obtain the attention calculation results obtained by performing attention calculations on the word sequence in different sub-layers;
[0009] Select the target attention calculation result from the attention calculation results corresponding to different sub-layers;
[0010] The target attention calculation result and the category tokens in the token sequence are concatenated and input into the last sub-layer of the encoder layer to obtain the encoding result;
[0011] The encoding results are input into the classification layer of the fire early warning model to obtain fire prediction results for the power distribution room.
[0012] In one possible implementation, selecting the target attention calculation result from the attention calculation results corresponding to different sub-layers includes:
[0013] Compare the attention calculation results of different sub-layers;
[0014] Select several attention calculation results from multiple attention calculation results whose weight values meet the preset weight value conditions;
[0015] Several selected attention calculation results are determined as the target attention calculation results.
[0016] In one possible implementation, selecting a plurality of attention calculation results whose weight values satisfy a preset weight value condition from a plurality of attention calculation results includes:
[0017] Based on the input image of the power distribution room, determine the number of attention calculation results that need to be selected;
[0018] Based on a defined quantity, select several attention calculation results from the multiple attention calculation results whose weight values satisfy the preset weight value conditions.
[0019] In one possible implementation, each sub-layer of the encoder layer, from the first to the penultimate sub-layer, integrates multiple attention heads. The step of obtaining the attention calculation results obtained from the attention calculations performed on the word sequence by different sub-layers includes:
[0020] In each sub-layer from the first sub-layer to the penultimate sub-layer, multiple attention heads are used to perform parallel computation on the word sequence, and the computation results of each attention head are aggregated to generate the attention computation result of the corresponding sub-layer.
[0021] Obtain the attention calculation results for each sub-layer from the first sub-layer to the second to last sub-layer.
[0022] In one possible implementation, representing the power distribution room image as a corresponding sequence of tokens based on the embedding layer includes:
[0023] In the embedding layer, the power distribution room image is segmented into multiple image blocks;
[0024] Convert the multiple image blocks into corresponding image block symbols;
[0025] Initialize category tokens;
[0026] By concatenating the category tokens and the image block tokens corresponding to the multiple image blocks, the power distribution room image can be represented as a corresponding token sequence.
[0027] In one possible implementation, inputting the encoding result into the classification layer of the fire early warning model to obtain fire prediction results for the power distribution room includes:
[0028] In the classification layer, the encoding results are processed by linear transformation and activation function to output the fire prediction results of the power distribution room.
[0029] Secondly, embodiments of this application provide a fire early warning device for a power distribution room, comprising:
[0030] An embedding conversion module is used to input the acquired power distribution room image into the embedding layer of a pre-trained fire early warning model, and represent the power distribution room image as a corresponding word sequence based on the embedding layer;
[0031] The input module is used to input the word sequence into the encoder layer of the fire early warning model, the encoder layer comprising multiple sub-layers;
[0032] The attention calculation module is used to obtain the attention calculation results obtained by different sub-layers performing attention calculations on the word sequence;
[0033] The selection module is used to select the target attention calculation result from the attention calculation results of different corresponding sub-layers;
[0034] The encoding result generation module is used to concatenate the target attention calculation result and the category tokens in the token sequence and input them into the last sub-layer of the encoder layer to obtain the encoding result;
[0035] The fire prediction result generation module is used to input the encoded result into the classification layer of the fire early warning model to obtain fire prediction results for the power distribution room.
[0036] In one possible implementation, the selection module is specifically used for:
[0037] Compare the attention calculation results of different sub-layers;
[0038] Select several attention calculation results from multiple attention calculation results whose weight values meet the preset weight value conditions;
[0039] Several selected attention calculation results are determined as the target attention calculation results.
[0040] In one possible implementation, the selection module is specifically used for:
[0041] Based on the input image of the power distribution room, determine the number of attention calculation results that need to be selected;
[0042] Based on a defined quantity, select several attention calculation results from the multiple attention calculation results whose weight values satisfy the preset weight value conditions.
[0043] In one possible implementation, each sub-layer of the encoder layer, from the first to the penultimate sub-layer, integrates multiple attention heads, and the attention calculation module is specifically used for:
[0044] In each sub-layer from the first sub-layer to the penultimate sub-layer, multiple attention heads are used to perform parallel computation on the word sequence, and the computation results of each attention head are aggregated to generate the attention computation result of the corresponding sub-layer.
[0045] Obtain the attention calculation results for each sub-layer from the first sub-layer to the second to last sub-layer.
[0046] In one possible implementation, the embedding conversion module is specifically used for:
[0047] In the embedding layer, the power distribution room image is segmented into multiple image blocks;
[0048] Convert the multiple image blocks into corresponding image block symbols;
[0049] Initialize category tokens;
[0050] By concatenating the category tokens and the image block tokens corresponding to the multiple image blocks, the power distribution room image can be represented as a corresponding token sequence.
[0051] In one possible implementation, the fire prediction result generation module is specifically used for:
[0052] In the classification layer, the encoding results are processed by linear transformation and activation function to output the fire prediction results of the power distribution room.
[0053] Thirdly, embodiments of this application provide a fire early warning device for a power distribution room, including: a memory and a processor;
[0054] The memory stores computer-executed instructions;
[0055] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0056] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0057] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0058] The fire early warning method, apparatus, equipment, medium, and program products for power distribution rooms provided in this application convert image data of the acquired power distribution room into a pre-trained fire early warning model's embedding layer, preserving important feature information in the image. The generated word sequence is then input into the encoder layer of the fire early warning model, which consists of multiple sub-layers. Utilizing the multi-layer structure of the encoder layer, deep feature extraction is performed on the input data, enhancing the ability to recognize complex patterns. Attention calculations are performed on the word sequences in different sub-layers to obtain attention calculation results. A target attention calculation result is selected from the attention calculation results of different sub-layers. By selecting the most representative attention calculation result, subsequent processing is ensured to be based on the most effective information. The target attention calculation result is concatenated with a category word and input into the last sub-layer of the encoder layer to generate an encoded result. The encoded result is input into the classification layer of the fire early warning model to obtain the fire prediction result for the power distribution room. Through processing by the classification layer, a predicted value between 0 and 1 is output, representing the probability of a fire in the power distribution room, thus achieving a quantitative assessment of fire risk. Through the above steps, early detection and accurate warning of fires in power distribution rooms are achieved. By utilizing feature extraction and attention mechanisms of deep learning models, subtle feature changes can be captured in the early stages of a fire, thereby providing more timely and reliable early warning information. Attached Figure Description
[0059] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0060] Figure 1 A schematic diagram illustrating a scenario for the fire early warning method for power distribution rooms provided in this application;
[0061] Figure 2 Flowchart of the fire early warning method for power distribution rooms provided in this application Figure 1 ;
[0062] Figure 3 Flowchart of the fire early warning method for power distribution rooms provided in this application Figure 2 ;
[0063] Figure 4 A schematic diagram illustrating the process of constructing the dataset provided in this application;
[0064] Figure 5 A process diagram of the fire early warning method for power distribution rooms provided in this application;
[0065] Figure 6 A schematic diagram of the structure of the fire early warning device for the power distribution room provided in this application;
[0066] Figure 7 This is a structural schematic diagram of the fire early warning device for the power distribution room provided in this application.
[0067] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0068] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0069] Current fire early warning methods based on single or combined sensors have revealed significant limitations in practical applications.
[0070] First, its accuracy urgently needs improvement. Because the initial characteristics of a fire are usually quite subtle, traditional smoke sensors often struggle to detect these minute changes in time. They typically only trigger an alarm after the fire has grown to a certain size and generated a large amount of smoke and heat. This lag severely weakens the early warning effect, failing to provide sufficient time for evacuation and initial firefighting.
[0071] Secondly, traditional fire alarm systems also face the problems of false alarms and missed alarms. On the one hand, interference from environmental factors (such as dust, water vapor, etc.) may cause false alarms from sensors, resulting in unnecessary panic and waste of resources; on the other hand, if the sensitivity of the sensors is not set properly, or if the type of fire exceeds the detection range of the sensors, it may also lead to missed alarms, thus missing the best opportunity to extinguish the fire.
[0072] Although infrared cameras and other high-precision sensors (such as laser scattering smoke detectors and infrared thermal imagers) have been widely used in fire early warning systems in recent years due to technological advancements, demonstrating great potential in fire early warning due to their high sensitivity and accuracy, excessive sensitivity, while improving detection accuracy, can also lead to too many false alarms, causing unnecessary trouble for daily maintenance.
[0073] Therefore, while existing fire early warning methods for power distribution rooms can play a certain role in early warning, they still have many shortcomings.
[0074] The fire early warning method for power distribution rooms provided in this application converts the collected images of the power distribution room into a pre-trained fire early warning model's embedding layer, transforming the image data into a word sequence that the model can process, while preserving important feature information from the images. The generated word sequence is then input into the encoder layer of the fire early warning model, which consists of multiple sub-layers. Utilizing the multi-layer structure of the encoder layer, deep feature extraction is performed on the input data, enhancing the ability to recognize complex patterns. Attention calculations are performed on the word sequences in different sub-layers to obtain attention calculation results. A target attention calculation result is selected from the attention calculation results of different sub-layers. By selecting the most representative attention calculation result, subsequent processing is ensured to be based on the most effective information. The target attention calculation result is concatenated with a category word and input into the last sub-layer of the encoder layer to generate an encoded result. The encoded result is input into the classification layer of the fire early warning model to obtain a fire prediction result for the power distribution room. Through the processing of the classification layer, a predicted value between 0 and 1 is output, representing the probability of a fire occurring in the power distribution room, achieving a quantitative assessment of fire risk. Through the above steps, early detection and accurate early warning of fires in power distribution rooms are achieved. By utilizing feature extraction and attention mechanisms of deep learning models, subtle feature changes can be captured in the early stages of a fire, thereby providing more timely and reliable early warning information and solving the technical problem of the lag in early warning of fires in power distribution rooms.
[0075] Figure 1 A schematic diagram of a scenario for the fire early warning method for power distribution rooms provided in this application, such as... Figure 1 As shown, a pre-trained fire early warning model can be deployed in terminal device 101. Collected images of the power distribution room are input into this model for fire prediction, thereby obtaining the fire prediction result. The fire prediction result can be a fire occurrence probability value, representing the likelihood of a fire occurring. When this probability value exceeds a preset threshold, a fire early warning is triggered, which can be issued via audible and visual alarms, SMS notifications, or other means. Terminal device 101 can be various types of computing devices, including desktop computers, laptops, and tablets.
[0076] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0077] Figure 2 Flowchart of the fire early warning method for power distribution rooms provided in this application Figure 1 ,like Figure 2 As shown, the method includes:
[0078] S201. Input the collected power distribution room images into the embedding layer of the pre-trained fire early warning model, and represent the power distribution room images as corresponding word sequences based on the embedding layer.
[0079] The acquired images of the power distribution room are input into the embedding layer of a pre-trained fire early warning model. The embedding layer's role is to convert the image data into a sequence of symbols that the model can process. This process involves feature extraction and vectorization, enabling the image information to be effectively utilized in subsequent model processing.
[0080] S202. Input the word sequence into the encoder layer of the fire early warning model. The encoder layer contains multiple sub-layers.
[0081] The generated word sequence is input into the encoder layer of the fire early warning model. The encoder layer consists of multiple sub-layers, each responsible for feature extraction and information processing at different levels. This process uses the hierarchical structure of the deep learning network to progressively extract and combine features from the input data.
[0082] S203. Obtain the attention calculation results obtained by performing attention calculation on the word sequence in different sub-layers.
[0083] Attention is calculated on the word sequences in different sub-layers of the encoder. The attention mechanism is used to identify and focus on the most relevant parts of the input data, improving the model's ability to identify key features. The attention calculation results of each sub-layer reflect the layer's focus on the input data.
[0084] S204. Select the target attention calculation result from the attention calculation results corresponding to different sub-layers.
[0085] The target attention calculation result is selected from the attention calculation results of different sub-layers. This selection process aims to filter out the most representative and informative attention calculation results to ensure that subsequent processing is based on the most effective information. This step optimizes the model's feature extraction performance.
[0086] S205. The target attention calculation result and the category tokens in the token sequence are concatenated and input into the last sub-layer of the encoder layer to obtain the encoding result.
[0087] The target attention calculation result is concatenated with the category term and then input into the last sub-layer of the encoder layer to generate the encoded result. Concatenating the category term helps to incorporate category information into the encoding process, enhancing the model's discriminative ability. The final encoded result is a high-level representation of the input data.
[0088] S206. Input the encoding results into the classification layer of the fire early warning model to obtain fire prediction results for the power distribution room.
[0089] The encoded results are input into the classification layer of the fire early warning model to obtain fire prediction results for the power distribution room. The classification layer is responsible for mapping the encoded results to specific predicted values, typically a probability value between 0 and 1, representing the likelihood of a fire occurring in the power distribution room. This result provides a quantitative basis for fire risk assessment.
[0090] The fire early warning method for power distribution rooms provided in this application involves inputting acquired images of the power distribution room into the embedding layer of a pre-trained fire early warning model. This converts the image data into a sequence of words that the model can process, preserving important feature information from the images. The generated word sequence is then input into the encoder layer of the fire early warning model, which consists of multiple sub-layers. Utilizing the multi-layer structure of the encoder layer, deep feature extraction is performed on the input data, enhancing the ability to recognize complex patterns. Attention calculations are performed on the word sequences in different sub-layers to obtain attention calculation results. A target attention calculation result is selected from the attention calculation results of different sub-layers. By selecting the most representative attention calculation result, subsequent processing is ensured to be based on the most effective information. The target attention calculation result is concatenated with a category word and input into the last sub-layer of the encoder layer to generate an encoded result. The encoded result is input into the classification layer of the fire early warning model to obtain a fire prediction result for the power distribution room. Through the processing of the classification layer, a predicted value between 0 and 1 is output, representing the probability of a fire occurring in the power distribution room, achieving a quantitative assessment of fire risk. Through the above steps, early detection and accurate early warning of fires in power distribution rooms are achieved. By utilizing the feature extraction and attention mechanisms of deep learning models, subtle feature changes can be captured in the early stages of a fire, thereby providing more timely and reliable early warning information.
[0091] Figure 3 Flowchart of the fire early warning method for power distribution rooms provided in this application Figure 2 ,like Figure 3 As shown, in this embodiment... Figure 2 Based on the embodiments, a fire early warning method for power distribution rooms is described in detail. The method includes:
[0092] S301. Input the collected power distribution room image into the embedding layer of the pre-trained fire early warning model, and represent the power distribution room image as a corresponding word sequence based on the embedding layer.
[0093] In this embodiment, images of power distribution rooms under different scenarios can be acquired, and a model training dataset can be constructed based on these images. Specifically, images of power distribution rooms with flames can be acquired, capturing the presence of open flames and helping the model learn to recognize flame features. Images of power distribution rooms with smoke can be acquired, showing the presence of smoke and helping the model identify the visual features and patterns of smoke. Images of power distribution rooms under normal conditions can also be acquired, reflecting the state of the power distribution room under normal and safe conditions, providing a benchmark for the model to distinguish between abnormal and normal states. By integrating these images from different scenarios, the model training dataset can cover various possible fire characteristics and normal states. This diverse dataset not only improves the model's generalization ability but also enhances its ability to identify and warn of fire risks in practical applications.
[0094] Reference Figure 4 The diagram illustrates the process of constructing the dataset provided in this application. It allows for the acquisition of images of power distribution rooms in different scenarios. Preprocessing operations are performed on the acquired images, such as image resizing, noise removal, and color standardization. The preprocessed images are then labeled, and data augmentation is applied to the labeled images. The preprocessed, labeled, and data-augmented images are combined into a dataset for training the model. During model training, Stochastic Gradient Descent (SGD) is selected as the optimization algorithm, and the momentum parameter is set to 0.9 to enhance the stability and efficiency of the training process. Furthermore, to effectively control the training cycle, the maximum number of iterations during training is limited to no more than 20. This measure ensures sufficient model learning while avoiding unnecessary training time waste.
[0095] The fire early warning model trained in this application can be a visual model based on the Transformer architecture.
[0096] In one possible implementation, the substation image is represented as a corresponding sequence of terms based on the embedding layer, which may specifically include:
[0097] In the embedding layer, the power distribution room image is segmented into multiple image blocks;
[0098] Convert multiple image blocks into corresponding image block symbols;
[0099] Initialize category tokens;
[0100] By concatenating category terms and image block terms corresponding to multiple image blocks, the power distribution room image can be represented as a corresponding term sequence.
[0101] In this embodiment, the substation image is segmented into multiple smaller image blocks in the embedding layer of the fire early warning model. Each image block is converted into a corresponding image block token. The image block token is a vectorized representation of the image block, facilitating model processing. Through this conversion, the image block is encoded into a fixed-length vector, preserving its feature information. A class token is initialized. The class token is a special token used to aggregate information from the image blocks and is ultimately used for classification tasks. It plays a role in global information aggregation in the Transformer model. The class token is concatenated with the image block tokens corresponding to multiple image blocks, forming a token sequence representing the entire substation image. This sequence serves as input for subsequent encoder layers.
[0102] S302. Input the word sequence into the encoder layer of the fire early warning model. The encoder layer contains multiple sub-layers.
[0103] S303. Obtain the attention calculation results obtained by performing attention calculation on the word sequence in different sub-layers.
[0104] In one possible implementation, each sub-layer of the encoder layer, from the first to the penultimate sub-layer, integrates multiple attention heads to obtain the attention calculation results obtained from the attention calculations performed on the word sequence by different sub-layers. Specifically, this may include:
[0105] In each sub-layer from the first to the penultimate sub-layer, multiple attention heads are used to perform parallel computation on the word sequence. The computation results of each attention head are aggregated to generate the attention computation results of the corresponding sub-layer.
[0106] Obtain the attention calculation results for each sub-layer from the first to the second to last.
[0107] In this embodiment, the encoder layer consists of multiple sub-layers. In each sub-layer, from the first to the penultimate sub-layer, multiple attention heads are used to perform parallel computations on the input word sequence, and the computation results from the multiple attention heads are aggregated together. This aggregation can be achieved through a simple operation (such as weighted summation) to generate the overall attention computation result for that sub-layer. For each sub-layer, from the first to the penultimate sub-layer, its corresponding attention computation result is obtained separately.
[0108] As an example, a fire early warning model can contain L encoder sub-layers. For the first L-1 sub-layers, each sub-layer contains K attention heads. The attention calculation result for each sub-layer in the first L-1 sub-layers can be expressed as follows: ,in, This represents the calculation result of the Kth attention head in the l-th layer; the range of l is 1, 2, ..., L-1.
[0109] S304. Compare the attention calculation results of different sub-layers.
[0110] Compare the attention calculation results from different sub-layers.
[0111] S305. Select several attention calculation results from multiple attention calculation results whose weight values meet the preset weight value conditions.
[0112] Select several attention calculation results from multiple attention calculation results whose weight values meet the preset weight value conditions.
[0113] In one possible implementation, selecting several attention calculation results from multiple attention calculation results that satisfy a preset weight value condition may specifically include:
[0114] Based on the input image of the power distribution room, determine the number of attention calculation results to be selected;
[0115] Based on a defined number, select several attention calculation results from multiple attention calculation results whose weight values meet the preset weight value conditions.
[0116] In this embodiment, the input image of the power distribution room is used to determine the number of attention calculation results to be selected, denoted as N. A preset weight value condition can be that the weight value is greater than a set weight threshold. Attention calculation results with weight values greater than the set weight threshold are selected from the multiple attention calculation results. Then, the selected attention calculation results are sorted according to their weight values. Finally, the results with the top N weight values are selected from the sorted attention calculation results. This selection process aims to ensure that the selected attention calculation results effectively reflect the key features or regions of the input image.
[0117] S306. Select several attention calculation results and determine them as target attention calculation results.
[0118] After the preceding selection process, several attention calculation results were selected and determined as the target attention calculation results.
[0119] S307. The target attention calculation result and the category tokens in the token sequence are concatenated and input into the last sub-layer of the encoder layer to obtain the encoding result.
[0120] S308. Input the encoding results into the classification layer of the fire early warning model to obtain fire prediction results for the power distribution room.
[0121] In one possible implementation, the encoding result is input into the classification layer of the fire early warning model to obtain fire prediction results for the power distribution room, which may specifically include:
[0122] In the classification layer, the encoding results are processed through linear transformation and activation functions to output the fire prediction results for the power distribution room.
[0123] In the classification layer, the encoding result is first subjected to a linear transformation. The result after the linear transformation is then subjected to non-linear processing using an activation function. After the linear transformation and activation function processing, the classification layer outputs the fire prediction result for the power distribution room.
[0124] Reference Figure 5 The diagram illustrates the process of the power distribution room fire early warning method provided in this application. The acquired power distribution room image is input into the embedding layer of a pre-trained fire early warning model. The image is segmented into multiple image blocks, each of which is converted into a corresponding image block term. The category term and the image block terms from multiple image blocks are then concatenated into a term sequence, which is input into the encoder layer of the fire early warning model. The encoder layer contains multiple sub-layers. In the first to second-to-last sub-layers of the encoder layer, each sub-layer integrates multiple attention heads. These attention heads are used to perform parallel computation on the term sequence. The computation results of each attention head are aggregated to generate the attention computation result for the corresponding sub-layer. A target attention computation result is selected from the attention computation results of different sub-layers. This target attention computation result reflects the key region of the input image. The target attention computation result and the category term are concatenated and input into the last sub-layer of the encoder layer to obtain the encoding result. This encoding result is then input into the classification layer of the fire early warning model to obtain the fire prediction result for the power distribution room.
[0125] The fire early warning method for power distribution rooms provided in this application involves inputting acquired images of the power distribution room into the embedding layer of a pre-trained fire early warning model. This converts the image data into a sequence of words that the model can process, preserving important feature information from the images. The generated word sequence is then input into the encoder layer of the fire early warning model, which consists of multiple sub-layers. Utilizing the multi-layer structure of the encoder layer, deep feature extraction is performed on the input data, enhancing the ability to recognize complex patterns. Attention calculations are performed on the word sequences in different sub-layers to obtain attention calculation results. A target attention calculation result is selected from the attention calculation results of different sub-layers. By selecting the most representative attention calculation result, subsequent processing is ensured to be based on the most effective information. The target attention calculation result is concatenated with a category word and input into the last sub-layer of the encoder layer to generate an encoded result. The encoded result is input into the classification layer of the fire early warning model to obtain a fire prediction result for the power distribution room. Through the processing of the classification layer, a predicted value between 0 and 1 is output, representing the probability of a fire occurring in the power distribution room, achieving a quantitative assessment of fire risk. Through the above steps, early detection and accurate early warning of fires in power distribution rooms are achieved. By utilizing the feature extraction and attention mechanisms of deep learning models, subtle feature changes can be captured in the early stages of a fire, thereby providing more timely and reliable early warning information.
[0126] Figure 6 This is a structural schematic diagram of the fire early warning device for the power distribution room provided in this application, as shown below. Figure 6 As shown, the fire early warning device 60 for the power distribution room provided in this embodiment includes:
[0127] The embedding conversion module 601 is used to input the collected power distribution room image into the embedding layer of the pre-trained fire early warning model, and represent the power distribution room image as a corresponding word sequence based on the embedding layer;
[0128] Input module 602 is used to input the word sequence into the encoder layer of the fire early warning model. The encoder layer contains multiple sub-layers.
[0129] The attention calculation module 603 is used to obtain the attention calculation results obtained by different sub-layers performing attention calculations on the word sequence;
[0130] Module 604 is used to select the target attention calculation result from the attention calculation results corresponding to different sub-layers;
[0131] The encoding result generation module 605 is used to concatenate the target attention calculation result and the category tokens in the token sequence and input them into the last sub-layer of the encoder layer to obtain the encoding result;
[0132] The fire prediction result generation module 606 is used to input the encoded results into the classification layer of the fire early warning model to obtain fire prediction results for the power distribution room.
[0133] In one possible implementation, the selection module is specifically used for:
[0134] Compare the attention calculation results of different sub-layers;
[0135] Select several attention calculation results from multiple attention calculation results whose weight values meet the preset weight value conditions;
[0136] Several selected attention calculation results are determined as the target attention calculation results.
[0137] In one possible implementation, the selection module is specifically used for:
[0138] Based on the input image of the power distribution room, determine the number of attention calculation results to be selected;
[0139] Based on a defined number, select several attention calculation results from multiple attention calculation results whose weight values meet the preset weight value conditions.
[0140] In one possible implementation, each sub-layer of the encoder layer, from the first to the second-to-last sub-layer, integrates multiple attention heads. The attention calculation module is specifically used for:
[0141] In each sub-layer from the first to the penultimate sub-layer, multiple attention heads are used to perform parallel computation on the word sequence. The computation results of each attention head are aggregated to generate the attention computation results of the corresponding sub-layer.
[0142] Obtain the attention calculation results for each sub-layer from the first to the second to last.
[0143] In one possible implementation, the embedded conversion module is specifically used for:
[0144] In the embedding layer, the power distribution room image is segmented into multiple image blocks;
[0145] Convert multiple image blocks into corresponding image block symbols;
[0146] Initialize category tokens;
[0147] By concatenating category terms and image block terms corresponding to multiple image blocks, the power distribution room image can be represented as a corresponding term sequence.
[0148] In one possible implementation, the fire prediction result generation module is specifically used for:
[0149] In the classification layer, the encoding results are processed through linear transformation and activation functions to output the fire prediction results for the power distribution room.
[0150] The fire early warning device for the power distribution room provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0151] Figure 7 This is a structural schematic diagram of the fire early warning device for the power distribution room provided in this application. Figure 7 As shown, the fire early warning device 70 for a power distribution room provided in this embodiment includes at least one processor 701 and a memory 702. Optionally, the device 70 also includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus.
[0152] In a specific implementation, at least one processor 701 executes computer execution instructions stored in memory 702, causing at least one processor 701 to perform the above-described method.
[0153] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0154] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0155] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0156] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0157] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0158] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0159] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0160] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0161] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0162] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0163] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0164] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0165] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0166] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for early warning of fires in a power distribution room, characterized in that, include: The collected images of the power distribution room are input into the embedding layer of the pre-trained fire early warning model, and the images of the power distribution room are represented as corresponding word sequences based on the embedding layer; The word sequence is input into the encoder layer of the fire early warning model, and the encoder layer contains multiple sub-layers; Obtain the attention calculation results obtained by performing attention calculations on the word sequence in different sub-layers; Select the target attention calculation result from the attention calculation results corresponding to different sub-layers; The target attention calculation result and the category tokens in the token sequence are concatenated and input into the last sub-layer of the encoder layer to obtain the encoding result; The encoding results are input into the classification layer of the fire early warning model to obtain fire prediction results for the power distribution room.
2. The method according to claim 1, characterized in that, The step of selecting the target attention calculation result from the attention calculation results corresponding to different sub-layers includes: Compare the attention calculation results of different sub-layers; Select several attention calculation results from multiple attention calculation results whose weight values meet the preset weight value conditions; Several selected attention calculation results are determined as the target attention calculation results.
3. The method according to claim 2, characterized in that, The step of selecting several attention calculation results whose weight values satisfy preset weight value conditions from multiple attention calculation results includes: Based on the input image of the power distribution room, determine the number of attention calculation results that need to be selected; Based on a defined quantity, select several attention calculation results from the multiple attention calculation results whose weight values satisfy the preset weight value conditions.
4. The method according to any one of claims 1-3, characterized in that, In the first to second-to-last sublayers of the encoder layer, each sublayer integrates multiple attention heads. The process of obtaining the attention calculation results obtained from different sublayers performing attention calculations on the word sequence includes: In each sub-layer from the first sub-layer to the penultimate sub-layer, multiple attention heads are used to perform parallel computation on the word sequence, and the computation results of each attention head are aggregated to generate the attention computation result of the corresponding sub-layer. Obtain the attention calculation results for each sub-layer from the first sub-layer to the second to last sub-layer.
5. The method according to any one of claims 1-3, characterized in that, The process of representing the power distribution room image as a corresponding sequence of terms based on the embedding layer includes: In the embedding layer, the power distribution room image is segmented into multiple image blocks; Convert the multiple image blocks into corresponding image block symbols; Initialize category tokens; By concatenating the category tokens and the image block tokens corresponding to the multiple image blocks, the power distribution room image can be represented as a corresponding token sequence.
6. The method according to any one of claims 1-3, characterized in that, The step of inputting the encoding result into the classification layer of the fire early warning model to obtain fire prediction results for the power distribution room includes: In the classification layer, the encoding results are processed by linear transformation and activation function to output the fire prediction results of the power distribution room.
7. A fire early warning device for a power distribution room, characterized in that, include: An embedding conversion module is used to input the acquired power distribution room image into the embedding layer of a pre-trained fire early warning model, and represent the power distribution room image as a corresponding word sequence based on the embedding layer; The input module is used to input the word sequence into the encoder layer of the fire early warning model, the encoder layer comprising multiple sub-layers; The attention calculation module is used to obtain the attention calculation results obtained by different sub-layers performing attention calculations on the word sequence; The selection module is used to select the target attention calculation result from the attention calculation results of different corresponding sub-layers; The encoding result generation module is used to concatenate the target attention calculation result and the category tokens in the token sequence and input them into the last sub-layer of the encoder layer to obtain the encoding result; The fire prediction result generation module is used to input the encoded result into the classification layer of the fire early warning model to obtain fire prediction results for the power distribution room.
8. A fire early warning device for a power distribution room, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.