A method and device for identifying a fire, a storage medium and an electronic device
By combining self-attention mechanism and feature fusion model with transfer learning, the problems of high false alarm rate and low efficiency in traction substation fire identification were solved. This enabled effective identification of small-scale fires and efficient identification of various substation fires, reducing costs and improving identification efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENHUA BAOSHEN RAILWAY GRP
- Filing Date
- 2023-02-22
- Publication Date
- 2026-06-02
AI Technical Summary
Existing technologies for identifying fires in traction substations suffer from problems such as high false alarm rates, low identification efficiency in complex environments, high costs, poor universality, and low identification efficiency, especially in identifying small-scale fires and substation fires.
A self-attention mechanism and feature fusion model are used to extract significant fire features. Combined with transfer learning, normal fire images are used as the source domain for transfer learning. This enables the detection of various traction fires and small-scale fires, simplifies the network structure, and reduces training time and server resource consumption.
It effectively identifies small-scale fires, prevents fires from escalating, saves time and space costs, and is applicable to fire identification in various substations, improving identification efficiency and universality.
Smart Images

Figure CN116385955B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of traction substation fire identification technology, and in particular to a traction substation fire identification method, device, storage medium, computer program product, and electronic device. Background Technology
[0002] The purpose of the background description provided herein is to give an overall background to this application. The statements in this section are merely to provide background information relevant to this application and do not necessarily constitute prior art.
[0003] With the rapid development of my country's electrical and railway transportation industries, the demand for traction substations is increasing. Traction substations involve a wide variety of equipment and complex wiring layouts, making them prone to fires that can cause significant economic and property losses. Therefore, accurate and timely fire detection in traction substations is crucial.
[0004] Currently, point sensors are the most commonly used fire sensing technology in traction substations, used to monitor heat, gas, flame, smoke, and other important fire characteristics. In thermal sensing, Chiang developed a device to measure fire stage by monitoring the temperature difference between inner and outer walls; Wang et al. studied near-field and far-field temperature sensor arrays to detect fire stage; Jevti and Blagojevi used electrical and sheathed thermocouple-type thermal sensors to monitor wire resistance and surface temperature related to fire stage. For gas sensor applications, Liu et al. summarized gas sensing technologies by detecting changes in the output of semiconductor, catalytic bead, photoionization, infrared, electrochemical, optical, acoustic, gas chromatograph, and calorimetric sensors. Generally, fire sensing systems are designed to detect early fires with fewer false alarms. However, as a feature-based method, currently used point sensors have a high false alarm rate in complex fire environments.
[0005] Compared to point sensors, image-based fire detection can effectively reduce interference from the external environment, and the images are rich in information, have good continuity, and the image processing methods are low-cost and highly operable. Automatic identification of flame images can be achieved through machine learning methods and sufficient samples to train the model. In recent years, Support Vector Machines (SVM), feedforward artificial neural networks, wavelet neural networks, fuzzy neural networks, probabilistic neural networks (PNN), RBF neural networks, BP neural networks, and Extreme Learning Machines (ELM) have been applied to fire image recognition. However, SVM has poor generalization performance and is prone to overfitting. Moreover, the prediction accuracy of the kernel function selected in SVM is greatly affected by the data distribution characteristics. In RBF and SVM networks, due to the use of high-dimensional data mapping, problems such as poor generalization ability and easy overfitting also occur. ELM relies on the accurate selection of the number of hidden layer nodes. Too many hidden layer nodes will increase the computational cost of the model and easily lead to overfitting. BP has a slow convergence speed and is prone to getting trapped in local extrema. The selection of wavelet functions in wavelet neural networks is subjective, and its prediction accuracy is greatly affected by data features. The selection of membership functions in fuzzy neural networks is subjective and has a great impact on the prediction accuracy of the model.
[0006] With the continuous development of deep learning technology, flame image recognition based on deep learning algorithms has attracted widespread attention. Muhammad et al. extracted information from convolutional neural networks... The deep features of Networks (CNNs) have been used to construct fire detection frameworks; Said et al. proposed a hybrid CNN model for fire detection; Sharma et al. combined CNN and ELM models to achieve fire image detection; Pereira et al. proposed an active fire detection method in satellite images by introducing a large-scale active fire detection dataset and using different CNN architectures; Ayala et al. proposed a new deep learning architecture for fire image recognition, using inverted residual blocks, deep convolution, and octave bands to reduce the computational cost of the model while ensuring high computational accuracy; Sun et al. proposed an improved CNN to achieve fast detection of forest fire smoke; Cao et al. proposed an attention-enhanced bidirectional long short-term memory network (ABi-LSTM) for smoke recognition of forest fires in videos; Pondir and Raman proposed a robust smoke detection method based on a dual deep learning framework, where the first deep learning framework extracts image-based features from smoke patches, and the second deep learning framework extracts motion-based features, which are then input into a CNN classifier for classification; Yang et al. proposed a neural network model combining lightweight CNN and SRU to reduce the impact of strong interference, such as strong light flashes or high-brightness backgrounds, on single-frame fire image recognition.
[0007] However, current technologies still have several shortcomings. For example, at the technical level: while deep learning networks can extract fire features, significant and clear features are easily lost during layer-by-layer network transmission; they neglect small-scale fires, which could prevent greater losses if detected promptly; and they lack specific recognition capabilities for substation fire images. At the cost level: deep learning networks have complex structures, consuming more training time and server resources; they use fixed datasets, resulting in poor universality and high costs for large-scale deployment. At the efficiency level: the complex network structure leads to low recognition efficiency; and the lack of transfer learning means that different substations have varying conditions, affecting recognition efficiency. Summary of the Invention
[0008] To address the aforementioned problems, this application proposes a method, device, storage medium, computer program product, and electronic device for identifying traction substation fires. The problems solved by this application in the prior art include: Technically, employing a self-attention mechanism and feature fusion model effectively extracts salient fire features, avoiding loss; utilizing transfer learning enables the detection of various traction substation fires and small-scale fires. In terms of cost, the simple network structure saves time and server resources; using images from various traction substations as transfer learning datasets means that adding substations only requires transfer learning, eliminating the need for retraining. In terms of efficiency, the simple network structure results in high recognition efficiency; the use of transfer learning enables the identification of various substation fire scenarios, and the model is applicable to various substation fire datasets, improving recognition efficiency.
[0009] A first aspect of this application provides a method for identifying fires at traction substations, the method comprising:
[0010] A preprocessed fire image dataset is obtained by preprocessing a preset fire image dataset; wherein each image in the fire image dataset includes three color RGB channels, and the preprocessing includes noise reduction and labeling.
[0011] The pre-processed fire image dataset is used to train a preset fire image recognition model to obtain a normal fire recognition model.
[0012] The normal fire identification model is transferred to the preprocessed fire image dataset to obtain a trained model.
[0013] The trained model is used to identify images of the traction substation, and the identification results are used to determine whether a fire has occurred at the traction substation.
[0014] Furthermore, the step of training a preset fire image recognition model based on the preprocessed fire image dataset to obtain a normal fire recognition model includes:
[0015] Feature extraction is performed on the images in the preprocessed fire image dataset to obtain the traditional fire features in each image.
[0016] The fire features are automatically extracted from the images in the preprocessed fire image dataset by using a preset self-attention model.
[0017] The traditional features and the automatically extracted fire features are fused to obtain fused features, and all the fused features are used as input data to train a preset fire image recognition model to obtain the normal fire recognition model.
[0018] Furthermore, the preset fire image dataset includes:
[0019] Normal fire image dataset, small-scale fire image dataset, and fire image datasets from different traction stations.
[0020] Furthermore, the de-drying process includes:
[0021] All images in the preset fire image dataset are adjusted to a preset size, and all images are converted into an image matrix of a preset size;
[0022] The image matrix is de-noiseed using a total variational model.
[0023] Furthermore, the conventional features include:
[0024] Flame characteristics and / or smoke characteristics; wherein,
[0025] The flame characteristics include one or more of the following: RG area component ratio, roundness, and sharp corners;
[0026] The smoke characteristics include one or more of the following: area change rate, correlation coefficient, similarity, and overall mobility characteristics.
[0027] Furthermore, the step of performing transfer learning on the normal fire identification model based on the preprocessed fire image dataset to obtain a trained model includes:
[0028] The normal fire image dataset in the preprocessed fire image dataset is used as the source domain to train the normal fire identification model, thereby obtaining the first model and saving the weight parameters as the first weight parameters.
[0029] The first model is fine-tuned by taking the small-scale fire image dataset in the preprocessed fire image dataset as the first target domain and the first weight parameter as the initial parameter for training the first target domain. A second model that meets the preset conditions is determined and the weight parameter is saved as the second weight parameter.
[0030] The second model is fine-tuned again by taking the fire image datasets of different traction stations in the preprocessed fire image dataset as the second target domain and taking the second weight parameters as the initial parameters for training the second target domain. A third model that meets the preset conditions is determined and the weight parameters are saved. The third model is then used as the trained model.
[0031] A second aspect of this application provides a traction substation fire detection device, the device comprising:
[0032] The preprocessing module is used to preprocess a preset fire image dataset to obtain a preprocessed fire image dataset; wherein each image in the fire image dataset includes three color RGB channels, and the preprocessing includes noise reduction and labeling.
[0033] The training module is used to train a preset fire image recognition model based on the preprocessed fire image dataset to obtain a normal fire recognition model.
[0034] The transfer learning module is used to perform transfer learning on the normal fire identification model based on the preprocessed fire image dataset to obtain a trained model.
[0035] The prediction module is used to identify images of the traction station using the trained model, so as to determine whether a fire has occurred at the traction station based on the identification results.
[0036] A third aspect of this application provides a computer-readable storage medium storing a computer program that can be executed by one or more processors to implement the steps of the method described above.
[0037] A fourth aspect of this application provides a computer program product comprising a computer program or instructions that, when executed by a processor, implement the steps of the method described above.
[0038] A fifth aspect of this application provides an electronic device including a memory and one or more processors, wherein a computer program is stored on the memory, and the memory and the one or more processors are communicatively connected to each other, wherein when the computer program is executed by the one or more processors, it implements the steps of the method described above.
[0039] Compared with the prior art, the technical solution of this application has the following advantages or beneficial effects:
[0040] The traction substation fire identification method disclosed in this application employs a self-attention mechanism to automatically extract salient features of the fire and traditional features, avoiding the loss of salient fire image features that deep learning often does. Furthermore, it utilizes transfer learning, using normal fire images as the source domain and various traction substation fire detection and small-scale fire images as the target domain. This effectively identifies small-scale fire data, thereby preventing further fire escalation and unnecessary losses. Simultaneously, it can effectively identify various substation fires, saving time and space costs, and possesses strong universality and scalability. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0042] It should also be noted that, for ease of description, only the parts relevant to this disclosure are shown in the accompanying drawings. The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions in this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0043] Figure 1 A flowchart illustrating a method for identifying fires at traction substations, as provided in this application embodiment;
[0044] Figure 2 A block diagram of a self-attention model provided in an embodiment of this application;
[0045] Figure 3 A CNN fire image recognition block diagram provided for embodiments of this application;
[0046] Figure 4 A schematic diagram of transfer learning provided for an embodiment of this application;
[0047] Figure 5 A schematic diagram of another traction substation fire identification method provided in an embodiment of this application;
[0048] Figure 6 A schematic diagram of the structure of a traction substation fire detection device provided in this application embodiment;
[0049] Figure 7 This is a connection block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0050] The following detailed description of the embodiments of this application, in conjunction with the accompanying drawings, will provide a thorough understanding of how this application uses technical means to solve technical problems and achieve corresponding technical effects, enabling its implementation. The embodiments of this application and the various features within them can be combined with each other without conflict, and all resulting technical solutions are within the protection scope of this application.
[0051] Example 1
[0052] This embodiment provides a method for identifying fires in traction substations, which can be applied to surveillance cameras or fire monitoring systems. Figure 1A flowchart of a traction substation fire identification method provided in this application embodiment is shown below. Figure 1 As shown, the method disclosed in this embodiment includes the following steps:
[0053] Step 110: Preprocess the preset fire image dataset to obtain the preprocessed fire image dataset; wherein, each image in the fire image dataset includes three color RGB channels, and the preprocessing includes noise reduction and labeling.
[0054] In some embodiments, the preset fire image dataset includes:
[0055] Data sets of images of normal fires, images of small-scale fires, and images of fires at different traction stations, etc.
[0056] Optionally, first acquire normal fire image datasets, small-scale fire image datasets, and fire image datasets from different traction substations, and then unify these datasets as a preset fire image dataset. Specifically, other types of fire image datasets can be added to the preset fire image dataset according to actual needs; no specific limitations are specified here.
[0057] As an example, the specific method may include: using the publicly available Foggia dataset for normal fire images (a video fire dataset), processing it to obtain 140 images (or pictures) of fires occurring and 170 normal images; acquiring images of small-scale fires in real time, resulting in 150 images of fires occurring and 150 normal images; and acquiring images of fires at different traction substations in real time, from five different traction substations, with 20 images of fires occurring at each substation and 20 normal images, for a total of 200 images in the dataset. All images are color RGB three-channel images.
[0058] In some embodiments, the de-drying process includes:
[0059] All images in the preset fire image dataset are adjusted to a preset size, and all images are converted into an image matrix of a preset size;
[0060] The image matrix is de-noiseed using a total variational model.
[0061] Optionally, the preset size can be set according to actual needs, but all images in the dataset must be processed to the same size; the preset size image matrix includes: a 3-channel 256x256 image matrix.
[0062] As an example, the preprocessing process may specifically include the following steps:
[0063] S111. Process all fire images to the same size and convert all images into a 3-channel 256x256 image matrix;
[0064] S112. Denoise all fire image matrices using a total variation (TV) model. TV is an anisotropic model that smooths images by relying on gradient descent flow. It aims to smooth the image as much as possible inside the image while leaving the image edges as unsmoothed as possible.
[0065] S113. Label all images in the dataset, for example: 1 for a fire and 0 for no fire.
[0066] Step 120: Train the preset fire image recognition model based on the preprocessed fire image dataset to obtain a normal fire recognition model.
[0067] In some embodiments, training a preset fire image recognition model based on the preprocessed fire image dataset to obtain a normal fire recognition model includes:
[0068] Feature extraction is performed on the images in the preprocessed fire image dataset to obtain the traditional fire features in each image.
[0069] The fire features are automatically extracted from the images in the preprocessed fire image dataset by using a preset self-attention model.
[0070] The traditional features and the automatically extracted fire features are fused to obtain fused features, and all the fused features are used as input data to train a preset fire image recognition model to obtain the normal fire recognition model.
[0071] In some embodiments, the conventional features include:
[0072] Flame characteristics and / or smoke characteristics; wherein,
[0073] The flame characteristics include one or more of the following: RG area component ratio, roundness, and sharp corners;
[0074] The smoke characteristics include one or more of the following: area change rate, correlation coefficient, similarity, and overall mobility characteristics.
[0075] As an example, traditional feature extraction may include the following steps:
[0076] S121. Extract flame features from the fire image. Flame features may include: RG area component ratio, roundness, and sharp corners, etc.
[0077] S122. Extract smoke features from fire images. Smoke features may include: area change rate, correlation coefficient, similarity and overall mobility features, etc.
[0078] In an RGB space image, the color of the flame pixels exhibits the following characteristics:
[0079]
[0080] Among them, R mean The threshold for the red portion of a pixel is, in this embodiment, processed as the average value of pixels in the red channel, where K is the sample width of the red channel, set to 256 in this embodiment. i ,y i Let be the i-th pixel, and R(x) i ,y i ) is the pixel point (x i ,y i R(x,y) is the red component of pixel (x,y) in the red channel, and G(x,y) and B(x,y) are the components of pixel (x,y) in the green and blue channels, respectively.
[0081] The three primary color components of the flame image satisfy the following conditions:
[0082] R(x,y)>200,G(x,y)<200,B(x,y)<100
[0083] Optionally, pixels are processed sequentially from the top left corner to the right of the image. If there are no pixels on the right side of the image (i.e., the values of the red, green, and blue channels on the right side are all 0), then the color of that pixel is changed to black. This S-shaped method is used to examine all pixels of the image. If 60% of the pixels satisfy the following characteristics:
[0084] R(x,y)>G(x,y)>B(x,y)and
[0085] R(x,y)>200,G(x,y)<200,B(x,y)<100
[0086] Therefore, it can be assumed that there is an image of a flame in this connected region.
[0087] Flames are often accompanied by smoke, which contains many characteristic parameters. Using only a smoke color model algorithm to distinguish images is insufficient; other features must be extracted. Early smoke from combustion is typically steel-gray, with its three primary colors (R, G, B) having essentially the same values. α can be used as a similarity measure, and based on the similarity measurement equation, the final result α∈[0,20]. After applying the HIS color model, many images can be processed to obtain a hue range H, with values ranging from 175°≤H≤185°. H can be used to distinguish fire areas in images.
[0088] In the smoke color model, the similarity of color distance in the HIS model must be compared between pixels that satisfy the parameter condition (α∈[0,20]) and the reference pixel. Let pixel y satisfy the requirements, let its three components in the HIS model be h,i,s, and let the spatial distance x,y between two pixels be D, then:
[0089]
[0090] The equations for V1, V2, and V3 are as follows:
[0091]
[0092] Optionally, during automatic feature extraction, the preprocessed fire image dataset is used as input data to construct a self-attention model to automatically acquire fire features; the attention model diagram can be found in [reference needed]. Figure 2 , Figure 2 A block diagram of a self-attention model provided in an embodiment of this application.
[0093] As an example, the denoised image is used as the input to the self-attention model. First, three 1×1 convolutional layers are used to transform the input image into three different feature spaces, resulting in three identical feature matrices, A, B, and C.
[0094] Then, A is transposed and multiplied by B. After passing through the softmax function, the attention matrix is obtained, expressed as:
[0095]
[0096] Multiplying it by C yields the final self-attention feature matrix, expressed as Attention(X, X, X) = Sigmoid(Conv(X)T*Conv(X))*Conv(X), where X represents the input image.
[0097] As an example, the preset fire image recognition model includes the CNN fire recognition model.
[0098] Optional, the CNN fire identification model can be referenced. Figure 3 , Figure 3 This application provides a CNN fire image recognition flowchart. After fusing the acquired traditional features and the features automatically acquired by the attention model, the fused features are used as input data. First, two 5x5 convolutions and a 2x2 pooling are performed, followed by a 3x3 pooling. After Flattening, the results are obtained by applying dropout and the Sigmoid activation function.
[0099] Optionally, the normal fire image dataset in the preprocessed fire image dataset can be used as the source domain to train the preset fire image recognition model to obtain the normal fire recognition model.
[0100] Step 130: Perform transfer learning on the normal fire recognition model based on the preprocessed fire image dataset to obtain a trained model.
[0101] In some embodiments, the step of performing transfer learning on the normal fire identification model based on the preprocessed fire image dataset to obtain a trained model includes:
[0102] The normal fire image dataset in the preprocessed fire image dataset is used as the source domain to train the normal fire identification model, thereby obtaining the first model and saving the weight parameters as the first weight parameters.
[0103] The first model is fine-tuned by taking the small-scale fire image dataset in the preprocessed fire image dataset as the first target domain and the first weight parameter as the initial parameter for training the first target domain. A second model that meets the preset conditions is determined and the weight parameter is saved as the second weight parameter.
[0104] The second model is fine-tuned again by taking the fire image datasets of different traction stations in the preprocessed fire image dataset as the second target domain and taking the second weight parameters as the initial parameters for training the second target domain. A third model that meets the preset conditions is determined and the weight parameters are saved. The third model is then used as the trained model.
[0105] In some possible cases, the weight parameters obtained when the normal fire identification model is obtained in step 120 can be saved as the first weight parameters, and the normal fire identification model obtained in step 120 can be used as the first model.
[0106] As an example, feature fusion can be performed by combining two feature matrices.
[0107] Optionally, images of fires at different traction substations and small-scale fires can be transferred to normal fire images to improve the model's adaptability and robustness. A diagram illustrating transfer learning can be found here. Figure 4 , Figure 4 This is a schematic diagram of transfer learning provided in an embodiment of this application.
[0108] Optionally, determining and saving the model that meets the preset conditions can be done by saving the fine-tuned model and its weight parameters that yield the best results.
[0109] As an example, transfer learning may specifically include the following steps:
[0110] S131. Using the normal fire image dataset in the preprocessed fire image dataset as the source domain, train the preset fire image recognition model and save the model and weight parameters.
[0111] S132. Take the small-scale fire image dataset in the preprocessed fire image dataset as the target domain, feed it into the model of the source domain, and use the weight parameters of the source domain as the initial parameters for training the target domain to fine-tune it, and save the fine-tuned model and weight parameters with the best results.
[0112] S133. Finally, the fire image datasets of different traction stations in the preprocessed fire image dataset are used as the second target domain. The model and parameters saved in step S132 are used as the initial model and parameters of this target domain. Fine-tuning is performed again, and the fine-tuned model and weight parameters with the best result are saved.
[0113] Optionally, the normal fire image dataset, the small-scale fire image dataset, and the fire image datasets of different traction stations can be input into the model trained in step S133 for identification to determine whether a fire has occurred in the image.
[0114] As an example, in the specific implementation process, using Let x represent the source domain, where x s Representing the feature space, y s Represents the tag space; T S The source conditional probability distribution P(y) is used. S |x S ) represents the task in the source domain, where use and T T This represents the target domain and the tasks within it; the goal of transfer learning is to utilize the data from... and T S The information obtained improves learning P(y) T |x T ),in Or T S ≠TT .
[0115] The pre-training process involves minimizing the loss function L on the source domain data. s (Loss Function, abbreviated as L) S ), thus obtaining the model parameters θ:
[0116]
[0117] The pre-trained model serves as the initial model for the target domain. Then, based on this initial model, the pre-trained network parameters θ′ are further trained using target domain data. The remaining parameters remain unchanged:
[0118]
[0119] When θ′=θ, the entire pre-trained network is fine-tuned in the target domain;
[0120] when At this time, no fine-tuning occurs, and the pre-trained network is directly used in the target domain to obtain a transfer learning network model, that is, a trained neural network model.
[0121] In steps S131 to S133 above, the five-fold cross-validation method can be used in all processes of model training, which can avoid data that is too good or too bad, and make the results more consistent with reality.
[0122] Step 140: The trained model is used to identify the image of the traction station, and the identification result is used to determine whether the traction station is on fire.
[0123] Optionally, an image of the traction substation can be used as input, and a trained model can be used to identify the image of the traction substation to determine whether a fire has occurred at the traction substation based on the identification result. The input image can be one or more images, or it can be a video stream.
[0124] Furthermore, for easier understanding of the technical solution of this application, please refer to [the relevant documentation]. Figure 5 , Figure 5 This is a schematic diagram of another traction substation fire identification method provided in an embodiment of this application.
[0125] The traction substation fire identification method provided in this embodiment employs a self-attention mechanism and a feature fusion model, which can effectively extract significant fire features. Using transfer learning, it can detect various traction substation fires and small-scale fires, and is applicable to various substation fire datasets with high identification efficiency. Specifically, it includes: preprocessing a preset fire image dataset to obtain a preprocessed fire image dataset; wherein each image in the fire image dataset includes three color RGB channels, and the preprocessing includes noise reduction and labeling; training a preset fire image recognition model based on the preprocessed fire image dataset to obtain a normal fire identification model; performing transfer learning on the normal fire identification model based on the preprocessed fire image dataset to obtain a trained model; and using the trained model to identify images of traction substations to determine whether a fire has occurred in the traction substation based on the identification result. The traction substation fire identification method disclosed in this embodiment can effectively identify small-scale fire data, thereby effectively preventing further fire spread and unnecessary losses. It can also effectively identify various substation fires, saving time and space costs, and has strong universality and scalability.
[0126] Example 2
[0127] This embodiment provides a traction substation fire detection device. This device embodiment can be used to execute the method embodiment of this application. For details not disclosed in this device embodiment, please refer to the method embodiment of this application. Figure 6 This is a schematic diagram of the structure of a traction substation fire detection device provided in an embodiment of this application, as shown below. Figure 6 As shown, the apparatus 600 disclosed in this embodiment includes:
[0128] The preprocessing module 601 is used to preprocess a preset fire image dataset to obtain a preprocessed fire image dataset; wherein each image in the fire image dataset includes three color RGB channels, and the preprocessing includes noise reduction and labeling.
[0129] Training module 602 is used to train a preset fire image recognition model based on the preprocessed fire image dataset to obtain a normal fire recognition model.
[0130] The transfer learning module 603 is used to perform transfer learning on the normal fire recognition model based on the preprocessed fire image dataset to obtain a trained model.
[0131] The prediction module 604 is used to identify the image of the traction station using the trained model, so as to determine whether the traction station has caught fire based on the identification result.
[0132] In some embodiments, the training module 602 includes: a first extraction unit, a second extraction unit, and a fusion training unit; wherein...
[0133] The first extraction unit is used to extract features from the images in the preprocessed fire image dataset to obtain the traditional features of the fire in each image.
[0134] The second extraction unit is used to automatically extract fire features from the images in the preprocessed fire image dataset using a preset self-attention model, thereby obtaining automatically extracted fire features.
[0135] The fusion training unit is used to perform a fusion operation on the traditional features and the automatically extracted fire features to obtain fused features, and to use all the fused features as input data to train a preset fire image recognition model to obtain the normal fire recognition model.
[0136] In some embodiments, the preset fire image dataset includes:
[0137] Normal fire image dataset, small-scale fire image dataset, and fire image datasets from different traction stations.
[0138] In some embodiments, the de-drying process includes:
[0139] All images in the preset fire image dataset are adjusted to a preset size, and all images are converted into an image matrix of a preset size;
[0140] The image matrix is de-noiseed using a total variational model.
[0141] In some embodiments, the conventional features include:
[0142] Flame characteristics and / or smoke characteristics; wherein,
[0143] The flame characteristics include one or more of the following: RG area component ratio, roundness, and sharp corners;
[0144] The smoke characteristics include one or more of the following: area change rate, correlation coefficient, similarity, and overall mobility characteristics.
[0145] In some embodiments, the transfer learning module 603 includes: a first training unit, a second training unit, and a third training unit; wherein...
[0146] The first training unit is used to train the normal fire image dataset in the preprocessed fire image dataset as the source domain to obtain the first model and save the weight parameters as the first weight parameters.
[0147] The second training unit is used to fine-tune the first model by taking the small-scale fire image dataset in the preprocessed fire image dataset as the first target domain and the first weight parameter as the initial parameter for training the first target domain, to determine the second model that meets the preset conditions and to save the weight parameter as the second weight parameter.
[0148] The third training unit is used to take the fire image datasets of different traction stations in the preprocessed fire image dataset as the second target domain and the second weight parameters as the initial parameters for training the second target domain to fine-tune the second model again, determine the third model that meets the preset conditions and save the weight parameters, and use the third model as the trained model.
[0149] Those skilled in the field can understand that Figure 6 The structures shown do not constitute a limitation on the apparatus of the embodiments of this application. They may include more or fewer modules / units than shown, or combine certain modules / units, or have different module / unit arrangements.
[0150] Those skilled in the art will understand that the modules or steps described above can be implemented using general-purpose computing devices, either centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computing device. Furthermore, in some cases, the steps shown or described can be performed in a different order than presented herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module.
[0151] The apparatus provided in this embodiment includes: a preprocessing module 601, used to preprocess a preset fire image dataset to obtain a preprocessed fire image dataset; wherein each image in the fire image dataset includes three color RGB channels, and the preprocessing includes noise reduction and labeling; a training module 602, used to train a preset fire image recognition model based on the preprocessed fire image dataset to obtain a normal fire recognition model; a transfer learning module 603, used to perform transfer learning on the normal fire recognition model based on the preprocessed fire image dataset to obtain a trained model; and a prediction module 604, used to identify images of traction substations using the trained model, and determine whether a fire has occurred in the traction substation based on the identification result. This apparatus can effectively identify small-scale fire data, thereby effectively preventing the further spread of fires and unnecessary losses. It can also effectively identify various substation fires, saving time and space costs, and has strong universality and scalability.
[0152] Example 3
[0153] Based on the foregoing embodiments, this embodiment provides a computer-readable storage medium. This computer-readable storage medium stores a computer program, which, when executed by a processor, can implement the method steps as described in the foregoing method embodiments; these steps will not be repeated here.
[0154] Computer-readable storage media may individually include computer programs, data files, data structures, etc., or combinations thereof. The computer-readable storage media or computer program may be specifically designed and understood by those skilled in the art of computer software, or the computer-readable storage media may be known and available to those skilled in the art of computer software. Examples of computer-readable storage media include: magnetic media, such as hard disks, floppy disks, and magnetic tapes; optical media, such as CD-ROMs and DVDs; magneto-optical media, such as optical discs; and hardware devices specifically configured to store and execute computer programs, such as read-only memory (ROM), random access memory (RAM), flash memory; or servers, application stores, etc. Examples of computer programs include machine code (e.g., code generated by a compiler) and files containing high-level code that can be executed by a computer using an interpreter. The described hardware devices may be configured to function as one or more software modules to perform the operations and methods described above, and vice versa. Furthermore, computer-readable storage media may be distributed across networked computer systems, allowing for the decentralized storage and execution of program code or computer programs.
[0155] Example 4
[0156] Based on the foregoing embodiments, this embodiment provides a computer program product. This computer program product includes a computer program or instructions, which, when executed by a processor, implement the method steps as described in the foregoing method embodiments; these will not be repeated here.
[0157] Example 5
[0158] Based on the foregoing embodiments, this embodiment provides an electronic device. Figure 7 A connection block diagram of an electronic device provided in an embodiment of this application, such as... Figure 7 As shown, the electronic device 700 may include: one or more processors 701, memory 702, multimedia components 703, input / output (I / O) interface 704, and communication components 705.
[0159] One or more processors 701 are used to execute all or part of the steps as described in the foregoing method embodiments. Memory 702 is used to store various types of data, which may include, for example, instructions for any application or method in the electronic device, as well as application-related data.
[0160] One or more processors 701 may be implemented as an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a controller, a microcontroller, a microprocessor, or other electronic components, for performing the methods as described in the foregoing method embodiments.
[0161] The memory 702 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.
[0162] Multimedia component 703 may include a screen, which may be a touchscreen, and an audio component for outputting and / or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory or transmitted via a communication component. The audio component also includes at least one speaker for outputting audio signals.
[0163] I / O interface 704 provides an interface between one or more processors 701 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons can be virtual buttons or physical buttons.
[0164] The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wired communication includes communication via network ports, serial ports, etc.; wireless communication includes Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, 5G, or one or more combinations thereof. Therefore, the corresponding communication component 705 may include a Wi-Fi module, a Bluetooth module, and an NFC module.
[0165] In summary, this application provides a method, apparatus, computer-readable storage medium, computer program product, and electronic device for identifying traction substation fires. The method can effectively extract significant fire features and employs transfer learning to detect various traction substation fires and small-scale fires. It is applicable to various substation fire datasets and has high identification efficiency. Specifically, it includes: preprocessing a preset fire image dataset to obtain a preprocessed fire image dataset; wherein each image in the fire image dataset includes three color RGB channels, and the preprocessing includes noise reduction and labeling; training a preset fire image recognition model based on the preprocessed fire image dataset to obtain a normal fire recognition model; performing transfer learning on the normal fire recognition model based on the preprocessed fire image dataset to obtain a trained model; and using the trained model to identify images of traction substations to determine whether a fire has occurred in the traction substation based on the identification result. The traction substation fire identification method disclosed in this embodiment can effectively identify small-scale fire data, thereby effectively preventing the further spread of fires and unnecessary losses. It can also effectively identify various substation fires, saving time and space costs, and has strong universality and scalability.
[0166] It should also be understood that the methods or systems disclosed in the embodiments provided in this application can also be implemented in other ways. The method or system embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functions, and operations of possible implementations of methods and apparatus according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, computer program segment, or part of a computer program, which includes one or more computer programs for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings, and may actually be executed substantially in parallel. They may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer programs.
[0167] In this application, the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "including one..." does not exclude the presence of other identical elements in the process, method, apparatus, or device that includes the element; the use of terms such as "first" and "second" is for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly indicating the number or sequence of the indicated technical features; in the description of this application, unless otherwise stated, the terms "multiple" or "many" mean at least two; if a server is described, it should be noted that a server can be an independent physical server or terminal, or a server cluster consisting of multiple physical servers, or a cloud server capable of providing basic cloud computing services such as cloud servers, cloud databases, cloud storage, and CDN; if a smart terminal or mobile device is described in this application, it should be noted that a smart terminal or mobile device can be a mobile phone, tablet computer, smartwatch, netbook, wearable electronic device, personal digital assistant (PDA), augmented reality (AR) device, virtual reality (VR) device, smart TV, smart speaker, personal computer (PC). Computer (PC) etc., but not limited to these, this application does not make any special restrictions on the specific form of smart terminals or mobile devices.
[0168] Finally, it should be noted that in the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "a single example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0169] Although embodiments of this application have been shown and described above, it is to be understood that the above embodiments are exemplary and the content is only for the purpose of facilitating understanding of this application, and is not intended to limit this application. Any person skilled in the art to which this application pertains may make any modifications and changes in form and detail of the implementation without departing from the spirit and scope disclosed in this application, but the scope of protection of this application shall still be determined by the scope defined in the appended claims.
Claims
1. A method of fire identification by traction, characterized in that, The method includes: A preprocessed fire image dataset is obtained by preprocessing a preset fire image dataset; wherein each image in the fire image dataset includes three color RGB channels, and the preprocessing includes noise reduction and labeling. Training a preset fire image recognition model on the preprocessed fire image dataset to obtain a normal fire recognition model includes: extracting features from the images in the preprocessed fire image dataset to obtain traditional fire features in each image; automatically extracting fire features from the images in the preprocessed fire image dataset using a preset self-attention model to obtain automatically extracted fire features; fusing the traditional features and the automatically extracted fire features to obtain fused features, and using all the fused features as input data to train the preset fire image recognition model to obtain the normal fire recognition model; wherein the traditional features include: flame features and / or smoke features; wherein the flame features include: RG area component ratio, roundness, and sharp corners, or one or more of these; and the smoke features include: area change rate, correlation coefficient, similarity, and overall mobility features, or one or more of these. The normal fire identification model is transferred to the preprocessed fire image dataset to obtain a trained model, including: using the normal fire image dataset in the preprocessed fire image dataset as the source domain to train the normal fire identification model, obtaining a first model and saving the weight parameters as first weight parameters; using the small-scale fire image dataset in the preprocessed fire image dataset as the first target domain and using the first weight parameters as the initial parameters for training the first target domain to fine-tune the first model, determining a second model that meets preset conditions and saving the weight parameters as second weight parameters; using the fire image datasets of different traction stations in the preprocessed fire image dataset as the second target domain and using the second weight parameters as the initial parameters for training the second target domain to fine-tune the second model again, determining a third model that meets the preset conditions and saving the weight parameters, and using the third model as the trained model; The trained model is used to identify images of the traction substation, and the identification results are used to determine whether a fire has occurred at the traction substation.
2. The fire identification method of claim 1, wherein, The noise reduction process includes: All images in the preset fire image dataset are adjusted to a preset size, and all images are converted into an image matrix of a preset size; The image matrix is denoised using a total variational model.
3. A fire detection apparatus for use in traction applications employing the method of claim 1, wherein, include: The preprocessing module is used to preprocess a preset fire image dataset to obtain a preprocessed fire image dataset; wherein each image in the fire image dataset includes three color RGB channels, and the preprocessing includes noise reduction and labeling. The training module is used to train a preset fire image recognition model based on the preprocessed fire image dataset to obtain a normal fire recognition model. The transfer learning module is used to perform transfer learning on the normal fire recognition model based on the preprocessed fire image dataset to obtain a trained model. The prediction module is used to identify images of the traction station using the trained model, and to determine whether a fire has occurred at the traction station based on the identification results.
4. A computer program product comprising computer programs or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method as described in any one of claims 1 or 2.
5. A computer readable storage medium, characterized in that, The computer program stored in the computer-readable storage medium, when executed by one or more processors, implements the steps of the method as described in any one of claims 1 or 2.
6. An electronic device, comprising: The method includes a memory and one or more processors, wherein a computer program is stored in the memory, and the memory and the one or more processors are communicatively connected to each other. When the computer program is executed by the one or more processors, the steps of the method as described in any one of claims 1 or 2 are performed.