Flame detection method and device based on edge adaptive Transform architecture
By employing an edge-adaptive Transformer architecture for flame detection, combined with the YOLOv8 detection algorithm, the lightweight visual transformer MobileViT, and a channel attention mechanism, the accuracy and real-time performance issues of flame detection in complex environments are addressed, achieving efficient and reliable flame monitoring and management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NORTHWESTERN POLYTECHNICAL UNIV
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-17
AI Technical Summary
Existing flame detection methods suffer from low accuracy and poor real-time performance in complex environments. Traditional sensor technologies are susceptible to environmental interference, and image processing-based methods struggle to cope with the changing characteristics of flames. Deep learning models also lack stability in variable environments.
We employ an edge-adaptive Transformer architecture-based flame detection method, combined with an optimized YOLOv8 detection algorithm. We introduce the lightweight visual transformer MobileViT and a channel attention mechanism, and improve detection accuracy and real-time performance through data augmentation and feature fusion networks.
It achieves high-precision flame detection in complex environments, significantly improving the safety and efficiency of flame handling, and is suitable for flame monitoring and management in various complex environments.
Smart Images

Figure CN121884032A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of flame detection technology, and specifically to a flame detection method and apparatus based on an edge-adaptive Transformer architecture. Background Technology
[0002] Flames play an indispensable role in modern life; however, if out of control, they can pose a serious threat. From industrial accidents and forest fires to residential emergencies, rapid detection, identification, and tracking of flames are crucial for minimizing damage, preventing casualties, and enabling timely intervention. Therefore, accurate and real-time flame detection has become an indispensable key element in civil and industrial safety management.
[0003] Existing flame detection and management methods mainly include manual inspection, traditional sensor technology, and image processing-based methods. While traditional sensor technologies such as smoke detectors and thermal sensors can provide some early warning, they are often limited by their detection range, susceptible to environmental interference, and have slow response times, leaving significant room for improvement in detection accuracy and real-time performance. Image processing-based methods acquire images using cameras and utilize traditional image processing algorithms for flame identification. However, these methods rely on pre-defined features and rules, making them difficult to adapt to varying environmental conditions and different types of flame characteristics, thus limiting their accuracy and broad applicability.
[0004] The rapid development of artificial intelligence technology has brought new opportunities to flame detection technology. However, current deep learning-based target detection and recognition technologies still face challenges such as high model complexity, large computational resource requirements, and insufficient stability in changing environments. Therefore, optimizing deep learning models and improving their efficiency and robustness in practical applications has become crucial for advancing flame detection and management technologies.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] This invention provides a flame detection method and apparatus based on an edge-adaptive Transformer architecture. It aims to address the challenge of traditional methods performing poorly in complex environments by combining an optimized YOLOv8 detection algorithm with a lightweight visual transformer and channel attention mechanism. This solution aims to improve the accuracy and real-time performance of flame detection and recognition, thereby providing an efficient and reliable flame monitoring and management solution.
[0007] Other features and advantages of the invention will become apparent from the following detailed description, or may be learned in part by practice of the invention.
[0008] According to a first aspect of the present invention, a flame detection method based on an edge-adaptive Transformer architecture is provided, the method comprising: We collected flame images and video data from different scenes, and used Labelimg and Labelme tools to accurately label the flame location information to build a flame detection dataset, which was divided into training and testing sets. Perform data augmentation on the flame detection dataset; A flame detection network is constructed, comprising a backbone feature extraction network and a neck feature fusion network. The backbone feature extraction network is an optimization of the backbone of the traditional YOLOv8 target detection model based on the lightweight visual transformer MobileViT, used to extract deep image features. The neck feature fusion network consists of a feature pyramid network FPN and a feature aggregation network, and introduces the ECA-Net channel attention mechanism to enhance the ability to capture long-distance dependencies, used to fuse deep image features. The training set was input into the flame detection network for training. Adam was selected as the optimizer, and the generalized intersection-union (GIoU) loss function was used. The trained flame detection network is used to detect flame targets and output the flame detection results.
[0009] In some exemplary embodiments, performing the data augmentation operation on the flame detection dataset specifically includes:
[0010] in, This represents data that has undergone augmentation. Represents the original data, while , , and These represent the flip, crop, scale, and rotate operations, respectively.
[0011] In some exemplary embodiments, the backbone feature extraction network specifically includes the following steps: The lightweight vision transformer MobileViT module is seamlessly integrated into the YOLOv8 backbone network; the parameters and internal structure of the MobileViT module are finely optimized to achieve a significant reduction in the overall model size; the reduction in model size can be expressed by the formula for reducing the number of parameters:
[0012] in, For the first The number of parameters in the layer The separation coefficients of the convolution kernel. This represents the total number of floors. In some exemplary embodiments, the neck feature fusion network specifically includes the following steps: By utilizing the Feature Pyramid Network (FPN), multi-level feature extraction is systematically performed on feature maps of different scales. A feature aggregation network is used to perform weighted fusion of multi-scale feature maps from the FPN; feature aggregation can be represented as:
[0013] in, For the first Feature maps at each level, These are weighting coefficients. Number of feature layers; During feature aggregation, the ECA-Net channel attention mechanism is introduced, and the attention weight calculation formula is as follows:
[0014] in, For attention weights, for Activation function This is a convolution operation.
[0015] In some exemplary embodiments, the generalized intersection-union ratio (GIoU) loss function is specifically:
[0016]
[0017]
[0018] in, The intersection-union ratio (IUU) of the predicted bounding box and the ground truth bounding box. The distance between the center points of the predicted bounding box and the ground truth bounding box is the Euclidean distance. and These are the center points of the predicted bounding box and the ground truth bounding box, respectively. This is the diagonal distance between the smallest bounding rectangle between the predicted bounding box and the ground truth bounding box. For weight parameters, For consistent length and width parameters, and These are the widths of the predicted bounding box and the ground truth bounding box, respectively. and These represent the heights of the predicted bounding box and the ground truth bounding box, respectively.
[0019] In some exemplary embodiments, the flame detection result is expressed as:
[0020] in, Indicates the first The bounding box of each target. For the target category, Score the confidence level. This represents the total number of targets detected.
[0021] According to a second aspect of the present invention, a flame detection device based on an edge-adaptive Transformer architecture is provided, comprising: Data acquisition and annotation module: Collects flame images and video data from different scenes, and accurately annotates flame location information using Labelimg and Labelme tools to construct a flame detection dataset, which is divided into training and testing sets; Data augmentation module: Used to perform data augmentation operations on the flame detection dataset; Backbone Feature Extraction Module: Based on the YOLOv8 backbone network optimized by MobileViT, it is used to extract and integrate local and global features of flame data while reducing the model size; Neck feature fusion module: Composed of FPN, feature aggregation network and ECA-Net channel attention mechanism, it is used to weighted fuse multi-scale feature maps to improve the ability to capture long-distance dependencies; Detection module: Used to output the bounding box, category, and confidence information of the flame target using the improved detection algorithm; Model training module: The network consisting of the backbone feature extraction module and the neck feature fusion module is trained using the Adam optimizer and the GIoU loss function.
[0022] According to a third aspect of the present invention, a storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the flame detection method based on the edge adaptive Transformer architecture described in the first aspect above.
[0023] According to a fourth aspect of the present invention, a computer program product is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, it implements the flame detection method based on the edge adaptive Transformer architecture described in the first aspect above.
[0024] According to a fifth aspect of the present invention, an electronic device is provided, comprising: Processor; and Memory for storing the executable instructions of the processor; The processor is configured to implement the flame detection method based on the edge adaptive Transformer architecture described in the first aspect above by executing the executable instructions.
[0025] The flame detection method and apparatus based on an edge-adaptive Transformer architecture provided by embodiments of the present invention integrate advanced deep learning target detection and recognition algorithms to achieve extremely high-precision flame detection, thereby significantly improving the safety and overall efficiency of the flame processing. By optimizing the YOLOv8 backbone feature extraction network and integrating the lightweight visual transformer MobileViT, the model's ability to extract local and global information is effectively enhanced, while the model size is reduced, greatly facilitating its efficient deployment on edge devices. The introduction of the ECA-Net channel attention mechanism further improves the neck feature fusion network, significantly enhancing the network's ability to capture long-distance dependencies, thereby strengthening feature representation and fusion effects. In summary, the present invention achieves intelligent flame detection with multiple advantages such as high detection accuracy, strong real-time performance, lightweight model, and strong adaptability. It is widely applicable to flame monitoring and management tasks in various complex environments, demonstrating significant application prospects and great promotional value.
[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description
[0027] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention. It is obvious that the drawings described below are merely some embodiments of the invention, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0028] Figure 1 A flowchart of the flame detection method based on the edge adaptive Transformer architecture of the present invention is shown.
[0029] Figure 2 The diagram shows the flame target detection network model designed in this invention.
[0030] Figure 3 The diagram shows the ECA channel attention mechanism model used in this invention.
[0031] Figure 4 The flame detection system integrated with the method of the present invention is shown.
[0032] Figure 5The results of flame target detection generated by the method of the present invention are shown. Detailed Implementation
[0033] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that the invention will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0034] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0035] To overcome the inherent problems of low accuracy and poor real-time performance in complex environments of existing target detection methods, this invention proposes a flame detection method based on an edge-adaptive Transformer architecture. This method employs an optimized YOLOv8 model, combined with the lightweight visual transformer MobileViT, to enhance the backbone feature extraction network's ability to extract local and global information. Simultaneously, an ECA-Net channel attention mechanism is introduced to improve the localization and recognition capabilities of multi-scale targets, thereby achieving high-precision flame target detection. Through these steps, this invention aims to achieve high-precision flame detection in various complex and variable environments, significantly improving the safety and efficiency of flame processing, and providing an efficient and reliable flame monitoring solution.
[0036] Figure 1The overall flowchart of the method of this invention covers the following core processes: collecting image and video data from different scenes, and using Labelimg and Labelme tools to annotate the flames to establish a flame detection dataset; subsequently, performing data augmentation on the dataset to generate training and testing sets; enhancing the ability of the YOLOv8 model to extract local and global information by optimizing the backbone feature extraction network; then, using ECA-Net to optimize the neck feature fusion network to improve the network's ability to capture long-distance dependencies; finally, applying the improved detection algorithm to the detection of flame targets to obtain the target's bounding box, category, and confidence information. By combining YOLOv8 deep learning detection with efficient recognition algorithms, this invention achieves high-precision detection in complex environments, significantly improving the safety and efficiency of flame processing, and is applicable to flame monitoring and management in various scenarios. The method specifically includes the following steps: Step 1: Collect flame images and video data from different scenes. For video data, convert it into image sequences through frame-by-frame processing. Use the Labelimg tool to annotate the flame targets in the images with rectangular boxes, and use the Labelme tool to perform fine-grained auxiliary annotation of the flame shape with complex edges, so as to accurately obtain the flame position coordinate information to build a flame detection dataset. Then, the dataset samples are accurately divided into a flame detection training set and a test set at a ratio of 9:1. Step 2: Perform a series of data augmentation operations on the flame detection dataset, including rotation, scaling, cropping, and flipping, to expand and enrich the diversity of the dataset:
[0037] in, This represents data that has undergone augmentation. Represents the original data, while , , and These represent the flip, crop, scale, and rotate operations, respectively; Step 3: Reference Figure 2 The detection training samples are input into the improved backbone feature extraction network to train the model on the training set. This backbone feature extraction network optimizes the backbone of the traditional YOLOv8 object detection model based on the lightweight visual transformer MobileViT. Its purpose is to enhance the network's ability to extract and integrate local and global information from the input data while reducing the overall model size. refer to Figure 2 The MobileViT optimized backbone feature extraction network specifically includes the following steps: Step 3-1: Seamlessly integrate the lightweight vision transformer MobileViT module into the YOLOv8 backbone network to enhance feature extraction capabilities through its self-attention mechanism, thereby improving the network's accuracy in accurately identifying flames in complex environments; Step 3-2: Fine-tune the parameters and internal structure of the MobileViT module to significantly reduce the overall model size. This optimization is crucial to ensuring that the model maintains its robust detection performance while simultaneously improving its operational efficiency and real-time processing capabilities. The reduction in model size achieved by introducing the MobileViT module and optimizing its internal structure can be expressed by the formula for reducing the number of parameters:
[0038] in, For the first The number of parameters in the layer The separation coefficients of the convolution kernel. This represents the total number of floors.
[0039] Step 3-3: The specific processing flow of the backbone feature extraction network is as follows: 1. Input processing: The input flame image is first processed through the network input layer, which consists of a CBS module with a stride of 2 (containing 3×3 convolution, BatchNorm batch normalization and SiLU activation function) to perform preliminary downsampling and feature transformation on the image, halving the image spatial size; 2. Shallow Feature Extraction: The next step is shallow feature extraction, where the data is processed sequentially through CBS downsampling with a stride of 2 and the C2f module. The C2f module references the CSPNet structure and includes "Split, Bottleneck, and Concat" operations, extracting local texture features such as the flame's edge and color through rich gradient flow branches. 3. Deep Feature Extraction (MobileViT Optimization): In the deep layers of the network backbone, the MobileViT module replaces the traditional convolutional stacking structure. Internally, the MobileViT module first encodes local features through convolutional layers, then uses Transformer blocks to unfold into sequences for global self-attention computation, and finally projects the local and global features back to the original dimensions. This step aims to capture long-range dependencies in flame morphology (such as the spread of a large fire), compensating for the limited receptive field of CNNs. 4. Spatial Pyramid Pooling (SPPF): The final output of the backbone passes through the SPPF module, which processes the feature map in parallel through three 5×5 max pooling layers and concatenates the results of each branch. Without changing the resolution of the feature map, it further integrates receptive field information of different scales to output the final backbone feature map.
[0040] Step 4: Reference Figure 2 The deep feature representation information of the image obtained from step 3 above is further fed into the neck feature fusion network of the network. The core architecture of this neck feature fusion network consists of a feature pyramid network (FPN) and a feature aggregation network, which is specifically used to perform weighted fusion of feature maps from different levels and spatial sizes to significantly improve the network's ability to accurately locate and identify multi-scale flame targets. At the same time, the feature fusion network is further improved by introducing the ECA-Net channel attention mechanism, which essentially improves the network's ability to identify and capture long-distance dependencies in feature maps, thereby greatly enhancing the overall feature representation and fusion efficiency of the model. refer to Figure 3 The ECA-Net-optimized neck feature fusion network specifically includes the following steps: Step 4-1: By utilizing the Feature Pyramid Network (FPN), multi-level feature extraction is systematically performed on feature maps of different scales. This comprehensive process is crucial for effectively capturing and identifying flame feature information at various sizes and resolutions. Step 4-2: A specialized feature aggregation network is used to perform weighted fusion of multi-scale feature maps from the FPN. This strategic fusion process aims to significantly enhance the network's ability to detect multi-scale targets and improve its robustness to targets of different sizes. Feature aggregation can be represented as:
[0041] in, For the first Feature maps at each level, These are weighting coefficients. This represents the number of feature layers.
[0042] Step 4-3: In the crucial feature aggregation process, the ECA-Net channel attention mechanism was strategically introduced. This mechanism works by precisely adjusting the channel weights of the fused feature maps, thereby significantly increasing the network's attention to salient and important features. This integration further improves the overall efficiency of feature representation and fusion within the model. The attention weight calculation formula is as follows:
[0043] in, For attention weights, for Activation function This is a convolution operation.
[0044] Step 4-4: The neck feature fusion network adopts the PANet (Path Aggregation Network) structure and embeds the ECA-Net attention mechanism. The specific process is as follows: 1. Top-down semantic transfer (FPN path): Receives feature maps from deep layers of the backbone network, first performs an upsampling operation to enlarge their size, then concatenates them with feature maps output from mid-layers of the backbone network along the channel dimension. The concatenated features are then fused by the C2f module, upsampled again, and concatenated with shallower feature maps. This process transfers strong semantic information from deep layers to shallower layers, improving the detection capability for small flame targets. 2. Bottom-up Localization Enhancement: Based on the FPN output, the network performs bottom-up path aggregation. Shallow feature maps are downsampled through convolutional layers (Conv) with a stride of 2, and then concatenated (Concat) with the corresponding upper-layer feature maps and processed by the C2f module. This process transmits accurate localization information from the shallow layers to the deeper layers; 3. ECA-Net Channel Attention Weighting: At the key node of the feature fusion described above (i.e., before the output of features at each scale to the detection head in the path), the ECA-Net module is introduced. This module does not perform dimensionality reduction operations, but instead adaptively captures the interaction information between channels through one-dimensional convolution (1DConv), calculates the weight coefficient of each channel, and multiplies it back into the original feature map. This allows the network to automatically suppress interfering channels with background noise (such as light and reflections), focus on enhancing the response of channels containing flame features, and finally output feature maps at three scales to the detection head.
[0045] Step 5: Utilize a comprehensively improved detection algorithm to perform efficient flame target detection on the previously collected flame data. This process obtains accurate information about detected target bounding boxes, category classification, and relevant confidence scores. The detection results can be represented as follows:
[0046] in, Indicates the first The bounding box of each target. For the target category, Score the confidence level. The total number of targets detected; Step 6: Rigorously train the flame detection network described in Steps 3 to 4 above, using Adam as the optimizer and the Generalized Intersection over Union (GIoU) loss function.
[0047]
[0048]
[0049] in, The intersection-union ratio (IUU) of the predicted bounding box and the ground truth bounding box. The distance between the center points of the predicted bounding box and the ground truth bounding box is the Euclidean distance. and These are the center points of the predicted bounding box and the ground truth bounding box, respectively. This is the diagonal distance between the smallest bounding rectangle between the predicted bounding box and the ground truth bounding box. For weight parameters, For consistent length and width parameters, and These are the widths of the predicted bounding box and the ground truth bounding box, respectively. and These are the heights of the predicted bounding box and the ground truth bounding box, respectively. Step 7: Use the flame detection method based on the edge adaptive Transformer architecture to actually detect the flame target.
[0050] refer to Figure 4 The method of this invention can effectively achieve high-precision detection of flames in complex environments. The effectiveness of the method of this invention is further illustrated by the following simulation experiments.
[0051] 1. Simulation conditions. The method of this invention was performed under the following precise simulation environment: the central processing unit (CPU) was an Intel Core i7-9750H, the memory (RAM) was 32GB, the graphics processing unit (GPU) was an Nvidia RTX3090, the operating system (OS) was WINDOWS10, and the Anaconda software environment was used.
[0052] 2. Simulation content. The simulation used six randomly collected flame video sequences, named Flame Video 1 to Flame Video 6. To demonstrate the effectiveness of the method, the method was applied to these six flame videos, and the results were compared with those obtained through manual detection. The comparison results are shown in Table 1. As can be seen from Table 1, the flame detection results obtained by the method of the present invention are consistent with those obtained through manual detection. Applying the method of the present invention to different scenarios will significantly improve the automation level of flame monitoring, which is beneficial for strengthening flame monitoring and management, and has broad application prospects and promotional value. Table 1
[0053] This invention proposes a novel flame detection approach utilizing advanced deep learning object detection and recognition algorithms. Its core objective is to address the inherent limitations of traditional detection techniques, particularly their insufficient accuracy and poor real-time performance when deployed in complex dynamic scenes. The proposed method encompasses the following key steps: systematically collecting flame image and video data from various real-world scenarios; then, using professional annotation tools such as Labellimg and Labelme, accurately labeling the precise location information of flames in the acquired visual data to construct a comprehensive dataset for flame recognition and detection; performing strategic data augmentation operations on the established flame detection dataset, including rotation, scaling, cropping, and flipping operations, aiming to significantly expand the dataset's size and enrich its inherent diversity, thereby generating robust training and testing subsets; and seamlessly integrating Mobil's basic feature extraction network of the YOLOv8 model. The eViT architecture has undergone key enhancements. This optimization effectively reduces the overall model complexity and number of parameters while significantly improving the network's ability to extract and fuse local and global information from input data. The neck feature fusion network has been further improved by introducing the ECA-Net channel attention mechanism. This enhancement significantly improves the network's ability to identify and capture long-distance dependencies in feature maps, thereby comprehensively enhancing the model's feature representation and fusion efficiency. The comprehensively improved detection algorithm was then applied to efficiently identify flame targets in the collected flame data. This process can obtain accurate information about the detected target bounding boxes, category classification, and relevant confidence scores. Leveraging the advanced target detection capabilities of the improved YOLOv8, this invention can achieve high-precision flame detection in various complex environments, thereby significantly improving the safety and efficiency of flame processing. The constructed model has inherent advantages such as simplified structure, high integration, and strong adaptability, making it very suitable for various flame monitoring environments and demonstrating significant commercial feasibility and broad promotional value.
[0054] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0055] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the claims.
[0056] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is defined only by the appended claims.
Claims
1. A flame detection method based on edge adaptive Transformer architecture, characterized in that, The method includes: We collected flame images and video data from different scenes, and used Labelimg and Labelme tools to accurately label the flame location information to construct a flame detection dataset, which was divided into training and testing sets. Perform data augmentation on the flame detection dataset; A flame detection network is constructed, comprising a backbone feature extraction network and a neck feature fusion network. The backbone feature extraction network is an optimization of the backbone of the traditional YOLOv8 target detection model based on the lightweight visual transformer MobileViT, used to extract deep image features. The neck feature fusion network consists of a feature pyramid network FPN and a feature aggregation network, and introduces the ECA-Net channel attention mechanism to enhance the ability to capture long-distance dependencies, used to fuse deep image features. The training set was input into the flame detection network for training. Adam was selected as the optimizer and the generalized intersection-union (GIoU) loss function was used. The trained flame detection network is used to detect flame targets and output the flame detection results.
2. The method according to claim 1, characterized in that, The data augmentation operation performed on the flame detection dataset specifically includes: in, This represents data that has undergone augmentation. Represents the original data, while , , and These represent the flip, crop, scale, and rotate operations, respectively.
3. The method according to claim 1, characterized in that, The backbone feature extraction network specifically includes the following steps: The lightweight vision transformer MobileViT module is seamlessly integrated into the YOLOv8 backbone network; the parameters and internal structure of the MobileViT module are finely optimized to achieve a significant reduction in the overall model size; the reduction in model size can be expressed by the formula for reducing the number of parameters: in, For the first The number of parameters in the layer The separation coefficients of the convolution kernel. This represents the total number of floors.
4. The method according to claim 1, characterized in that, The neck feature fusion network specifically includes the following steps: By utilizing the Feature Pyramid Network (FPN), multi-level feature extraction is systematically performed on feature maps of different scales. A feature aggregation network is used to perform weighted fusion of multi-scale feature maps from the FPN; feature aggregation can be represented as: in, For the first Feature maps at each level, These are weighting coefficients. Number of feature layers; During feature aggregation, the ECA-Net channel attention mechanism is introduced, and the attention weight calculation formula is as follows: in, For attention weights, for Activation function This is a convolution operation.
5. The method according to claim 1, characterized in that, The generalized intersection-union ratio (GIoU) loss function is as follows: in, The intersection-union ratio (IUU) of the predicted bounding box and the ground truth bounding box. The distance between the center points of the predicted bounding box and the ground truth bounding box is the Euclidean distance. and These are the center points of the predicted bounding box and the ground truth bounding box, respectively. This is the diagonal distance between the smallest bounding rectangle between the predicted bounding box and the ground truth bounding box. For weight parameters, For consistent length and width parameters, and These are the widths of the predicted bounding box and the ground truth bounding box, respectively. and These represent the heights of the predicted bounding box and the ground truth bounding box, respectively.
6. The method according to claim 4, characterized in that, The flame detection result is expressed as follows: in, Indicates the first The bounding box of each target. For the target category, Score the confidence level. This represents the total number of targets detected.
7. A flame detection device based on an edge-adaptive Transformer architecture, characterized in that, The device includes: Data acquisition and annotation module: Collects flame images and video data from different scenes, and accurately annotates flame location information using Labelimg and Labelme tools to construct a flame detection dataset, which is divided into training and testing sets; Data augmentation module: Used to perform data augmentation operations on the flame detection dataset; Backbone Feature Extraction Module: Based on the YOLOv8 backbone network optimized by MobileViT, it is used to extract and integrate local and global features of flame data while reducing the model size; Neck feature fusion module: Composed of FPN, feature aggregation network and ECA-Net channel attention mechanism, it is used to weighted fuse multi-scale feature maps to improve the ability to capture long-distance dependencies; Detection module: Used to output the bounding box, category, and confidence information of the flame target using the improved detection algorithm; Model training module: The network consisting of the backbone feature extraction module and the neck feature fusion module is trained using the Adam optimizer and the GIoU loss function.
8. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the flame detection method based on the edge adaptive Transformer architecture as described in any one of claims 1 to 6.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the flame detection method based on the edge adaptive Transformer architecture as described in any one of claims 1 to 6.
10. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the flame detection method based on the edge adaptive Transformer architecture as described in any one of claims 1 to 6 by executing the executable instructions.