1. Introduction
Fire incidents are now viewed as one of the quickest and most destructive threats to humankind, infrastructure, and ecosystems worldwide. Taken together, climate change, rapid urbanization, and unprecedented population growth have greatly increased the number and intensity of fire incidents both inside and outside. Therefore, the early detection of fire and smoke is not only a technical goal but is also essential for protecting public safety. Traditional fire detection systems, such as thermal detectors and photoelectric smoke detectors, rely on the physical distance from the ignition source and do not provide any spatial information on the location, rate of spread, or size of any currently burning fire incident. In addition to these challenges, human factors have a negative impact on responsiveness to fire incidents, such as reduced levels of attention, impaired visibility, and malfunctioning equipment. These challenges result in delayed responses to fires, which increases property damage and loss of life.
Global statistical evidence emphasizes the significance of this issue. The National Fire Agency reported 38,659 fire incidents in Korea in 2020. Approximately 64.5% of fire incidents occur in buildings and human-made structures, resulting in 82.2% of fire-related fatalities, 82.6% of injuries, and 88% of total losses due to fire [
1]. In the USA, 2020 statistics indicated that 74% of fire-related fatalities and 76% of fire-related injuries were due to fire incidents [
2]. Historical documentation in London states that 78% of fire fatalities in that area occurred in residential and commercial buildings from 1996 to 2000 [
3]. Additionally, 39% of fire fatalities in China from 2007 to 2010 were attributed to residential fires [
4]. These statistics show the urgent need for scalable technological solutions for fire detection systems in built environments.
The extensive deployment of CCTV camera infrastructure installed in cities provides a comprehensive foundation for continuous computer vision or visual observation methods enabling automated detection and suppression systems that can operate continuously in large areas and provide localized spatial alerts without the need for human users [
5]. Previous methods using computer vision were based on identifying hand-crafted features from color, texture, contour, and motion analysis, which were accomplished through the use of traditional classifiers (SVM, random forests, naive Bayes, etc.) to classify fires and their causes [
6,
7]. Although these approaches created initial benchmarks, they had difficulty delivering true, consistent results owing to the many different appearances of fires (morphology, color, shape, and intensity), lighting conditions (absolute, relative, direction, and intensity), and environmental contexts (type of building, structure type, and climate) in which the fire occurred. In the last few years, the evolution of deep learning technology and advancements in automated feature extraction through deep convolutional neural networks (CNN) and, more recently, attention-based transformer architectures have enabled powerful improvements in the automated identification of fires and their causes.
Video-based methods for detecting fires can vary noticeably based on the user’s preferences. One group of methods uses techniques associated with conventional machine learning approaches. These methods often have many limitations: 1. They typically require a proprietary dataset that is unique to certain organizations; 2. they do not provide consistent assessments of their overall accuracy; and 3. they cannot readily provide an accurate assessment of the fire’s location, size, and/or rate of spread until after the initial ignition occurs, which can delay or prevent a timely response (and therefore could result in additional damage) [
8]. The second group contains approaches based on recent advances in deep learning. These approaches have been successful in yielding better results overall with respect to their ability to detect fires; however, their high computational cost, coupled with the relatively high inference time required, makes real-time operational deployment difficult to achieve in security cameras [
9,
10].
The development and rise of transformer-based architectures have changed the manner in which we approach computer vision and how the global context is modeled in vision applications to a higher degree than that accomplished by convolutional-only techniques. By treating pictures as sequentially arranged patches of a fixed size (several thousand by several thousand), the Vision Transformer (ViT) obtains long-range spatial dependencies in pictures using multiple heads through the process of self-attention. However, one of the biggest issues that standard ViTs face is that they waste computational resources because some of the attention heads create overlapping or trivial representations of the same object or type of object, thus contributing a very small amount to producing the final result. This is particularly costly in the case of real-time surveillance, where low latency is crucial for success. Attention head pruning is the process of removing low-impact heads based on their score given from gradients to reduce the overall cost of inference while maintaining or improving the quality of representation, making attention head pruning a natural optimization technique for implementing resource-constrained smart cities.
Object localization, like feature extraction, is an essential foundation for the reliable detection of fires. An object is predicted directly via a DEtection TRansformer (DETR) DL approach without the use of anchor boxes and a global loss concept that replaces the use of non-maximal suppression. The SmartFire Vision (S-V) method combines patch-level global information from E-ViT and bounding-box-level spatial information from DETR to produce a more comprehensive and simultaneous multi-scale of fire and smoke in the same video image. This complex interplay will help separate ambiguous early signs of fire from true ignition events so they can be correctly located and will help reduce false alarms.
In response to the aforementioned limitations, this study proposes a hybrid deep learning approach using an Efficient Vision Transformer (E-ViT) combined with a Detection Transformer (DETR) to detect fire and smoke from video streams. The central contribution of this work is the joint architecture itself—specifically, the RIAH pruning mechanism applied within a ViT–DETR hybrid—rather than any single component in isolation; RIAH, DETR integration, and gated fusion are evaluated individually in the ablation study (
Section 4.6) to isolate their respective contributions. The following are the primary contributions of this study. A novel feature extraction technique using E-ViT augmented with the Removing Inefficient Attention Heads (RIAH) technique is introduced, thereby providing reduced computational overhead without accompanying loss in global context modeling capacity by selectively removing redundant multi-head self-attention heads from the multi-head self-attention layers of the transformer encoder architecture.
A DEtection TRansformer (DETR) is attached to the E-ViT encoder. Using DETR in addition to E-ViT allows accurate object locations and context information to be obtained. This added capability helps to identify areas that contain fire and smoke in a video frame with bounding box-level accuracy. By implementing a gated fusion feature that combines (1) E-ViT’s global patch representations and (2) object/special encoding representations from the DETR, the E-ViT creates a fully connected classification engine (head) with a probabilistic threshold alarm system for a quick response in video-based surveillance systems.
The remainder of this paper is organized as follows:
Section 2 presents a thorough review of the existing research on fire and smoke detection.
Section 3 develops the basis for the SmartFire Vision methodology in detail, including the E-ViT architecture, pruning strategy (RIAH), integration (DETR), fusion of features, and classification pipelines.
Section 4 summarizes the experimental setup, evaluation metrics, quantitative results, baseline comparisons, ablation study, and computational efficiency analyses.
Section 5 contains a detailed discussion of the results, limitations, and practical considerations regarding the deployment of the SmartFire Vision system.
Section 6 summarizes the conclusions and presents ideas for future research on this topic.
2. Related Works
The subjects of fire safety, smart cities, and the detection of wildfires via deep learning and machine learning technology, as well as their recent developments, are considered. Over the last decade, forest fires have become a serious global problem owing to population growth and climate change. This leads to climate change and greenhouse effects. The number of wildfires triggered has increased significantly compared to population growth. The secret to managing this sudden event is quick and precise monitoring [
11]. The latest release of Detectron2 improves the methods for identifying and classifying brushfires using deep learning technology. During both day and night, the system can detect even the smallest flames from a distance.
The Detectron2 approach is beneficial because it helps track the target at a distance. Earlier studies by [
12] helped in developing methods for detecting and categorizing fires, which would ensure the full protection of forest life. There has been insufficient research on the real-time detection of fires and fire detection and alert systems. Therefore, Gaur et al. [
6] suggested a solution that uses IoT along with YOLOv5. In this study, the authors introduced Fire-Net, a deep learning model that was used on Landsat-8 images to detect burning biomass as well as fires. To ensure better clarity, the images were combined using both optical (RGB) and thermal (heat) images. In addition, the model can also derive some additional features from a sparse dataset using residual convolution blocks and separable convolution blocks.
According to recent research [
13,
14], modern deep learning technologies are employed in the design of computer vision-based fast fire detection systems to overcome the drawbacks of conventional fire detectors and remove false alarms. At this point, more supportive research on the development of an indoor video fire detection model that can be tested in reality is desired, but it does not exist at the moment. Researchers have employed a CCTV monitoring system in a building to create an EFDM based on computer vision to detect fire immediately when it appears in the building.
This study outlines a smart fire detection system [
15], which represents an advanced technique for fire detection in smart cities that utilizes the advantages of the YOLOv8 algorithm and deep learning technologies to identify fire characteristics as they occur. The SFDS is expected to be much more reliable than the old fire detection methods, have fewer false alarms, and reduce costs. This technology can be applied for gas leak detection and flood monitoring, among other issues in smart cities. It can also be extended to gas leak detection and flood monitoring in smart cities. The proposed smart city structure consists of four main layers: (i) application, (ii) fog, (iii) cloud, and (iv) IoT. Combining Fog and Cloud computing with the Internet of Things layer leads to improved response times and minimization of threats to property and human lives owing to the efficiency of the proposed algorithm in terms of data collection and processing.
The authors of [
16] presented a fire recognition network built using a transformer architecture. The architecture takes a frame as input and computes the attention scores based on the encoded input. In this respect, the highest scores correspond to the areas of the input image that provide crucial information for accurate fire detection. The experiments showed that the network could localize the fire in the analyzed frame very reliably and accurately. The proposed approach was tested in terms of tasks such as frame classification and fire localization.
Fire detection techniques based on computer vision systems have undergone several changes over the years. Convolutional neural networks (CNNs) have emerged as the most effective technique for fire detection. Several machine learning techniques have encountered issues in detecting signs of smoke and fire. In the case of smoke and fire, the learning task is more complex because of the entangled variability presented by these two phenomena. In their study [
17], the authors proposed a method for fire detection that works through the analysis of both spatial (visual features) and temporal indicators. The first step of this combined approach involves understanding the appearance of visual indicators of fire events. The second step involved the analysis of the evolution of these fires (temporal processing).
A recent study [
18] presents a new approach for fire detection through transfer learning based on some highly advanced CNNs that have been trained on images of fires in the real world. What sets this model apart from other advanced models is the attention mechanism and Grad-CAM, which determines the specific location of the fire. The results of this system are quite impressive. Among all the models used by the scientists, EfficientNetB0 proved to be the most effective in fire detection.
In this study, a novel wavelet-CNN technique is introduced [
19]. The technique processes an image using the 2D Haar transformation to derive the spectral information of the image and feeds its value into a CNN model at different layer levels to build advanced systems for recognizing fire images. The technique was evaluated using two famous backbone networks, ResNet50 and MobileNet v2 (MV2). In particular, the results showed that the technique improved fire detection rates without increasing false alarms for MV2 in tests carried out using a common dataset and a video dataset.
Image fire detection as an innovative method for fire prevention has been developed recently [
20]. Image fire detection is based on studying images obtained from video footage using special algorithms to detect fires. This study employs four popular CNN models for object detection: Faster-RCNN, R-FCN, SSD, and YOLO v.3. It is suggested that image fire detection methods based on CNNs have higher accuracy than other approaches.
Since the advent of the ViT model (ViT), there has been a significant surge in the use of transformer-based networks for vision recognition. It has become evident that many pure attention-based models yield results that are at least equivalent, if not superior, to those of CNNs in standard benchmarks, as indicated by Dosovitskiy et al. [
21]. These developments have led to the introduction of ViT into other applications related to dense prediction, such as the detection, segmentation, and localization of abnormal events. The invention of DETR [
22] made it possible to eliminate the need for a multistage process typical of traditional detectors, utilizing a single end-to-end transformer capable of predicting object sets with the help of bipartite matching loss.
The suggestion highlighted in reference [
16] was a transformer encoder–decoder model, which was employed in a fire segmentation video to determine the origin of the fire accurately using information from the attention mechanism. To date, no research has been conducted that integrates ViT-level feature extraction and DETR-level object localization in a seamless manner; hence, there is a need for computational real-time classification of smoke and fire. Smart-Fire Vision fills this gap in the research landscape by introducing a unified architecture based on attention mechanism pruning, which works for both computational optimization and feature quality filtering for the two sub-networks. RIAH differs from prior gradient-based head-pruning approaches (e.g., Michel et al. [
23]) in that pruning is applied jointly across the shared E-ViT/DETR pipeline as both a computational optimization and feature-quality filter, rather than as a standalone compression step.
3. Methodology
SmartFire Vision is an innovative hybrid pipeline that detects fire and/or smoke from video sequences using a combination of an Efficient Vision Transformer (E-ViT) and a DEtection TRansformer (DETR). The SmartFire Vision pipeline takes raw video as input, processes and analyses each frame separately, utilizes E-ViT and DETR for extracting relevant features, fuses both extracted representations using an intelligent gating mechanism, then classifies each frame via use of a fully connected Neural Network (NN) with probabilistic thresholding on classification results as either containing fire or smoke; and triggers a real-time alert system based on confirming that the frame contains either fire or smoke so that SmartFire can be integrated into smart city closed-circuit television (CCTV) surveillance systems. The overall SmartFire Vision pipeline is depicted in
Figure 1 and formalized in Algorithm 1.
| Algorithm 1: Fire and Smoke Detection Using the Hybrid E-ViT-DETR Model |
Input: Video dataset containing fire and smoke sequences with frame-level bounding box annotations Output: Classified frame set , performance metrics , optimized model , and alert signal Stage 1: Preprocessing- 1.
Extract all frames from each video in to form the frame set: - 2.
Obtain ground truth labels for each frame: , where - 3.
Remove duplicate and noisy frames, resize all frames to pixels, and normalize pixel values to
Stage 2: Feature Extraction - 4.
Divide each frame into non-overlapping patches of size pixels: - 5.
Map each patch to a high-dimensional embedding with positional encoding: , where - 6.
Pass all patch embeddings through the E-ViT encoder with RIAH pruning to produce attended representations: , where - 7.
Process each frame through DETR encoder–decoder to produce object-level spatial encodings: , where
Stage 3: Feature Fusion - 8.
Concatenate E-ViT attended representations and DETR object encodings for each frame: , where - 9.
Compute gating vector to adaptively weight each feature source: - 10.
Produce gated fused representation for each frame:
Stage 4: Hybrid E-ViT-DETR Model Training - 11.
Train the fully connected classification head using fused representations: - 12.
Optimize model weights using binary cross-entropy loss with Adam optimizer at learning rate for epochs - 13.
Apply classification threshold to assign frame labels: , where if , else
Stage 5: Alert System - 14.
Initialize the integrated alert system connected to the IoT alarm relay - 15.
For each frame classified as Fire, immediately activate alert:
Stage 6: Evaluation and Optimization - 16.
Test the trained model on unseen holdout data: - 17.
Compute performance metrics on - 18.
Apply RIAH fine-tuning for 3 epochs at learning rate to produce optimized model: - 19.
Return
|
The data used for training and evaluating the system were obtained from a set of annotated videos of fire and smoke events, framed as a binary Fire-vs-Smoke classification task; frames without a fire or smoke event were excluded from the labeled dataset rather than treated as a third class. Every frame was annotated using bounding boxes to indicate the location of the fire or smoke on the screen. The first step in the pipeline is to extract patch-based feature representations of each video frame using E-ViT. Using the Removing Inefficient Attention Heads method on the E-ViT encoder allows us to remove redundant and/or low-importance attention heads from the multi-head self-attention layers, thereby enhancing the computational efficiency of the model while maintaining the quality of the representation process. Each frame of the video is split into fixed-size patches, each of which has its own high-dimensional vector embedding. E-ViT uses self-attention to build linking relationships between all patches, thus creating a single representation of the spatial context of the entire frame as a unified sequence.
The DETR model processes the same frames to identify the objects and their respective spatial bounding boxes within every cover, which produces localization-aware features that are in addition to the global patch embeddings produced by E-ViT. The individual feature vectors generated by each of the two subnetworks are merged through a gated fusion module that adaptively weights each network’s input feature vectors based on the scene being processed by the subnetworks. The fused representation is then provided to a fully connected classification head that classifies the cover as either Fire or Smoke using a thresholding mechanism. If a fire is detected, an alarm will be activated based on the integrated alarm system, causing a real-time alert to be provided.
5. Discussion
The findings of the experimental evaluation of the SmartFire Vision system presented in
Section 4, as a group, demonstrate that SmartFire Vision is a reliable and valid real-world video-surveillance-based fire and smoke detection system with high accuracy and low computational requirements. In addition to providing insight into the effectiveness of each supporting feature of the systems, the results from the evaluation provide a basis for making strong recommendations regarding potential deployment. The overall concept of deploying SmartFire Vision as a part of smart city surveillance infrastructure is shown in
Figure 9.
In addition to producing the expected reduction in the number of floating-point operations (FLOPs), the RIAH head pruning approach produced other benefits, as demonstrated by the ablation study results. Specifically, the pruned model not only performed frame processing at a faster rate but also generalized better to the test set, resulting in the generalization gap (between the training and validation sets) being reduced from approximately 9 pp for the unpruned model to approximately 7 pp for SmartFire Vision. The generalization improvement has been attributed to the regularization impact of removing heads from the model; the removal of heads permits the model to depend on a smaller yet more complete set of attentions, which reduces the effective size of the encoder of the model, thereby dissuading the model from overfitting using training-specific patterns while retaining only the most useful diagnostic representations.
The results of the ablation experiment in
Section 4.6 confirm that the impact of integrating DETR was primarily a gain in recall and that there was a minor reduction in precision. When DETR was removed from the system, recall dropped by 5.86 pp, whereas precision dropped by only 1.35 pp. The asymmetrical behavior is significant from an architectural perspective; the object query mechanism of DETR is designed to allow the detection of spatially defined objects, even when they are a very small percentage (e.g., <5%) of the total area of the frame. For example, in the nascent stages of fire detection, the flame may cover <5% of the pixels in the frame; therefore, the global patch embeddings from E-ViT may average the fire signal with the existing background representation. However, the localized bounding box predictions from DETR provide an explicit high-confidence detection signal in these difficult scenarios and lead to a gain in recall without introducing confounders.
Although SmartFire Vision currently demonstrates several strengths, when evaluating its training performance, as shown in
Figure 3 and
Figure 4, it also demonstrates a limited amount of overfitting within the training dynamics. Given this generalization gap and the single-dataset evaluation, the reported metrics should be interpreted as an upper bound on real-world performance until validated on independent, multi-source fire datasets. There is a 7-percentage-point gap between the training accuracy (95%) and validation accuracy (88%) at epoch 20, which indicates that the model has learned to represent the visual characteristics specific to the FURG dataset rather than learning the underlying generalizable visual characteristics of each fire. This is not surprising, given the relatively small training set (25,091 frames from 19 videos) and the high degree of representational capacity of the ViT-Base encoder, even after pruning. Strategies that future studies could consider for mitigating this may include more aggressive data augmentation, the use of dropout regularization within the classification head, and/or training with a larger and more diverse multi-source fire dataset that combines FURG with both the VisiFire and Corsican Fire benchmarks.
The second limitation relates to the dataset type. The FURG dataset mainly consists of outdoor fire and smoke sequences captured outdoors with good visibility. The performance of SmartFire Vision has not been tested indoors or in tunnels, industrial settings with competing thermal sources, or under rainy, foggy, or night-vision conditions. Real smart city surveillance networks experience many of the same very diverse and challenging conditions. Therefore, future studies should test the robustness of this model within a much wider range of environmental conditions and ensure that large-scale deployment is responsibly recommended.
SmartFire Vision uses a vision transformer-based architecture as the basis, which shows how the capabilities of transformer models can be extended to supporting tasks involving safety [
21]. Specifically, SmartFire Vision’s transformer architecture encompasses the working principle of the attention mechanism of the transformer architecture along with the inherent scalability of self-attention when applied to image classification problems, where consideration of many small parts of the image constitutes a composite recognition process [
21]. SmartFire Vision takes this further by integrating these concepts into an all-in-one object localization architecture that uses no anchor-based proposal or predetermined method of generating proposals for object localization [
22]. Thus, the head-pruning approach taken with SmartFire Vision demonstrates that the number of attention heads associated with the attention mechanism used in this architecture is redundant, considering how many heads will statistically account for all potential proposal points [
23]. The use of Grad-CAM to visualize the classification capabilities of the architecture provides a foundation for interpreting the weights given to each of the features used for image classification [
24]. Attention-based encoder model structure-based experiment results also demonstrate the use of attention in classifier systems with respect to the dataset, considering the dimensionality of the data [
25].
Similar developments in lightweight transformer architectures suitable for resource-constrained deployment, such as multimodal fusion systems that integrate distilled language encoders into small vision backbones, explainable transformer-based systems to perform sensitive sequential classification tasks, and multi-method explainability studies that use vision transformers to support affective computing, indicate the feasibility of using attention-based models in real operational real-time environments [
26], where they can retain their original interpretability. In particular, current research on selective attention pruning in relation to the generalization benefits of the pruning method used in SmartFire Vision highlights the potential of applying a unified transformer-based system across multiple high-stakes classification applications, such as extremist activity detection and propaganda analysis, suggesting a high level of cross-domain maturity among these types of systems [
27]. Overall, the above body of literature positions SmartFire Vision as part of an increasingly mature ecosystem of transformer-based systems that are relied upon to perform safety-critical, real-world inference tasks.