Abstract
Object detection in UAV-based fire rescue scenarios faces multiple challenges, including densely distributed small targets, severe occlusion, and interference from smoke and flames. Existing mainstream detection models, such as the YOLO series, often prioritize inference speed at the expense of modeling global context and spatial positional information, resulting in limited performance in such complex environments. To address these limitations, this paper proposes FirePM-YOLO, an object detection architecture optimized for fire rescue applications. Based on the YOLO framework, the proposed model introduces two key innovations: first, a Position-Aware Enhanced Mamba module (PEMamba) is designed, which incorporates a compact positional encoding mechanism, lightweight spatial enhancement, and an adaptive feature fusion strategy to significantly improve scene perception while maintaining computational efficiency. Second, a PEMBottleneck structure is constructed, which dynamically balances local convolutional features and global PEMamba features via learnable weights. This module is embedded into the shallow layers of the backbone network, forming an enhanced PEM-C3K2 module that captures long-range dependencies with linear complexity while preserving fine local details, thereby enabling holistic contextual understanding of fireground environments. Experimental results on the self-built “FireRescue” dataset demonstrate that compared with the original YOLOv12 and other mainstream detectors, the proposed model achieves improvements in both mean average precision (mAP) and recall while maintaining real-time inference capability. Notably, it exhibits superior detection performance on challenging samples, such as small-scale and partially occluded professional firefighting vehicles.
1. Introduction
With the increasing frequency of natural disasters and accidents worldwide, UAV-based object detection for fire rescue scenarios has become a critical component of modern fire rescue command systems [1]. However, the inherent complexity and unique challenges of these scenarios impose severe demands on existing detection methods. First, UAVs typically adopt a high-altitude, wide-area reconnaissance perspective, resulting in an extremely low pixel proportion of critical targets (e.g., fire trucks and firefighters) within images, constituting a classic small-object detection problem. Traditional methods often suffer from missed detections due to insufficient feature information. Second, the on-scene environment presents extreme visual interference, where dense smoke, flames, water mist, dust, and structural debris severely degrade image quality, manifesting as blurring, reduced contrast, and feature occlusion. This places stricter requirements on the robustness of feature extraction under such extreme conditions. Additionally, target similarity and severe occlusion further exacerbate detection difficulty: specialized rescue vehicles closely resemble ordinary civilian trucks in both color and shape, while dense deployment or complex terrain often leads to partial or complete occlusion of targets, easily causing model confusion and cascading false detections. Consequently, algorithms must be capable of accurately distinguishing similar objects in cluttered environments.
The YOLO (You Only Look Once) series is selected as the foundational architecture based on the following considerations. First, YOLO models are renowned for their exceptional balance between detection accuracy and inference speed, establishing them as the de facto standard for real-time object detection tasks. Given that UAV-based fire rescue scenarios demand immediate and efficient processing to support time-critical decision-making, the real-time capability of YOLO is indispensable. Second, the YOLO framework exhibits strong modularity and flexibility, which facilitates the integration of novel components such as the proposed PEMamba module (Position-Aware Enhanced Mamba; see Figure 1a) without disrupting the overall architecture. Third, the recently released YOLOv12 [2] introduces attention-centric improvements that enhance feature representation while maintaining efficiency, providing a solid and up-to-date baseline for further innovation.
Figure 1.
Overall architecture of PEMamba. (a) The structure of PEMamba. This section illustrates the end-to-end framework of the proposed PEMamba model, detailing the flow of input data through its core components. (b) Spatial feature enhancement. This subfigure demonstrates the mechanism for enhancing spatial features, highlighting how the model emphasizes critical spatial information within the feature maps. (c) Sequentialization and positional encoding. This part depicts the process of transforming 2D feature maps into 1D sequential tokens and the subsequent injection of positional information to retain spatial structure awareness.
Although YOLOv12 excels in general object detection tasks, its design, which is primarily intended for conventional scenarios, introduces inherent limitations when applied to the specific domain of fire rescue. Specifically, fire rescue scenarios present challenges such as complex spatial dependencies, densely distributed small objects, and severe occlusion. However, the backbone network of YOLOv12 still predominantly relies on convolutional operations, lacking effective modeling of global contextual relationships and spatial position awareness. These limitations manifest in three main aspects: a restricted local receptive field that hinders global information capture, insufficient contextual modeling for small objects, and inadequate multi-scale feature fusion mechanisms. Consequently, when processing fire rescue scene images, YOLOv12 struggles to adequately perceive critical targets in complex environments. Therefore, this paper selects YOLOv12 as the baseline model to preserve its real-time detection advantages and attention-enhanced mechanisms while systematically addressing its aforementioned limitations in fire rescue scenarios. By introducing the PEMamba module to enhance global contextual modeling and position awareness, we not only compensate for the shortcomings of the original model but also demonstrate the effectiveness and generalizability of our proposed improvements.
Selective state space models (SSMs), exemplified by Mamba [3], have recently demonstrated remarkable advantages in long-sequence modeling tasks. Their linear computational complexity and favorable scalability position them as strong contenders to Transformers. However, when applying Mamba to computer vision tasks, particularly small object detection, several critical challenges emerge: (1) loss of spatial structural information, as the native 1D sequential design of Mamba necessitates flattening 2D feature maps, thereby disrupting inherent spatial adjacency relations; (2) weakened features of small objects, whose limited pixel coverage leads to feature responses that are easily overwhelmed by larger objects and background noise; (3) insufficient multi-scale adaptability, where fixed-scale positional encodings struggle to meet the localization accuracy requirements for objects of varying sizes; (4) disconnection between local and global information, as Mamba’s global sequence processing may overlook the synergistic relationship between local details and global semantics. VMamba [4] and Vision Mamba [5] have successfully introduced the Mamba architecture into vision tasks, achieving linear computational complexity while maintaining a global receptive field. However, such methods still exhibit notable shortcomings in preserving local details, modeling spatial structures, and achieving practical computational efficiency—particularly in tasks such as small object detection, which demands highly fine-grained local perception. In our experiments, we observed that directly applying modules like Vision Mamba to mainstream detection models such as YOLOv12 still results in high computational complexity, prolonged training time, and low inference efficiency, making it difficult to meet the requirements of real-time scenarios like firefighting and rescue operations. These limitations suggest that pure Vision Mamba architectures may underperform compared to carefully designed CNN-based or hybrid architectures in certain vision tasks.
To systematically address the unique challenges of small object detection in fire rescue scenarios, this paper proposes an innovative dual-path enhancement strategy. Rather than being a simple combination of existing techniques, this strategy delves into the essence of the problem to deeply optimize the feature extraction paradigm. First, we identify a core defect of the Mamba architecture in vision tasks—the positional perception blind spot—and design the Position-Aware Enhanced Mamba (PEMamba) module to resolve it. Second, we overcome the challenge of efficiently integrating state space models with convolutional detection frameworks by seamlessly incorporating PEMamba into YOLOv12, thereby constructing the FirePM-YOLO detection system. Specifically, the main contributions of this paper are summarized as follows:
- (1)
- We uncover the positional perception deficiency of Mamba in visual object detection and propose the PEMamba module to address it. The scanning process of the original Mamba’s state space model inherently collapses two-dimensional spatial structures into one-dimensional sequences when processing visual signals, leading to the critical loss of spatial position information. To tackle this fundamental issue, we introduce the PEMamba module. Rather than simply appending positional encoding, this module explicitly reconstructs two-dimensional spatial awareness within the state space model through the synergistic integration of three components: a compact positional encoding mechanism, a lightweight spatial enhancement scheme, and an adaptive feature fusion strategy. It significantly enhances the model’s global perception and positional awareness in complex fire environments while preserving Mamba’s advantage of linear complexity, thereby providing a theoretical foundation for addressing the challenge of inaccurate small object localization.
- (2)
- We propose the PEMBottleneck structure and the enhanced PEM-C3K2 module to address the challenge of efficient and dynamic fusion between global and local features. Directly inserting PEMamba into the YOLO framework leads to feature conflicts and computational redundancy. To mitigate this, we design the PEMBottleneck structure, which employs a learnable gating mechanism to dynamically fuse local convolutional features (excelling at detail extraction) with global state space features extracted by PEMamba (specializing in long-range dependency modeling). The resulting PEM-C3K2 module enables fine-grained feature preservation for occluded and small-scale targets while modeling long-range dependencies with linear computational complexity, fundamentally enhancing the model’s discriminative capability in complex scenarios.
- (3)
- We construct FirePM-YOLO, an efficient and robust detection framework tailored for fire rescue scenarios. This is not a mere application of an existing model but a system-level optimization solution. By leveraging the real-time advantages of YOLOv12 and integrating the two aforementioned levels of innovation, FirePM-YOLO systematically tackles three core challenges in fire rescue: dense small objects, severe occlusion, and smoke interference. The framework achieves significantly improved detection accuracy while maintaining real-time inference efficiency, offering a novel technical pathway for fire scene reconnaissance.
Comprehensive experiments are conducted on our self-constructed FireRescue dataset [6]. The results demonstrate that FirePM-YOLO achieves substantial improvements in key metrics such as mean average precision (mAP) and recall compared to state-of-the-art detectors. Notably, our method exhibits exceptional robustness on challenging samples involving small objects, severe occlusion, and visual interference. The contribution of this research extends beyond proposing a novel detection method; it explores a new paradigm for the deep integration of state space models and convolutional neural networks in object detection tasks, offering a solution with both theoretical depth and practical value to the long-standing challenge of small object detection.
The remainder of this paper is organized as follows: Section 2 reviews related work. Section 3 elaborates on the overall architecture of FirePM-YOLO and its core improvement modules, with particular emphasis on the strategic placement of PEMamba in shallow layers—a design choice motivated by the need to preserve spatial resolution for small target detection while enabling early context integration—and the parallel fusion architecture in PEMBottleneck, which enables adaptive balancing of local details and global context. Section 4 introduces the experimental setup, dataset, and result analysis. Section 5 concludes the paper and outlines directions for future work.
2. Related Work
2.1. General Object Detection Algorithms
In recent years, computer vision has achieved significant advances in object detection, especially through deep learning-based algorithms [7], offering new possibilities for analyzing fire rescue scenes. Current deep learning-based object detection methods are broadly categorized into two-stage and one-stage approaches. Representative two-stage detectors such as R-CNN [8], Fast R-CNN [9], and Faster R-CNN [10] rely on pre-generated region proposals for object classification and localization, which generally require substantial computational resources and exhibit relatively slower inference speeds. In contrast, one-stage detectors like the YOLO series have established themselves as milestones in real-time object detection. Early models, including YOLOv1 [11], YOLOv2 [12], and YOLOv3 [13] laid the foundation for the series, with their performance gains closely tied to backbone enhancements and the widespread adoption of DarkNet. Subsequent versions introduced further innovations: YOLOv4 [14] incorporated CSPNet [15], YOLOv6 [16] adopted re-parameterization techniques, YOLOv7 [17] reorganized the network using ELAN, and YOLOv8 [18] introduced a decoupled head and anchor-free design. YOLOv9 [19] integrated attention mechanisms such as the Convolutional Block Attention Module (CBAM [20]) and Efficient Channel Attention (ECA [21]) into key backbone locations to improve focus on target regions. The more recent YOLOv10 [22] further incorporated transformer components by proposing the Partial Self-Attention (PSA) module, thereby enhancing global modeling capacity while maintaining manageable computational overhead. YOLOv11 [23] added a real-time attention visualization module and dynamically adjusted anchor sizes and ratios during training to better align with varying dataset distributions. Most recently, YOLOv12 [2] deeply integrates multiple attention mechanisms—including self-attention, CBAM, and ECA—across both its backbone and feature fusion layers, using a multi-branch design to strengthen feature representation without substantially increasing computational complexity. This ongoing evolution underscores the continued vitality and adaptability of the YOLO series in advancing real-time detection performance.
2.2. Object Detection in Disaster Management and Underwater Scenarios
Beyond general object detection methods, domain-specific detection tasks in disaster management and underwater environments share common challenges with fire rescue scenarios, such as small object scales, severe occlusions, and complex environmental interference.
In the field of disaster management, several studies have explored UAV-based detection techniques for post-disaster building detection and rescue, water rescue, and forest fire detection technology. For instance, Damjan et al. [24] employed lightweight-based detectors—RTMDet, YOLOv7, and YOLOv8—for building localization, followed by dedicated damage severity classification using state-of-the-art architectures, including Compact Convolutional Transformers, EfficientNet, and ResNet. Beigeng Zhao et al. [25] introduced a dataset rebalancing method based on a greedy algorithm to mitigate potential sample constraints by redistributing samples between training and validation sets. C. Yang et al. [26] introduced a novel feature fusion module called Trident Fusion, which is innovatively designed and incorporated into the neck of the model. Similar to fire rescue scenarios, these tasks also face challenges such as dynamic backgrounds and varying object scales.
Underwater object detection presents unique challenges, including low illumination, light absorption, and scattering effects, all of which lead to severe image degradation. Recent studies have addressed these issues through various improvements. Junlin Ouyang et al. [27] proposed an improved underwater object detection model based on YOLOv9, integrating advanced attention mechanisms and a dilated large-kernel algorithm. Yi et al. [28] introduced UWSC-YOLOv7, which incorporates the SENet attention mechanism and the EIoU loss function to improve detection accuracy without compromising speed. Pan et al. [29] introduced YOLOv10-AD, which adopts the AKVanillaNet backbone and dynamic snake convolution (DysnakeConv), combined with the PIoU loss function, to maintain high detection accuracy while significantly reducing parameter count.
Despite differences in application domains, disaster management and underwater detection share methodological commonalities with fire rescue detection: (1) the need for robust feature extraction under environmental interference; (2) challenges in detecting partially occluded targets; and (3) the demand for efficient architectures suitable for resource-constrained platforms. However, existing methods in these domains typically focus on their specific environmental degradation issues (e.g., underwater haze vs. fire smoke) and have not been systematically adapted for fire rescue scenarios. This gap motivates the development of a dedicated detection framework tailored to the unique characteristics of fireground environments.
2.3. YOLO-Based Attention Enhancement Methods
Many practitioners have enhanced these models by incorporating attention mechanisms, achieving desirable performance gains in their respective domains. For instance, Squeeze-and-Excitation (SENet) [30] block was integrated into an improved YOLACT [31] for identifying rumen protozoa in microscopic images. ViT-YOLO [32] integrates MHSA-Darknet into YOLO, supplemented with enhanced training strategies such as Test Time Augmentation (TTA) and weighted frame fusion. However, the increase in parameters and FLOPs did not yield the anticipated performance improvement, revealing the scalability limitations of Transformers in object detection tasks, particularly within the YOLO framework. Gold-YOLO [33] proposes extracting and fusing multi-scale feature information through a combination of convolutional and attentional primitives to enhance feature fusion. However, while these methods embed Transformer structures, they often sacrifice their core advantages—powerful global attention mechanisms and long-sequence processing capabilities. Concurrently, their attempts to mitigate computational explosion by reducing quadratic complexity frequently end up constraining model performance. Although Transformers excel at capturing long-range dependencies, the self-attention mechanism’s quadratic computational complexity grows with increasing input size, posing a significant challenge for high-resolution biomedical images due to the associated high computational cost.
2.4. Global Context Modeling Methods
Recently, methods based on state space models (SSMs), such as Mamba [3], have provided new ideas for solving these problems due to their strong modeling capabilities for long-distance dependencies and superior properties of linear time complexity. Recent advancements in state space models (SSMs) [34,35,36], particularly structured SSMs (S4) [37], offer a promising solution due to their efficient handling of long sequences. The Mamba model enhances S4 with selective mechanisms and hardware-aware optimizations, demonstrating superior performance in dense data domains [38]. The introduction of the Cross-Scan Module (CSM) in VMamba further extends its applicability to computer vision tasks by enabling spatial traversal and converting non-causal visual images into ordered patch sequences [4]. Vision Mamba [5] introduces the Mamba model into computer vision tasks, achieving linear computational complexity without sacrificing the global receptive field. EfficientVMamba [39] integrates an atrous-based selective scan approach by efficient skip sampling, constituting building blocks designed to harness both global and local representational features. MobileMamba [40] introduces the Multi-Receptive Field Feature Interaction (MRFFI) module—comprising the Long-Range Wavelet Transform-Enhanced Mamba (WTE-Mamba), Efficient Multi-Kernel Depthwise Deconvolution (MK-DeConv), and Redundant-Identity Elimination components—which balances efficiency and performance. Building upon this, Ref. [41] proposes the integration of Vision Mamba blocks (VSS) [5] within the U-Net architecture to enhance long-range dependency modeling for medical image analysis, resulting in Mamba-UNet. Mamba-YOLO [42] represents one of the earlier attempts to integrate the selective state space model (Mamba) with the YOLO architecture. This approach introduces Mamba modules into the backbone network of YOLO, aiming to model global contextual dependencies with linear complexity and mitigate the limitations of traditional convolutional operations in capturing long-range relationships. However, these works generally lack explicit spatial position awareness, fail to systematically establish a multi-scale feature fusion mechanism, and have not designed dedicated attention enhancement strategies to address specific challenges in complex scenarios, such as densely distributed small objects, severe occlusions, and inter-class similarity.
3. Methodology
This chapter is structured as follows: First, the foundational concepts and principles of state space models are introduced. Next, the design and implementation details of key enhanced modules are thoroughly analyzed and discussed. Finally, a high-level overview of the FirePM-YOLO architecture is provided.
3.1. Preliminaries
The structured state-space sequence models S4 [37] and Mamba [3], rooted in state space models (SSMs), both stem from a continuous system that maps a univariate sequence into an output sequence via an implicit latent intermediate state . This design not only bridges the relationship between inputs and outputs but also encapsulates temporal dynamics. The system can be mathematically defined as follows:
In Equation (1), represents the state transition matrix, which governs how the hidden state evolves over time, while denotes the weight matrix for the input space in relation to the hidden state. Moreover, is the observation matrix, which maps the hidden intermediate state to the output. Mamba applies this continuous system to discrete-time sequence data by employing fixed discretization rules and to transform the parameters A and B into their discrete counterparts and , respectively, thereby better integrating the system into deep learning architectures. A commonly used discretization method for this purpose is the Zero-Order Hold (ZOH). The discretized version can be defined as follows:
In Equations (3) and (4), represents a time scale parameter that adjusts the temporal resolution of the model, and and correspondingly denote the discrete-time counterparts of the continuous parameters over the given time interval. Here, I represents the identity matrix. After transformation, the model is computed via linear recursive forms, which can be defined as follows:
The entire sequence transformation can also be represented in a convolutional form, which is defined as follows:
where represents the structured convolutional kernel, with L denoting the length of the input sequence. In the design presented in this paper, the model employs a convolutional form for parallel training and utilizes a linear recursive formulation for efficient autoregressive inference.
3.2. PEMamba: Mamba-Based Vision Layer with Position-Aware Enhancement
We propose a novel Mamba-based vision layer with enhancement—Location-Aware Mamba (PEMamba)—which integrates a selective state space model with compact positional encoding operations to enable efficient visual feature modeling. Figure 1a illustrates the overall architecture of this layer, which consists of four core components: a lightweight spatial enhancement module, learnable positional embeddings, a Mamba state space module, and a learnable residual connection mechanism. The forward propagation process of PEMamba is outlined in Algorithm 1.
| Algorithm 1 Forward Computation Flow of PEMamba |
|
3.2.1. Overall Architecture of PEMamba Module
Given an input feature tensor , where B, C, H, and W denote batch size, channel dimension, height, and width of the feature map, respectively, the network first applies lightweight spatial enhancement to the input features, then flattens them into a sequential format and adds positional information. Subsequently, sequential modeling is performed by the Mamba module. Finally, the spatial structure is restored and combined with the original input via a residual connection. Specifically, the forward pass of this layer comprises the following four steps.
Spatial Feature Enhancement: As shown in Figure 1b, the input features are first processed by a lightweight spatial enhancement module. This module employs a depthwise separable convolution design, initially extracting spatial features via a grouped convolution (with a group size of ), followed by a GELU activation function and a convolution for channel mixing. The enhanced features are added to the original features with a weight of 0.1, thereby strengthening small-object features without introducing significant computational overhead. This process is as shown in Formula (9).
Sequentialization and Positional Encoding: As shown in Figure 1c, to adapt the two-dimensional visual feature maps to the input requirements of the one-dimensional selective state space model (Mamba) while preserving crucial spatial structural information, this module performs a transformation from the spatial domain to the sequential domain and injects a learnable positional prior. First, the two-dimensional feature map is transformed into a token sequence via a spatial flattening operation:
where is the sequence length. The operation is specifically defined as , i.e., first reshaping the tensor and then transposing dimensions to place the channel dimension C last, forming the standard sequence format .
To retain spatial layout awareness after sequentialization, we introduce a compact learnable positional encoding, denoted as . This encoding is implemented as a static, trainable parameter tensor . These parameters are initialized as a zero matrix and adaptively learn spatial positional information during training. In the forward pass, the positional encoding is broadcast-added to the flattened sequence:
Formally, for every batch index b and token index l,
This operation effectively assigns a channel-wise, learnable positional bias to every spatial token in the sequence.
The proposed design offers three principal benefits: (1) Parameter efficiency: Only C parameters are introduced, irrespective of spatial resolution , minimizing memory and computational overhead. (2) Adaptive flexibility: It circumvents predefined positional schemes (e.g., sinusoidal functions), enabling the model to learn tailored positional embeddings directly from data. (3) Implementation simplicity: The design avoids complex coordinate computations or interpolations, ensuring ease of integration and stable optimization.
The resulting position-augmented sequence is then passed to the Mamba state space module for sequential feature modeling.
State Space Modeling: The sequentialized features undergo layer normalization before being fed into the Mamba module for state space modeling. This module utilizes a selective state space mechanism, implementing efficient modeling of long-range dependencies through a convolutional scan operation and a discretization process. This process is as shown in Formula (13).
Feature Reconstruction and Residual Connection: The sequential features output by the Mamba module are reshaped back to the original spatial dimensions . They are then added to the original input features via a learnable residual weight (initialized to 0.1) to produce the final output. This process is as shown in Formula (14).
3.2.2. Core Component Design
The innovations of this module are threefold: (1) It combines a selective state space model with convolutional operations, balancing global dependency modeling and local feature extraction. (2) Its lightweight design achieves a balance between parameter efficiency and performance. (3) The learnable residual mechanism enhances training stability. In the subsequent experimental section, we will validate the effectiveness of each component design through ablation studies.
Lightweight Spatial Enhancement Module: To address small-object detection tasks, we designed a parameter-efficient spatial enhancement module. This module adopts a two-stage structure: the first stage uses grouped depthwise convolution (with a group size of to extract local spatial features, while the second stage employs pointwise convolution for channel information fusion. This design maintains spatial awareness while significantly reducing the number of parameters (by approximately 75%).
Selective State Space Model: The sequentialized features are first normalized and then modeled by the selective state space mechanism of the Mamba module. The Mamba module employs a selective state space mechanism, enabling dynamic focus on important features through an input-dependent selective scanning process. Compared to traditional attention models, this mechanism offers linear time complexity and can efficiently process long-sequence visual features.
Learnable Residual Mechanism: A learnable residual weight parameter is introduced, allowing the network to adaptively adjust the fusion ratio between the state-space-modeled features and the original features. This parameter is initialized to a small value, facilitating stable training, and is adjusted during the optimization process.
It should be noted that this module can be flexibly integrated into existing convolutional neural networks as a feature enhancement layer. Experiments demonstrate that the module effectively improves model performance across various vision tasks, notably achieving significant average precision gains in small-object detection.
3.3. PEMBottleneck Module
In fire rescue scenarios, critical targets such as firefighting vehicles and rescue personnel often exhibit the following characteristics: spatially widespread distribution (targets occupy only a small pixel area from a UAV), significant long-range dependencies (e.g., smoke diffusion and flame spread), and severe local occlusion (in scenarios such as structural collapses, equipment accumulation, or fire trucks being blocked by other objects, which often lead to partial visibility of targets). Traditional convolutional bottleneck structures, due to their limited receptive fields and static computational graphs, struggle to effectively model these complex patterns. To address this, this paper proposes the PEMBottleneck module (see Figure 2b or Figure 3b), which integrates our designed PEMamba module in parallel with convolutional operations, thereby enhancing global dependency modeling while preserving local detail features, achieving a more balanced integration of local information and global context.
Figure 2.
Architecture of the proposed FirePM-YOLO and its core components. (a) Overall structure of FirePM-YOLO, illustrating the backbone, neck, and head. The red dashed box highlights the modified part: the first C3K2 module in the backbone is replaced with our proposed PEM-C3K2 module. All other components remain identical to the baseline YOLOv12. (b) Detailed structure of the PEMBottleneck module, which consists of parallel convolutional and PEMamba paths fused via a learnable weight. (c) Structure of the PEM-C3K module, which serves as the basic building block of PEM-C3K2. (d) Structure of the proposed PEM-C3K2 module, composed of multiple serial PEM-C3K modules, enabling hybrid local-global feature modeling at the shallow stage of the backbone.
Figure 3.
Comparison of the structural diagrams of PEM-C3K2 and standard C3K2. (a) Structure of the standard C3K2 module in YOLOv12, composed of multiple serial standard bottlenecks. Each standard bottleneck contains two convolutional branches fused via element-wise addition, limiting the module to local feature extraction. (b) Structure of the proposed PEM-C3K2 module, where each standard bottleneck is replaced with a PEM-C3K module. Each PEM-C3K module is built upon PEMBottleneck blocks, enabling parallel local-global feature modeling with learnable fusion weights. This side-by-side comparison highlights the core architectural innovation: transforming purely convolutional feature extraction into hybrid local-global modeling at the shallow stage of the backbone.
The detailed computational procedure of the proposed module is described below. The module accepts input features and produces output features . Its core computational process can be formally expressed as
where denotes the fusion function, which will be elaborated in detail in the subsequent section.
The module consists of three core components:
Local Feature Path: This path follows the standard bottleneck design, extracting local spatial features through a two-stage convolution, as formalized in Equation (16).
where denotes a convolutional layer that maps the input space to , thereby reducing the channel dimensionality. is the grouped convolutional layer (with group count ) mapping to .
Global Context Path: To capture long-range spatial dependencies, the module incorporates a pemamba layer (Equation (17)).
where pemamba denotes the pemambaMambaLayermodule, configured with a hidden state dimension , an expansion factor and successive SSM layers. The pemamba module dynamically models global feature dependencies via a selective scanning mechanism. Its discrete state-space equations are given in Equations (5) and (6).
Adaptive Fusion: To balance local details with global contextual information, the module employs a learnable weighted fusion mechanism (Equation (18)).
where denotes a learnable fusion weight, initialized to and optimized via gradient descent during training. If the pemamba path is disabled (use_pemamba = False), the module degenerates to a standard bottleneck structure, ensuring flexibility and extensibility of the architecture.
To facilitate subsequent architecture search and computational optimization, the module incorporates a configurable switch . When set to False, it reduces to the standard bottleneck structure:
Compared to the standard convolutional bottleneck, the PEMamabaBottleneck offers the following theoretical advantages:
- Receptive Field Expansion: The pemamba path provides a global receptive field, compensating for the locality limitations of convolutional operations.
- Dynamic Modeling Capability: The selective mechanism enables the model to focus on spatial regions relevant to firefighting and rescue tasks, such as the direction of flame spread and connected smoke regions.
- Computational Efficiency: Mamba’s linear complexity ensures that global modeling does not introduce excessive computational overhead.
- Interpretability: The value of the fusion weight can reflect the network’s degree of reliance on global context.
Rationale for Parallel Fusion Architecture. A critical design choice in PEMBottleneck is the parallel fusion of convolutional features and PEMamba features, rather than a cascaded or serial integration. This decision is grounded in the complementary nature of these two feature representations:
(1) Complementary Feature Characteristics: Convolutional operations excel at extracting local patterns—edges, textures, and fine-grained details—through their inductive bias of local connectivity and weight sharing. However, they struggle with long-range dependencies due to limited receptive fields. Conversely, PEMamba captures global contextual relationships through its selective state space mechanism but may sacrifice some local precision. A parallel architecture allows both pathways to operate simultaneously on the same input, preserving the distinct strengths of each representation without forcing one to pass through the other, which could cause information loss or distortion.
(2) Gradient Flow Optimization: In serial architectures where one module feeds into the other, gradients must propagate through both pathways sequentially, potentially leading to vanishing gradients or optimization difficulties. Our parallel design with learnable fusion weights creates two independent gradient highways—gradients can flow directly to either pathway, facilitating more stable training and better convergence. This is particularly important for the newly introduced PEMamba module, which has different optimization dynamics than standard convolutions.
(3) Adaptive Feature Balancing via Learnable Fusion: The learnable fusion weight (initialized to 0.3) enables the network to dynamically adjust the contribution of global context versus local details based on the specific characteristics of each spatial location and each sample. For regions with clear local patterns (e.g., visible vehicle edges), the network may rely more on convolutional features; for ambiguous regions requiring contextual disambiguation (e.g., smoke-obscured areas), it can upweight PEMamba features. This spatial-adaptive fusion capability would be impossible in serial designs where the weighting is implicit and fixed by the network depth.
(4) Ablation Validation: As evidenced in Table 3, the parallel fusion design (configuration “B + C”) achieves superior performance compared to both the baseline and configurations without fusion, with gains of +3.90% in mAP50 and +5.76% in mAP50-95. Notably, these improvements come without increasing parameter count, confirming that the performance gain stems from the architectural synergy rather than model capacity expansion.
3.4. The FirePM-YOLO Architecture
3.4.1. YOLOv12 Baseline Architecture
Before describing our proposed architecture, we briefly review the structure of YOLOv12, which serves as our baseline. As illustrated in Figure 2a (excluding the red dashed box), YOLOv12 follows a standard backbone–neck–head design:
Backbone: A series of convolutional stages for feature extraction. The backbone contains multiple C3K2 modules at different scales. The first C3K2 module (see Figure 3a) operates on high-resolution feature maps (160 × 160 for 640 × 640 inputs), capturing fine-grained spatial details essential for small object detection. Subsequent C3K2 modules operate on progressively downsampled feature maps (80 × 80, 40 × 40, 20 × 20), trading spatial resolution for semantic richness.
Neck: A feature pyramid network that aggregates multi-scale features from different backbone stages, enabling detection across varied object sizes.
Head: The detection head that predicts bounding boxes and class probabilities from the neck’s features.
Each C3K2 module in YOLOv12 consists of multiple serial standard bottlenecks (see Figure 3a), with each bottleneck containing two convolutional branches fused via element-wise addition. This design, while computationally efficient, is inherently limited to local feature extraction—each convolution operates within a fixed kernel window, and receptive fields grow only linearly with depth.
3.4.2. FirePM-YOLO: Integrating PEMamba into YOLOv12
To address the limitations of YOLOv12 in capturing global context—particularly critical for fire rescue scenarios with large-scale smoke patterns and occluded targets—we propose FirePM-YOLO (see Figure 2a). As highlighted by the red dashed box in Figure 2a, our modification is highly localized and intentional: we replace only the first C3K2 module in the backbone with our proposed PEM-C3K2 (see Figure 2d or Figure 3b). All other components—including the remaining backbone stages, the neck, and the head—are identical to YOLOv12.
This minimal modification design serves two purposes: (1) it allows us to isolate and evaluate the contribution of the PEMamba module without confounding factors from architectural changes elsewhere, and (2) it preserves YOLOv12’s proven efficiency in all other components.
3.4.3. PEM-C3K2 Module
While Section 3.2 and Section 3.3 have detailed the internal workings of PEMamba and PEMBottleneck, here we describe how these components come together to form PEM-C3K2. As shown in Figure 3b, PEM-C3K2 maintains the same overall structure as standard C3K2—it consists of multiple serial blocks. However, each standard bottleneck is replaced with a PEMBottleneck (Section 3.3). The relationship is straightforward:
Standard C3K2 = serial [Bottleneck, Bottleneck, …]
PEM-C3K2 = serial [PEMBottleneck, PEMBottleneck, …]
Within each PEMBottleneck, the parallel paths (convolutional and PEMamba) operate independently and are fused via learnable weight , as detailed in Section 3.3. Figure 3a,b provide a side-by-side visual comparison of these two module types.
3.4.4. Differences Between PEM-C3K2 and Standard C3K2
Figure 3 provides a side-by-side comparison of the standard C3K2 module and our proposed PEM-C3K2 module. The core differences between these two modules are manifested in the following three aspects:
(1) Compositional Structure. The standard C3K2 consists of multiple serial standard bottlenecks. Each bottleneck contains only two convolutional branches, with features fused through element-wise addition. In contrast, the PEM-C3K2 replaces each standard bottleneck with our proposed PEMBottleneck. Each PEMBottleneck contains two parallel paths: a convolutional path responsible for extracting fine-grained local details and a PEMamba path responsible for capturing global contextual features. These two paths are fused via a learnable weight, enabling adaptive balancing of local and global information.
(2) Receptive Field Characteristics. The receptive field of the standard C3K2 grows linearly with network depth, requiring the stacking of multiple layers to cover large spatial extents, which limits its capacity for modeling global information. Conversely, the PEM-C3K2 achieves a global receptive field within each PEMBottleneck through the state space mechanism of PEMamba. This allows the network to acquire scene-level contextual awareness at shallow stages, providing early guidance for subsequent feature extraction.
(3) Feature Representation Capability. The standard C3K2 extracts features solely through convolutional operations, resulting in a single, homogeneous representation. The PEM-C3K2, however, maintains two complementary representations—convolutional features and state space features—simultaneously. The learnable fusion weight enables spatially adaptive feature balancing: in regions with clear target boundaries, the network can rely more on convolutional details; in ambiguous areas such as those obscured by smoke, it can depend more on the contextual reasoning provided by PEMamba.
3.4.5. Strategic Placement of PEMamba in Shallow Layers
A key design decision in our architecture is the deliberate placement of the PEMamba module exclusively in the shallow layers of the backbone (specifically, the first C3K2 module). This choice is motivated by the unique characteristics of fire rescue scenarios and the nature of small object detection:
(1) Resolution Preservation for Small Targets: In UAV-based fire reconnaissance, critical targets such as firefighters and small rescue vehicles often occupy only a few dozen pixels. Shallow feature maps retain higher spatial resolution, providing richer fine-grained details essential for detecting these small-scale objects. Placing PEMamba in deeper layers would suffer from severe spatial information loss due to successive downsampling, making small target detection inherently difficult regardless of subsequent feature enhancement.
(2) Early Context Integration: Fire rescue scenes are characterized by large-scale contextual patterns—smoke plumes, flame spread directions, and structural layouts—that provide crucial cues for locating partially occluded or ambiguous targets. By integrating global context modeling at shallow stages, PEMamba injects this contextual awareness early in the feature extraction pipeline, guiding subsequent convolutional layers to focus on task-relevant regions. This “context-aware early encoding” strategy contrasts with approaches that only model global dependencies at deep stages, where spatial details have already been compromised.
(3) Hierarchical Feature Refinement: Our design follows a “global context priming + local detail refinement” paradigm: PEMamba first establishes broad scene understanding through its selective state space mechanism, then the following convolutional layers iteratively refine local details while being guided by this global context. This hierarchical approach mimics human visual perception in complex scenes—first grasping the overall scene structure, then scrutinizing specific regions of interest.
(4) Computational Efficiency Trade-off: Mamba’s linear complexity becomes more computationally demanding as spatial resolution increases. Placing PEMamba at the earliest stage (highest resolution) would incur unacceptable latency for real-time UAV deployment. Our chosen position—after initial downsampling but before severe resolution reduction—strikes an optimal balance between spatial detail preservation and computational efficiency.
4. Experimental Results and Analysis
4.1. Experimental Environment and Hyperparameter Settings
All experiments in this study were conducted on a Linux operating system, with detailed specifications provided in Table 1. Model training and validation were conducted based on the Ultralytics YOLO framework. The main hyperparameter settings used are shown in Table 2.
Table 1.
Experimental environment.
Table 2.
Training hyperparameter settings.
4.2. Experimental Dataset
The FireRescue dataset [6] is the first large-scale object detection dataset specifically designed for comprehensive firefighting and rescue scenarios. It comprises 15,980 images with 32,000 high-quality annotations across eight target categories: five types of common fire rescue vehicles, firefighters, smoke, and flames. On average, each image contains approximately 2.00 annotated targets. The detailed category names and instance count distribution are presented in Figure 4. The dataset covers diverse scenes, including urban roads, suburban environments, and night scenes under various weather conditions, with numerous small and occluded targets. These characteristics make the FireRescue dataset particularly suitable for research tasks such as small object detection and robustness evaluation in complex scenes.
Figure 4.
Annotation statistics of the FireRescue dataset. This figure shows the distribution of 32,000 annotations across eight categories: Flames (32.00%, 10,240 instances), Firefighter (28.13%, 9000 instances), Smoke (23.44%, 7500 instances), Water Tanker FireTruck (7.50%, 2400 instances), Equipment Support FireTruck (3.75%, 1200 instances), Emergency Rescue FireTruck (2.13%, 682 instances), Command and Communication FireVehicle (1.46%, 466 instances), and Aerial Water Monitor FireTruck (1.60%, 512 instances).
Due to the diverse data sources—including real-world fire rescue operations, training exercises, and online repositories—the original images exhibit varying spatial resolutions, typically ranging from 640 × 480 to 1920 × 1080 pixels. To ensure consistent model training, all images are uniformly resized to 640 × 640 pixels during preprocessing, following the standard input requirements of the YOLO series. Aspect ratio is preserved through padding to maintain the original content’s integrity. Finally, the dataset is randomly split into training, validation, and test sets with a ratio of 8:1:1 to ensure fairness and reproducibility in experimental evaluations.
4.3. Ablation Study
To validate the effectiveness of the individual improvements proposed in this paper for the enhanced fire rescue scene detection method, a comprehensive ablation study was conducted. All experiments were strictly controlled to ensure consistency in model parameters. The results of the ablation study are presented in Table 3, where “+A” indicates the incorporation of the Mamba improvement, “+B” indicates the incorporation of the PEMamba improvement, and “+C” indicates that a weighted fusion mechanism is adopted in the bottleneck block.
Table 3.
Ablation study on the FireRescue dataset.
As evidenced in Table 3, the effectiveness of each proposed improvement is validated. The introduction of the Mamba module enhances cross-dimensional information interaction with a negligible increase in computational cost, resulting in gains of +2.93% in mAP50, +4.79% in mAP50-95, +8.02% in precision, and +3.91% in recall, thereby validating its contribution to detection performance. The proposed PEMamba module delivers significant performance gains—+2.94% mAP50, +5.62% mAP50-95, +8.07% precision, and +3.92% recall—while requiring almost no increase in parameters or computational cost. Finally, this final modification yields a further increase of +3.90% in mAP50, +5.76% in mAP50-95, +8.14% in precision, and +5.80% in recall, confirming its substantial benefit to overall model performance.
As shown in Table 3, the number of parameters in the improved models does not increase, indicating that the gains come primarily from structural optimizations rather than computational expansion. In terms of inference speed, FPS (frames per second), all models exhibit varying degrees of decrease: B + C drops the most (−18.9%), followed by B (−18.6%), while A shows the smallest reduction (−16.9%). Although the proposed models experience a decline in inference speed, their FPS during real-time image analysis remains above 30, which fully meets the practical requirements for real-time detection tasks [43].
4.4. Comparative Experiments
In this study, we enhance YOLOv12 by integrating novelly designed modules. To comprehensively evaluate the effectiveness of our proposed method, we conduct two sets of comparative experiments based on model scale. First, the proposed module is incorporated into two different scales of YOLOv12, namely YOLOv12n and YOLOv12s, resulting in two new architectures: FirePM-YOLOn and FirePM-YOLOs. Subsequently, a rigorous performance comparison is carried out. The decision to employ both nano (n)- and small (s)-scale models for evaluation is twofold. First, it aims to demonstrate the generalizability and scalability of our proposed module. A common pitfall in architectural innovation is that improvements may be effective only at a specific model capacity. By validating our module across two distinct scales, we rigorously show that its benefits are not merely incidental to a particular parameter count but are a consistent and transferable enhancement. Second, this approach provides a more comprehensive performance characterization. The nanoscale models, with their extreme efficiency, are critical for applications in resource-constrained environments. Improvements here are measured by the gain in performance per parameter. Conversely, the small-scale models offer a higher baseline performance, allowing us to evaluate whether our module can provide a significant boost even when the base architecture is already more powerful. This dual-level assessment offers complete evidence of our module’s practical utility across different performance-efficiency trade-offs.
The detailed performance comparison results of different models are shown in Table 4, from which the following conclusions can be drawn:
Table 4.
Performance comparison of different models on the FireRescue dataset.
The benefits of our module manifest differently across model scales, highlighting its versatile utility. For the computation-bound nanoscale models, the primary advantage lies in a remarkable +3.90% increase in mAP50, +5.76% increase in mAP50-95, +8.14% increase in precision, and +5.80% increase in recall, crucial for reducing missed detections in resource-constrained deployments. Conversely, for the more powerful small-scale models, our module pushes the performance ceiling further, achieving a significant +0.73% increase in mAP50, +1.64% increase in mAP50-95, +0.31% increase in precision, and +0.33% increase in recall, which is vital for high-accuracy applications.
Crucially, our enhanced model FirePM-YOLOn outperforms the original YOLOv12n by a clear margin, while both models possess an identical number of parameters. This provides direct and fair evidence that the improvement stems from our architectural innovation, not simply an increase in model size. The same trend holds for the small-scale group, where FirePM-YOLOs consistently surpasses YOLOv12s.
Through comprehensive analysis, our final model, FirePM-YOLO, achieves the optimal balance in overall performance among all compared models.
Per-Category Performance Analysis. To comprehensively evaluate the effectiveness of the proposed method, Table 5 presents the per-category AP50 comparison between YOLOv12n and FirePM-YOLO across all eight categories in the FireRescue dataset. The results demonstrate that FirePM-YOLO achieves performance improvements in six out of eight categories, maintains parity in one category, and shows only a marginal decrease in a single category, confirming the stability and generalization capability of the proposed approach. Notably, the most substantial gain (+0.08, from 0.51 to 0.59, representing a relative improvement of 15.7%) is observed in the Emergency Rescue FireTruck category—the class with the lowest baseline performance—validating that the PEMamba module’s spatial position awareness is particularly effective for challenging, hard-to-detect targets. Steady improvements are also achieved on the Aerial Water Monitor FireTruck (+0.06, 9.1% relative gain) and the Water Tanker FireTruck (+0.04, 5.6% relative gain). For the non-vehicle categories of particular reviewer interest, smoke detection improves from 0.78 to 0.80 (+0.02, 2.6% relative gain), while flame detection increases from 0.69 to 0.70 (+0.01, 1.4% relative gain). These gains, achieved on top of already competitive baselines, demonstrate that global context modeling benefits even categories with amorphous boundaries and dynamic appearances such as smoke and flames. Firefighter detection shows a slight increase from 0.34 to 0.35 (+0.01, 2.9% relative gain), reflecting the inherent difficulty of detecting small human targets in complex fire scenes. Collectively, these results validate that FirePM-YOLO achieves a practical performance balance—delivering significant improvements on core rescue vehicle detection (notably the 15.7% relative gain on Emergency Rescue FireTruck) while maintaining competitive performance on environmental perception categories—aligning with the real-world requirements of fire rescue operations.
Table 5.
Per-category AP50 comparison on the FireRescue dataset.
For the non-vehicle categories of the FireRescue dataset, smoke detection improves from 0.78 to 0.80 (+0.02, 2.6% relative gain), while flame detection increases from 0.69 to 0.70 (+0.01, 1.4% relative gain). Although these gains are modest in absolute terms, achieving further improvement on top of already competitive baselines demonstrates that global context modeling benefits even categories with amorphous boundaries and dynamic appearances such as smoke and flames. Firefighter detection shows a slight increase from 0.34 to 0.35 (+0.01, 2.9% relative gain), reflecting the inherent difficulty of detecting small human targets in complex fire scenes.
Collectively, these results validate that FirePM-YOLO achieves a practical performance balance—delivering significant improvements on core rescue vehicle detection (notably the 15.7% relative gain on Emergency Rescue FireTruck) while maintaining competitive performance on environmental perception categories—aligning with the real-world requirements of fire rescue operations.
4.5. Visualization of Experimental Results
To provide an intuitive comparison of the detection performance between the proposed improved model and the baseline model, challenging images were selected from the test set for comparative evaluation. The superiority of the improved model is demonstrated through two visualization methods: detection results and detection heatmaps.
4.5.1. Visualization of Detection Results
This subsection qualitatively demonstrates the performance improvement of our proposed FirePM-YOLO across three challenging scenarios through comparative experiments. For a comprehensive evaluation, we compare the “n” scale models in the first and third experimental groups to assess their performance under lightweight configurations, while the “s” scale models are used in the second group to investigate their detection capability with higher computational budgets.
- (1)
- Small and Occluded Object Detection Capability
Case 1: Long-distance ultra-small target. As shown in Figure 5a–c, this scenario captures a real firefighting and rescue scene from the high-altitude reconnaissance perspective of a UAV. The fire truck, as the core detection target, only occupies approximately 30 × 50 pixels in the image, which is a typical long-distance small target in actual fire rescue scenarios. The comparative detection results show that the baseline model YOLOv12n achieves a detection confidence of merely 0.33 for the fire truck target (Figure 5b), while the proposed FirePM-YOLO model in this paper raises the detection confidence for the same target to 0.51 (Figure 5c). This result fully verifies that the spatial position enhancement mechanism designed in the PEMamba module can effectively strengthen the feature representation of small targets and preserve key spatial information, thus significantly improving the detection confidence and recognition performance of long-distance small targets in real firefighting and rescue scenes from the UAV’s high-altitude perspective.
Figure 5.
Comparison of detection results between YOLOv12n and FirePM-YOLO under small and occluded object detection scenarios. (a–c) Experimental results on long-distance ultra-small targets. (d–f) Experimental results on heavy occlusion of small targets by building debris. (g–i) Experimental results on soft occlusion of small targets by smoke.
Case 2: Heavy occlusion of small targets by building debris. As shown in Figure 5d–f, the first experiment was designed to evaluate the model’s detection capability for small and partially occluded objects from a drone perspective. The experimental scenario is based on a real fire scene with complex backgrounds: due to the long observation distance, multiple fire trucks occupy only minimal pixel areas in the image, while some vehicles are partially occluded by surrounding objects. Under these highly challenging conditions, the baseline YOLOv12n model exhibited noticeable missed detections. In contrast, our proposed FirePM-YOLOn model demonstrated significantly improved detection performance: it not only successfully detected all visible fire vehicles missed by the baseline model but also accurately identified a specialized aerial ladder fire truck by leveraging its unique folding arm structure—a key local feature entirely overlooked by the baseline model. This ability to detect and classify specialized equipment based on local structural features directly validates the effectiveness of the global contextual awareness mechanism and the multi-scale feature enhancement method employed in our model.
Case 3: Soft occlusion of small targets by smoke. As shown in Figure 5g–i, the experimental scenario is an aerial reconnaissance scene at a gas station. A fire truck is performing fire-extinguishing operations in a dense smoke area, and its body is softly occluded by white smoke, resulting in extremely low contrast between the target and the background. The YOLOv12n model fails to detect this target, while FirePM-YOLOn successfully detects it with a confidence score of 0.27. The lightweight spatial enhancement module in PEMamba effectively improves the contrast between small targets and the smoke background, suppresses the noise interference caused by dynamic smoke textures, and thus achieves stable detection of small targets under soft occlusion.
- (2)
- Detection Robustness under Extreme Visual Interference
A second comparative experiment was designed to evaluate model robustness under extreme visual interference, particularly in scenarios involving severe target occlusion. As depicted in Figure 6a–c, the test scenario simulates a disaster scene where a collapsing, burning building has partially buried a fire truck under structural debris. This setup introduces significant visual challenges: the target suffers severe occlusion from irregular, large-scale solid rubble, resulting in fragmented geometric morphology and substantial loss of surface texture information. Experimental results demonstrate that our proposed FirePM-YOLO model exhibits superior detection robustness and confidence stability compared to the baseline YOLOv12 under such extreme occlusion conditions. As shown in Figure 6b, the baseline model shows notable deficiencies in detecting the buried fire truck—a critical rescue target. While capable of coarse localization, it produces low confidence scores of 0.47 and 0.53 for the two visible instances, with noticeable imprecision in bounding box localization. Such low-confidence detections are particularly vulnerable to filtering by confidence thresholds in practical deployment, potentially leading to missed detections and compromising rescue decision-making. In contrast, Figure 6c illustrates that our FirePM-YOLO model achieves higher confidence scores of 0.59 and 0.56 for the same occluded fire trucks under identical conditions, along with more precise localization. This enhancement directly validates the effectiveness of our model’s feature extraction and fusion mechanisms, which enable superior integration of visible local features (e.g., vehicle color, wheels, partially exposed chassis) with contextual information (e.g., fire environment, debris distribution, typical vehicle positioning). The PEMamba module’s global context modeling capability allows the network to infer the presence of targets even when local visual evidence is partially compromised by leveraging surrounding scene cues.
Figure 6.
Comparison of detection results between YOLOv12n and FirePM-YOLO under extreme visual interference. (a) Original image featuring a fire truck partially buried under collapsed building debris, representing severe occlusion and fragmented target morphology. (b) Detection results of YOLOv12n, showing low confidence (0.47 and 0.53) and imprecise localization. (c) Detection results of FirePM-YOLO, achieving high confidence (0.59 and 0.56) and accurate localization through global context modeling.
- (3)
- Multi-Target Discrimination Capability in Dense Scenes
This set of experiments aims to evaluate the detection performance of the model in scenarios with densely coexisting multi-type fire trucks and complex environmental interference. As shown in Figure 7a–c, in scenes with densely distributed fire trucks such as ladder trucks and water tankers, the baseline model YOLOv12n suffers from obvious missed detections and fails to identify all targets completely. In contrast, the proposed FirePM-YOLOn model exhibits significantly improved multi-target discrimination capability: it not only successfully detects all visible fire trucks but also accurately distinguishes different types of fire vehicles without category confusion or target omission. These results validate the ability of the proposed method to maintain feature discriminability in dense scenes. Furthermore, Figure 7d–f presents the detection results in complex environments where fire trucks, smoke, and flames coexist. In terms of smoke and flame detection, YOLOv12n and FirePM-YOLOn achieve similar confidence scores, indicating that the two models have comparable perception ability for such non-rigid targets. However, for the core target, i.e., fire trucks, YOLOv12n still shows obvious missed detections, while FirePM-YOLOn successfully identifies all fire vehicles. This comparison further verifies the superiority of the proposed model in detecting fire trucks as key targets. It demonstrates that the global context modeling ability of the PEMamba module can effectively overcome smoke interference and enhance the detection robustness for rigid small targets.
Figure 7.
Comparison of detection results between YOLOv12n and FirePM-YOLO in multi-target discrimination scenarios. First row (a–c): Dense multi-vehicle scenario. (a) Original image featuring multiple types of fire vehicles densely distributed. (b) Detection results of YOLOv12n. (c) Detection results of FirePM-YOLO. Second row (d–f): Complex environment with smoke and flame interference. (d) Original image where fire vehicles coexist with smoke and flames. (e) Detection results of YOLOv12n. (f) Detection results of FirePM-YOLO.
4.5.2. Heatmap Visualization and Analysis
To gain deeper insight into the models’ internal decision-making processes and to explain the performance differences observed in the detection results, we employ Grad-CAM to generate corresponding heatmaps for the same three sets of scenarios, visualizing the models’ attention regions during inference. Figure 8 presents the heatmap visualizations of both the baseline model and the improved model when processing challenging images from the test set. In the heatmaps, deeper red coloration indicates higher model attention to the corresponding feature regions.
Figure 8.
Comparative visualization of the heatmap results between YOLOv12n and FirePM-YOLO. (a,d,g,j) are the original images; (b,e,h,k) show the heatmap visualization results of YOLOv12n; and (c,f,i,l) present the heatmap visualization results of FirePM-YOLO.
As illustrated in Figure 8, the heatmap visualizations from the four sets of comparative experiments clearly reveal the underlying cause of missed detections in the baseline model. Across all three dense scenarios, the heatmaps of our model consistently demonstrate highly concentrated activation responses toward all critical targets, including partially occluded ones. The model’s attention is sharply focused on discriminative regions of each target, forming clear and localized high-activation peaks. In contrast, the heatmaps of the baseline model directly explain its frequent missed detections: in regions corresponding to missed targets, the model produces almost no significant feature activation. These areas exhibit low-intensity heatmap coloration similar to the background, indicating that these targets failed to obtain effective feature representation during the feature extraction stage. Furthermore, the attention of the baseline model is noticeably scattered—activations are often misplaced onto background textures, irrelevant objects, or the surroundings of already detected prominent targets, rather than being evenly distributed across all potential objects. This comparative visualization provides empirical support for the effectiveness of the multi-scale attention mechanism and feature enhancement modules introduced in our model. These components substantially improve the model’s feature sensitivity and spatial discriminability in dense scenes, ensuring that all potential targets receive sufficient activation in the feature maps and are successfully recalled in subsequent detection stages. These observations also offer an intuitive explanation for the quantitative improvements reported in Table 4.
5. Conclusions
This paper proposes FirePM-YOLO, a novel object detection framework designed to address the specific challenges encountered in UAV-based fire rescue scenarios. By integrating the custom-designed Position-Aware Enhanced Mamba (PEMamba) module into the YOLOv12 architecture, the model achieves a significant enhancement in perceiving small-scale targets, handling severe occlusions, and resisting visual interference from smoke and flames, which are common in fireground environments. The core innovation lies in the PEMamba module, which introduces a lightweight spatial enhancement mechanism, learnable positional embeddings, and a selective state space model within a unified layer. This design effectively combines the global contextual modeling capability of Mamba with the local feature extraction strength of convolutional operations. Furthermore, the proposed PEMBottleneck structure, which replaces standard bottlenecks in the shallow layers of the backbone, enables the model to capture long-range dependencies across the scene while preserving fine-grained details crucial for small object detection, all with linear computational complexity. In conclusion, FirePM-YOLO provides an effective and efficient solution for real-time, high-precision object detection in the critical domain of fire rescue. This work not only advances the state-of-the-art for vision-based fireground analysis but also presents a valuable paradigm for integrating state space models into convolutional detection frameworks to tackle classic challenges such as small object detection in complex environments. Future work may involve further optimization for deployment on resource-constrained UAV platforms and extension to multi-modal or temporal analysis for enhanced situational awareness.
Author Contributions
Conceptualization, Q.X.; Methodology, Q.X.; Software, Q.X.; Validation, Q.X.; Formal analysis, Q.X.; Investigation, Q.X.; Resources, Q.X.; Data curation, Q.X.; Writing—original draft, Q.X.; Writing—review & editing, Q.X. and F.M.; Visualization, Q.X.; Supervision, Q.X., R.Z., Z.Q. and F.M.; Project administration, Q.X. and F.M.; Funding acquisition, F.M. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Data Availability Statement
Data are contained within the article.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Li, T.; Fei, L. Exploring obstacles to the use of unmanned aerial vehicles in emergency rescue: A BWM-DEMATEL approach. Technol. Soc. 2025, 81, 102863. [Google Scholar] [CrossRef] [Scilit]
- Tian, Y.; Ye, Q.; Doermann, D. Yolov12: Attention-centric real-time object detectors. arXiv 2025, arXiv:2502.12524. [Google Scholar]
- Gu, A.; Dao, T. Mamba: Linear-time sequence modeling with selective state spaces. In Proceedings of the First Conference on Language Modeling, Philadelphia, PA, USA, 7–9 October 2024. [Google Scholar]
- Liu, Y.; Tian, Y.; Zhao, Y.; Yu, H.; Xie, L.; Wang, Y.; Ye, Q.; Jiao, J.; Liu, Y. Vmamba: Visual state space model. Adv. Neural Inf. Process. Syst. 2024, 37, 103031–103063. [Google Scholar]
- Zhu, L.; Liao, B.; Zhang, Q.; Wang, X.; Liu, W.; Wang, X. Vision mamba: Efficient visual representation learning with bidirectional state space model. arXiv 2024, arXiv:2401.09417. [Google Scholar] [CrossRef] [Scilit]
- Xu, Q.; Zhang, R.; Qiu, Z.; Meng, F. FireRescue: A UAV-Based Dataset and Enhanced YOLO Model for Object Detection in Fire Rescue Scenes. arXiv 2025, arXiv:2512.24622. [Google Scholar]
- Zhang, Z.; Yi, H.; Zheng, J. Few-shot object detection of aerial image based on language guidance vision. J. Beijing Univ. Aeronaut. Astronaut. 2025, 51, 2338–2348. [Google Scholar]
- Yasir, M.; Liu, S.; Xu, M.; Wan, J.; Pirasteh, S.; Dang, K.B. ShipGeoNet: SAR image-based geometric feature extraction of ships using convolutional neural networks. IEEE Trans. Geosci. Remote Sens. 2024, 62, 5202613. [Google Scholar] [CrossRef] [Scilit]
- Girshick, R. Fast r-cnn. In Proceedings of the IEEE International Conference on Computer Vision; IEEE: Piscataway, NJ, USA, 2015; pp. 1440–1448. [Google Scholar]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards real-time object detection with region proposal networks. IEEE Trans. Pattern Anal. Mach. Intell. 2016, 39, 1137–1149. [Google Scholar] [CrossRef] [Scilit]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: Piscataway, NJ, USA, 2016; pp. 779–788. [Google Scholar]
- Redmon, J.; Farhadi, A. YOLO9000: Better, faster, stronger. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: Piscataway, NJ, USA, 2017; pp. 7263–7271. [Google Scholar]
- Redmon, J.; Farhadi, A. Yolov3: An incremental improvement. arXiv 2018, arXiv:1804.02767. [Google Scholar] [CrossRef] [Scilit]
- Bochkovskiy, A.; Wang, C.Y.; Liao, H.Y.M. Yolov4: Optimal speed and accuracy of object detection. arXiv 2020, arXiv:2004.10934. [Google Scholar] [CrossRef] [Scilit]
- Wang, C.Y.; Liao, H.; Wu, Y.H.; Chen, P.Y.; Yeh, I. A new backbone that can enhance learning capability of CNN. In Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW); IEEE: Piscataway, NJ, USA, 2020; pp. 390–391. [Google Scholar]
- Li, C.; Li, L.; Geng, Y.; Jiang, H.; Cheng, M.; Zhang, B.; Ke, Z.; Xu, X.; Chu, X. Yolov6 v3. 0: A full-scale reloading. arXiv 2023, arXiv:2301.05586. [Google Scholar]
- Wang, C.Y.; Bochkovskiy, A.; Liao, H.Y.M. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE: Piscataway, NJ, USA, 2023; pp. 7464–7475. [Google Scholar]
- Jocher, G.; Chaurasia, A.; Qiu, J. Ultralytics YOLO: Software for Object Detection, version 8.0. 0; Ultralytics: Frederick, MD, USA, 2023. [Google Scholar]
- Wang, C.Y.; Yeh, I.H.; Mark Liao, H.Y. Yolov9: Learning what you want to learn using programmable gradient information. In Proceedings of the European Conference on Computer Vision; Springer: Cham, Switzerland, 2024; pp. 1–21. [Google Scholar]
- Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. Cbam: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
- Wang, Q.; Wu, B.; Zhu, P.; Li, P.; Zuo, W.; Hu, Q. ECA-Net: Efficient channel attention for deep convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE: Piscataway, NJ, USA, 2020; pp. 11534–11542. [Google Scholar]
- Wang, A.; Chen, H.; Liu, L.; Chen, K.; Lin, Z.; Han, J.; Ding, G. Yolov10: Real-time end-to-end object detection. Adv. Neural Inf. Process. Syst. 2024, 37, 107984–108011. [Google Scholar]
- Khanam, R.; Hussain, M. Yolov11: An overview of the key architectural enhancements. arXiv 2024, arXiv:2410.17725. [Google Scholar] [CrossRef] [Scilit]
- Hatić, D.; Polushko, V.; Rauhut, M.; Hagen, H. Post-Disaster Building Damage Assessment: Multi-Class Object Detection vs. Object Localization and Classification. Remote Sens. 2025, 17, 3957. [Google Scholar] [CrossRef] [Scilit]
- Zhao, B.; Li, J.; Zhao, J.; Yu, L.; Zhang, X.; Liu, J. Optimizing drone-captured maritime rescue image object detection through dataset rebalancing under sample constraints: B. Zhao et al. Vis. Comput. 2025, 41, 11221–11237. [Google Scholar] [CrossRef] [Scilit]
- Yang, C.; Jun, Z.; Hongyuan, W.; Gang, W. TCSN-YOLO: A Small-Target Object Detection Method for Fire Smoke. Fire 2025, 8, 466. [Google Scholar] [CrossRef] [Scilit]
- Ouyang, J.; Li, Y. Enhanced underwater object detection via attention mechanism and dilated large-kernel networks: J. Ouyang, Y. Li. Vis. Comput. 2025, 41, 8303–8325. [Google Scholar] [CrossRef] [Scilit]
- Yi, W.; Wang, B. Research on underwater small target detection algorithm based on improved YOLOv7. IEEE Access 2023, 11, 66818–66827. [Google Scholar] [CrossRef] [Scilit]
- Pan, W.; Chen, J.; Lv, B.; Peng, L. Lightweight marine biodetection model based on improved YOLOv10. Alex. Eng. J. 2025, 119, 379–390. [Google Scholar] [CrossRef] [Scilit]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: Piscataway, NJ, USA, 2018; pp. 7132–7141. [Google Scholar]
- Bolya, D.; Zhou, C.; Xiao, F.; Lee, Y.J. Yolact: Real-time instance segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision; IEEE: Piscataway, NJ, USA, 2019; pp. 9157–9166. [Google Scholar]
- Zhang, Z.; Lu, X.; Cao, G.; Yang, Y.; Jiao, L.; Liu, F. ViT-YOLO: Transformer-based YOLO for object detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision; IEEE: Piscataway, NJ, USA, 2021; pp. 2799–2808. [Google Scholar]
- Wang, C.; He, W.; Nie, Y.; Guo, J.; Liu, C.; Wang, Y.; Han, K. Gold-YOLO: Efficient object detector via gather-and-distribute mechanism. Adv. Neural Inf. Process. Syst. 2023, 36, 51094–51112. [Google Scholar]
- Gu, A. Modeling Sequences with Structured State Spaces. Ph.D. Thesis, Stanford University, Stanford, CA, USA, 2023. [Google Scholar]
- Mehta, H.; Gupta, A.; Cutkosky, A.; Neyshabur, B. Long range language modeling via gated state spaces. arXiv 2022, arXiv:2206.13947. [Google Scholar] [CrossRef] [Scilit]
- Wang, J.; Zhu, W.; Wang, P.; Yu, X.; Liu, L.; Omar, M.; Hamid, R. Selective structured state-spaces for long-form video understanding. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE: Piscataway, NJ, USA, 2023; pp. 6387–6397. [Google Scholar]
- Gu, A.; Goel, K.; Ré, C. Efficiently modeling long sequences with structured state spaces. arXiv 2021, arXiv:2111.00396. [Google Scholar]
- Bazdyrev, A. Linear-Time Sequence Modeling with Selective State Spaces for the Ukrainian Language. In System Analysis and Data Mining; Springer: Cham, Switzerland, 2025; pp. 173–184. [Google Scholar]
- Pei, X.; Huang, T.; Xu, C. Efficientvmamba: Atrous selective scan for light weight visual mamba. In Proceedings of the AAAI Conference on Artificial Intelligence; AAAI Press: Washington, DC, USA, 2025; Volume 39, pp. 6443–6451. [Google Scholar]
- He, H.; Zhang, J.; Cai, Y.; Chen, H.; Hu, X.; Gan, Z.; Wang, Y.; Wang, C.; Wu, Y.; Xie, L. Mobilemamba: Lightweight multi-receptive visual mamba network. In Proceedings of the Computer Vision and Pattern Recognition Conference; IEEE: Piscataway, NJ, USA, 2025; pp. 4497–4507. [Google Scholar]
- Liu, Z.; Hu, H.; Lin, Y.; Yao, Z.; Xie, Z.; Wei, Y.; Ning, J.; Cao, Y.; Zhang, Z.; Dong, L.; et al. Swin transformer v2: Scaling up capacity and resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE: Piscataway, NJ, USA, 2022; pp. 12009–12019. [Google Scholar]
- Wang, Z.; Li, C.; Xu, H.; Zhu, X.; Li, H. Mamba yolo: A simple baseline for object detection with state space model. In Proceedings of the AAAI Conference on Artificial Intelligence; AAAI Press: Washington, DC, USA, 2025; Volume 39, pp. 8205–8213. [Google Scholar]
- Peng, Y.; Li, H.; Wu, P.; Zhang, Y.; Sun, X.; Wu, F. D-FINE: Redefine regression task in DETRs as fine-grained distribution refinement. arXiv 2024, arXiv:2410.13842. [Google Scholar]
- Carion, N.; Massa, F.; Synnaeve, G.; Usunier, N.; Kirillov, A.; Zagoruyko, S. End-to-end object detection with transformers. In Proceedings of the European Conference on Computer Vision; Springer: Cham, Switzerland, 2020; pp. 213–229. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.







