A training method and system for a lightweight small target forest fire detection model

By using the StarELAN network and LSK attention mechanism in forest fire detection, combined with the training method of the Inner-CIoU loss function, the problem of insufficient small target fire detection capabilities and real-time performance in the existing technology is solved, and fast and accurate detection of small target fires is achieved. detection and efficient identification.

CN118397402BActive Publication Date: 2024-10-11NANCHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410863073.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-29
Publication Date
2024-10-11
Estimated Expiration
2044-06-29

AI Technical Summary

Technical Problem

Existing forest fire detection methods have insufficient accuracy in complex environments, especially for small target fire detection capabilities, and the real-time performance and response speed need to be improved.

Method used

The training method of the lightweight small target forest fire detection model is adopted, and the StarELAN network is used as the feature extraction network of the YOLOv9 model. The small target detection head is added and the LSK attention mechanism is introduced. The Inner-CIoU loss function is used to optimize the model training and improve the detection of small targets. Target fire detection capabilities.

Benefits of technology

It achieves rapid and accurate detection of small target forest fires, improves detection accuracy and real-time performance in complex backgrounds, is suitable for embedded devices, and enhances the ability to identify small target fires.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118397402B_ABST
    Figure CN118397402B_ABST
Patent Text Reader

Abstract

The invention discloses a training method and system for a lightweight small-target forest fire detection model, and relates to the technical field of forest fire detection. The training method comprises: obtaining an initial image data set about forest fires and performing data enhancement; constructing a StarELAN network, using the StarELAN network as the main network for feature extraction in a YOLOv9 model, and reducing and adjusting the YOLOv9 model to lightweight the YOLOv9 model; adding a small-target detection head in the lightweight YOLOv9 model, and introducing an LSK attention mechanism in all detection heads to capture small-target forest fires; constructing an Inner‑CIoU loss function, and using it as the final loss function of the lightweight small-target forest fire detection model; and according to the loss function, performing detection training on the lightweight small-target forest fire detection model using the initial image data set after data enhancement. Therefore, the forest fire detection model obtained based on the training method can quickly and accurately detect small-target forest fires.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of forest fire detection, and in particular to a training method and system for a lightweight small-target forest fire detection model. Background Art

[0002] Traditional fire detection methods mainly rely on manual patrols and ground monitoring equipment, but these methods have limited coverage, slow response speed, and difficulty in timely detection and control of fires. With the development of science and technology, computer vision technology has gradually played an important role in forest fire detection. Computer vision technology uses image processing and pattern recognition algorithms to extract useful information from images or videos taken by cameras, drones and satellites to automatically identify and locate fires. This technology can greatly improve the accuracy and efficiency of fire detection, achieve early warning and rapid response to fires, and reduce the losses caused by fires. At present, commonly used computer vision methods include convolutional neural networks (CNNs), target detection algorithms (such as YOLO, Faster R-CNN), and image segmentation technologies (such as U-Net). Through deep learning algorithms trained on a large number of fire images, these methods can identify flame and smoke characteristics, especially with the assistance of drones and satellites, they can monitor large areas in real time and provide high-precision fire image data.

[0003] Although computer vision technology has shown great potential in forest fire detection, there are still some defects and shortcomings. First, the accuracy of fire detection is affected by environmental conditions. In a complex forest environment, factors such as lighting changes, tree occlusion, and smoke diffusion will interfere with image quality, resulting in false positives and false negatives in the detection algorithm. In addition, natural phenomena such as shadows, haze, and clouds will also interfere with fire identification, increasing the difficulty of detection and reducing the speed of the detection algorithm. Second, the inability of existing fire detection models to handle small target fires is also an important problem. Small-scale fire sources are often not easily captured by traditional detection algorithms in the early stages. These algorithms usually perform well for large-scale fires, but are prone to false positives when detecting small fire points in the early stages, thus missing the best time to extinguish the fire. Third, the real-time performance and response speed of existing fire detection systems still need to be improved. Although deep learning algorithms can quickly process image data, there are still challenges in real-time monitoring and early warning in large areas, and further optimization of algorithms and improvement of computing resource utilization efficiency are needed. Summary of the invention

[0004] Based on this, this application proposes a training method and system for a lightweight small target forest fire detection model, aiming to detect small target forest fires quickly and accurately.

[0005] A first aspect of the present application provides a training method for a lightweight small target forest fire detection model, the method comprising:

[0006] Acquire an initial image dataset about forest fires, and perform data enhancement on the initial image dataset;

[0007] Constructing a StarELAN network, using the StarELAN network as the main network for feature extraction in the YOLOv9 model, and scaling down the YOLOv9 model to lightweight the YOLOv9 model;

[0008] A small target detection head is added to the lightweight YOLOv9 model, and the LSK attention mechanism is introduced in all detection heads to capture small target forest fires;

[0009] Constructing an Inner-CIoU loss function, and using the Inner-CIoU loss function as the final loss function of the lightweight small target forest fire detection model;

[0010] According to the Inner-CIoU loss function, the initial image dataset after data enhancement is used to perform detection training on the lightweight small target forest fire detection model.

[0011] Compared with the prior art, the present application provides a training method for a lightweight small target forest fire detection model. On the one hand, the training method proposes a lightweight feature extraction network suitable for embedded devices. The lightweight feature extraction network includes a StarELAN network, and the StarELAN network is used as a feature extraction network in the YOLOv9 model to increase the receptive field and reduce the model parameters. The StarELAN network is a lightweight and efficient network architecture that can meet high-precision requirements while maintaining lightweight and fast response; on the other hand, a small target detection head is added to enhance the detection capability of small target forest fires. By using the LSK attention mechanism, the detection accuracy is improved, complex backgrounds are processed, feature expression is enhanced, and context information capture capabilities are improved. In addition, the loss function of CIoU of YOLOv9 is replaced by Inner-CIoU, which further enhances the detection capability of small target forest fires. Therefore, the forest fire detection model obtained by the present application based on the training method can quickly and accurately detect small target forest fires.

[0012] As an optional implementation manner of the first aspect, an Inner-CIoU loss function is constructed, and the Inner-CIoU loss function is used to optimize the training of the forest fire detection model, wherein the formula of the constructed Inner-CIoU loss function is:

[0013] ,

[0014] in, represents the final Inner-CIoU loss, represents CIoU loss, IoU represents the intersection-over-union ratio between the predicted box and the target box, Represents the IoU value of the auxiliary box, where

[0015] ,

[0016] ,

[0017] ,

[0018] in, ,

[0019] ,

[0020] ,

[0021] ,

[0022] Among them, inter represents the area of ​​the intersection of the auxiliary box corresponding to the real box and the auxiliary box corresponding to the predicted box, and union represents the area of ​​the union of the auxiliary box corresponding to the real box and the auxiliary box corresponding to the predicted box. , represents the width and length of the real box, ( , ) represents the center coordinate of the real frame, ( , ) represents the center coordinate of the anchor box, w and h represent the width and height of the anchor box respectively, and ratio is the corresponding scale factor. , Respectively represent the horizontal coordinates of the auxiliary frame corresponding to the real frame, , Represent the ordinates of the four vertices of the auxiliary frame corresponding to the real frame, Respectively represent the horizontal coordinates of the auxiliary frame corresponding to the prediction frame, , They represent the ordinate of the auxiliary box corresponding to the predicted box.

[0023] As an optional implementation of the first aspect, the extraction process of using the StarELAN network as the main network for feature extraction in the YOLOv9 model includes:

[0024] Input the initial tensor for 1×1 pointwise convolution, then perform batch normalization and apply the SiLU activation function. Evenly divide the output initial tensor along the channel dimension into Tensor 1 and Tensor 2. Input Tensor 2 into the BandBlock structure to obtain Tensor 3. Multiply Tensor 1, Tensor 2, and Tensor 3 along the channel dimension, and then perform 1×1 pointwise convolution, batch normalization, and SiLU activation to obtain the tensor output of the StarELAN network.

[0025] The process of inputting Tensor 2 into the BandBlock structure to obtain Tensor 3 includes:

[0026] Input Tensor 2, first perform 1×7 bar convolution, then perform batch normalization and apply the SiLU activation function, and then perform 7×1 bar convolution, followed by batch normalization and the SiLU activation function to obtain the output Tensor 3.

[0027] As an optional implementation manner of the first aspect, the adjustment process of downsizing the YOLOv9 model includes:

[0028] Adjust the channel scaling factor and depth scaling factor of the YOLOv9 model to reduce the number of network channels to one-fourth of the original and reduce the number of repetitions to one-third of the original.

[0029] As an optional implementation manner of the first aspect, the process of adding a small target detection head to the lightweight YOLOv9 model and introducing the LSK attention mechanism into all detection heads includes:

[0030] Set the number of detection heads in the lightweight YOLOv9 model to N, where the number of added small target detection heads is M, and M < N. After the input image dataset is subjected to feature extraction through the StarELAN network, it is respectively input into the corresponding detection heads of the StarELAN network. After feature fusion through the PANet network, N feature layers are obtained according to the LSK attention mechanism in each detection head, where M of the N feature layers represent the feature layers detecting small target forest fires.

[0031] The processing process of the LSK attention mechanism includes:

[0032] Input the output tensor of the StarELAN network, and output it as attention through depthwise separable convolution Figure 1 , attention Figure 1 Output it as attention through dilated convolution Figure 2 , attention Figure 1 and attention Figure 2 Halve the number of channels through convolution, and then fuse the attention Figure 1 and attention Figure 2Connect in the channel dimension to get the attention map, calculate the average attention and maximum attention of the attention map, connect in the channel dimension to get output one, convolve output one, and use the sigmoid activation function to get the channel attention weight. Figure 1 and the attention Figure 2 Multiply them by the channel attention weights respectively, perform weighted summation on the channel dimension, and obtain a weighted feature map. The weighted feature map restores the original number of channels through convolution. The output tensor of the StarELAN network is multiplied by the weighted feature map to obtain the output of the LSK attention mechanism.

[0033] A second aspect of an embodiment of the present application provides a forest fire detection method based on a lightweight small target forest fire detection model, the forest fire detection method comprising: acquiring an initial image of a forest fire, inputting the initial image into the above-mentioned lightweight small target forest fire detection model, and outputting a detection result.

[0034] A third aspect of an embodiment of the present application provides a training system for a lightweight small target forest fire detection model, the system comprising:

[0035] A data acquisition module, used to acquire an initial image dataset about forest fires and perform data enhancement on the initial image dataset;

[0036] A lightweight feature extraction module is used to construct a StarELAN network, use the StarELAN network as the main network for feature extraction in the YOLOv9 model, and reduce and adjust the YOLOv9 model to lightweight the YOLOv9 model;

[0037] A small target detection module is used to add a small target detection head to the lightweight YOLOv9 model and introduce the LSK attention mechanism in all detection heads to capture small target forest fires;

[0038] A loss calculation module, used for constructing an Inner-CIoU loss function, and using the Inner-CIoU loss function as the final loss function of the lightweight small target forest fire detection model;

[0039] The result output module is used to perform detection training on the lightweight small target forest fire detection model using the data-enhanced initial image dataset according to the Inner-CIoU loss function.

[0040] The fourth aspect of an embodiment of the present application provides a computer device, which includes a memory, a processor, and a processing program stored in the memory and executable on the processor, wherein the processing program, when executed by the processor, implements the above-mentioned training method for a lightweight small target forest fire detection model.

[0041] Additional aspects and advantages of the present application will be given in part in the following description, and in part will become apparent from the following description, or will be understood through the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A flowchart of a training method for a lightweight small target forest fire detection model proposed in the first embodiment of the present application;

[0043] Figure 2 This is the overall structure diagram of the lightweight small target forest fire detection model proposed in the first embodiment of the present application;

[0044] Figure 3 This is a diagram of the StarELAN network structure proposed in the first embodiment of the present application;

[0045] Figure 4 The BandBlock structure diagram in the StarELAN network proposed in the first embodiment of the present application;

[0046] Figure 5 This is a network structure diagram of the LSK attention mechanism proposed in the first embodiment of the present application;

[0047] Figure 6 A schematic diagram of the structure of a training system for a lightweight small target forest fire detection model proposed in the third embodiment of the present application.

[0048] The following specific implementation methods will further illustrate the present application in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0049] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Several embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.

[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0051] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.

[0052] The first embodiment of the present application proposes a training method for a lightweight small target forest fire detection model, such as Figure 1 FIG. 1 is a flow chart of a training method according to a first embodiment. Figure 2 This is the overall structural diagram of the lightweight small target forest fire detection model proposed in the first embodiment of the present application.

[0053] Step S01: Acquire an initial image dataset about forest fires, and perform data enhancement on the initial image dataset.

[0054] Specifically, step S01 can be subdivided into step S011 and step S012, wherein:

[0055] Step S011: Acquire an initial image dataset of forest fire;

[0056] It should be noted that the D-Fire dataset is a fire and smoke image dataset designed for machine learning and object detection algorithms. The image dataset can be further divided into a training set and a validation set in a ratio of 8:2, which are used for model training and result verification, respectively.

[0057] Step S012: performing data enhancement processing on the initial image data set;

[0058] Exemplarily, the data enhancement methods provided by YOLOv9 are used, such as mosaic data enhancement (mosic), image mixing (mixup), etc.

[0059] It should be noted that mosaic data augmentation is an effective data augmentation technology that increases the diversity and complexity of training data by randomly cropping, scaling, and splicing images, improving the generalization ability of the target detection model and the ability to detect small targets. In target detection models such as YOLOv4, mosaic data augmentation has proven its significant effect.

[0060] Image mixing (mixup) data enhancement is an effective technique that generates new training samples by linearly mixing images and labels, thereby increasing the diversity of training data and improving the generalization ability, robustness and smooth decision boundaries of the model. This method has been widely used in tasks such as image classification and object detection, and has significantly improved the performance of the model.

[0061] Step S02: constructing a StarELAN network, using the StarELAN network as the main network for feature extraction in the YOLOv9 model, and reducing and adjusting the YOLOv9 model to lightweight the YOLOv9 model.

[0062] Specifically, step S02 of improving the YOLOv9 model can be subdivided into step S021 and step S022, wherein:

[0063] Step S021: The YOLOv9 model is scaled down by adjusting the width and depth scaling factors of the network.

[0064] Exemplarily, the channel scaling factor may be adjusted to 1 / 4 of the original value, that is, the number of network channels may be reduced to one quarter of the original value, and the depth scaling factor may be adjusted to reduce the number of repetitions to one third of the original value.

[0065] Step S022: Replace the feature extraction network in the YOLOv9 model with the StarELAN network.

[0066] It is understandable that in the YOLOv9 model, the RepNCSPELAN4 network is usually used as the main network for feature extraction of the YOLOv9 model. Although the RepNCSPELAN4 network can improve the performance of the model by optimizing the network structure, in some cases, this complex network structure does not always bring higher accuracy. Therefore, in this application, the StarELAN network is used to replace the RepNCSPELAN4 network in the YOLOv9 model as the main network for feature extraction.

[0067] Specifically, Figure 3 As shown, it is a StarELAN network structure diagram proposed in the first embodiment of the present application, where S represents the convolution step size and K represents the convolution kernel size;

[0068] The extraction process of using the StarELAN network as the main network for feature extraction in the YOLOv9 model includes:

[0069] Input the initial tensor for 1×1 pointwise convolution, followed by batch normalization and the SiLU activation function. Uniformly divide the output initial tensor along the channel dimension into Tensor 1 and Tensor 2. Input Tensor 2 into the BandBlock structure to obtain Tensor 3. Multiply Tensor 1, Tensor 2, and Tensor 3 along the channel dimension, and then perform 1×1 pointwise convolution, batch normalization, and the SiLU activation to obtain the tensor output of the StarELAN network.

[0070] Further, as Figure 4 shown, it is the BandBlock structure diagram in the StarELAN network proposed in the first embodiment of the present application, where S represents the convolution stride and K represents the convolution kernel size. The process of inputting Tensor 2 into the BandBlock structure to obtain Tensor 3 includes:

[0071] Input Tensor 2, first perform a 1×7 bar convolution, followed by batch normalization and the SiLU activation function, then perform a 7×1 bar convolution, followed by batch normalization and the SiLU activation function, to obtain the output Tensor 3.

[0072] It should be noted that in another embodiment, step S022 can also be performed first and then step S021, that is, the feature extraction network in the YOLOv9 model can be replaced with the StarELAN network first, and then the width and depth scaling factors of the network can be adjusted to scale down the YOLOv9 model. In the present application, the order of step S022 and step S021 is not limited, and a lightweight feature extraction YOLOv9 model can be obtained.

[0073] Step S03: Add a small target detection head to the lightweight YOLOv9 model, and introduce the LSK attention mechanism into all detection heads to capture small target forest fires.

[0074] Specifically, connect the PANet feature fusion network to the output end of the feature extraction network (StarELAN network) in the lightweight YOLOv9 model, and then connect all detection heads. All detection heads include the added small target detection head, which is used for the detection of small target forest fires.

[0075] Specifically, set the number of detection heads in the lightweight YOLOv9 model to N, where the number of added small target detection heads is M, and M < N. When the input image dataset is subjected to feature extraction through the StarELAN network, it is respectively input into the corresponding detection heads of the StarELAN network. After feature fusion through the PANet network, N feature layers are obtained according to the LSK attention mechanism in each detection head. Among them, M of the N feature layers represent the feature layers where small target forest fires are detected.

[0076] For example, Figure 2 As shown, there are four detection heads, including three conventional detection heads and one additional small target detection head. The conventional non-small target detection heads can be used to assist in correcting the detection results of the small target detection heads. The total number of detection heads and the number of small target detection heads can be set according to specific circumstances.

[0077] Furthermore, if Figure 5 As shown, it is a network structure diagram of the LSK attention mechanism proposed in the first embodiment of the present application, where K represents the convolution kernel size, and the data processing process of the LSK attention mechanism includes:

[0078] Input the output tensor x of the StarELAN network, and output it as attention through the depth-separable convolution Figure 1 attn1, attention Figure 1 attn1 outputs the attention through dilated convolution Figure 2 attn2, attention Figure 1 Attn1 and attention Figure 2 attn2 halves the number of channels through convolution and then focuses on Figure 1 and attention Figure 2 Connecting in the channel dimension to get attention Figure 3 attn3, calculate attention Figure 3 The average attention (avg_attn) and maximum attention (max_attn) of attn3 are connected in the channel dimension to obtain output agg, output agg is convolved, and the channel attention weight sig is obtained through the sigmoid activation function. Figure 1 and the attention Figure 2 Multiply them by the channel attention weight sig respectively, perform weighted summation on the channel dimension, and obtain the weighted feature map attn. The weighted feature map attn is restored to the original channel number dim through convolution. The output tensor x of the StarELAN network is multiplied by the weighted feature map attn to obtain the output of the LSK attention mechanism.

[0079] Step S04: construct an Inner-CIoU loss function, and use the Inner-CIoU loss function as the final loss function of the lightweight small target forest fire detection model.

[0080] Among them, the formula of the constructed Inner-CIoU loss function is:

[0081] ,

[0082] in, represents the final Inner-CIoU loss, represents CIoU loss, IoU represents the intersection-over-union ratio between the predicted box and the target box, Represents the IoU value of the auxiliary box, where

[0083] ,

[0084] ,

[0085] ,

[0086] in, ,

[0087] ,

[0088] ,

[0089] ,

[0090] Among them, inter represents the area of ​​the intersection of the auxiliary box corresponding to the real box and the auxiliary box corresponding to the predicted box, and union represents the area of ​​the union of the auxiliary box corresponding to the real box and the auxiliary box corresponding to the predicted box. , represents the width and length of the real box, ( , ) represents the center coordinate of the real frame, ( , ) represents the center coordinate of the anchor box, w and h represent the width and height of the anchor box respectively, and ratio is the corresponding scale factor, which is usually [0.5, 1.5]. , Respectively represent the horizontal coordinates of the auxiliary frame corresponding to the real frame, , Represent the ordinates of the four vertices of the auxiliary frame corresponding to the real frame, Respectively represent the horizontal coordinates of the auxiliary frame corresponding to the prediction frame, , They represent the ordinate of the auxiliary box corresponding to the predicted box.

[0091] Step S05: According to the Inner-CIoU loss function, the initial image dataset after data enhancement is used to perform detection training on the lightweight small target forest fire detection model.

[0092] Specifically, the forest fire detection model built in step S04 is trained using the training set in the image data set after data enhancement in step S01, a suitable training strategy is adopted for the constructed Inner-CIoU loss function, and the saved weights are continuously updated during the training process, and the verification set is used for detection to output the forest fire detection results.

[0093] For example, the training strategy can be set to input the target detection dataset into the improved YOLOv9 model and optimize it using the Adam optimizer. The A800 graphics card is used for training, and the initial learning rate is The final learning rate is , the weight decay is set to . The first 5 cycles are the warm-up phase, and the momentum used is 0.9. The momentum for formal training is 0.999. The IoU threshold for NMS (non-maximum suppression) is set to 0.5. The model is trained on an A800 graphics card, the batch size is set to 256 images, and the training cycle is set to 300. As the number of training times increases, the loss function curve of the improved YOLOv9 model gradually converges, the model performance gradually improves, and finally generates the optimal weight.

[0094] In summary, the present application provides a training method for a lightweight small target forest fire detection model. On the one hand, the training method proposes a lightweight feature extraction network suitable for embedded devices. The lightweight feature extraction network includes a StarELAN network, and the StarELAN network is used as a feature extraction network in the YOLOv9 model to increase the receptive field and reduce the model parameters. The StarELAN network is a lightweight and efficient network architecture that can meet high-precision requirements while maintaining lightweight and fast response; on the other hand, a small target detection head is added to enhance the detection capability of small target forest fires. By using the LSK attention mechanism, the detection accuracy is improved, complex backgrounds are processed, feature expression is enhanced, and context information capture capabilities are improved. Inner-CIoU is used to replace the loss function of CIoU of YOLOv9, which further enhances the detection capability of small target forest fires. Therefore, the forest fire detection model obtained by the present application based on the training method can quickly and accurately detect small target forest fires, and the lightweight small target forest fire detection model is suitable for embedded devices to further improve the accuracy and real-time performance of detection.

[0095] In a second embodiment of the present application, a forest fire detection method of a lightweight small target forest fire detection model is proposed, the method comprising:

[0096] An initial image of the forest fire is obtained, and the initial image is input into the lightweight small target forest fire detection model, and a detection result is output.

[0097] Specifically, first, the input image D1 is subjected to feature extraction through the StarELAN network. It can be understood that the small target detection head and other detection heads are set with a certain input and output pixel range. Assuming that the pixel size of the image processed by the feature extraction network is 160×160, a small target detection head and three other detection heads output four sets of feature maps with sizes of 160×160×256, 80×80×512, 40×40×1024, and 20×20×512 respectively. These four sets of feature map outputs pass through the PANet network and perform feature fusion through bottom-up and top-down methods to obtain four sets of outputs. Each set of outputs then passes through the network layer of the LSK attention mechanism respectively to obtain feature maps D2, D3, D4, and D5. Finally, the classification loss and regression loss are calculated respectively to obtain the final small target forest fire detection result. In the detection experiment of this embodiment, the detection result of small target forest fire will use the confidence value to represent the reliability of the detection result. As a result, three small target forest fires were detected, and the confidence values ​​of these three small target forest fires were 0.36, 0.63 and 0.77 respectively.

[0098] See also Figure 6 , shown is a structural schematic diagram of a training system for a lightweight small target forest fire detection model in the third embodiment of the present application, the system comprising:

[0099] A data acquisition module 10 is used to acquire an initial image dataset about forest fires and perform data enhancement on the initial image dataset;

[0100] A lightweight feature extraction module 20 is used to construct a StarELAN network, use the StarELAN network as a feature extraction network in a YOLOv9 model, and reduce and adjust the YOLOv9 model to lightweight the YOLOv9 model;

[0101] A small target detection module 30 is used to add a small target detection head to the lightweight YOLOv9 model, and introduce an LSK attention mechanism at the front end of the small target detection head to capture small target forest fires;

[0102] A loss calculation module 40 is used to construct an Inner-CIoU loss function and use the Inner-CIoU loss function as the final loss function of the lightweight small target forest fire detection model;

[0103] The result output module 50 is used to perform detection training on the lightweight small target forest fire detection model using the data-enhanced initial image dataset according to the Inner-CIoU loss function.

[0104] On the other hand, the present application also proposes a computer device, which includes a memory, a processor, and a processing program stored in the memory and executable on the processor, and when the processing program is executed by the processor, the training method of the above-mentioned lightweight small target forest fire detection model is implemented.

[0105] On the other hand, the present application further proposes a computer-readable storage medium, on which a processing program is stored. When the processing program is run by a processor, the training method of the above-mentioned lightweight small target forest fire detection model is executed.

[0106] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0107] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A training method for a lightweight small target forest fire detection model, characterized in that: The training method comprises: Acquire an initial image dataset about forest fires, and perform data enhancement on the initial image dataset; A StarELAN network is constructed, the StarELAN network is used as the main network for feature extraction in the YOLOv9 model, and the YOLOv9 model is reduced and adjusted to lightweight the YOLOv9 model; the StarELAN network is a feature extraction network including 1*1 point-by-point convolution, batch normalization, SiLU activation function, feature segmentation, BandBlock structure processing, and feature fusion by multiplication of channel dimensions, and the BandBlock structure is a specific convolutional neural network structure including 1*7 and 7*1 strip convolutions, batch normalization, and SiLU activation function; A small target detection head is added to the lightweight YOLOv9 model, and the LSK attention mechanism is introduced in all detection heads to capture small target forest fires; Constructing an Inner-CIoU loss function, and using the Inner-CIoU loss function as the final loss function of the lightweight small target forest fire detection model; According to the Inner-CIoU loss function, the initial image dataset after data enhancement is used to perform detection training on the lightweight small target forest fire detection model.

2. The training method of a lightweight small target forest fire detection model according to claim 1 is characterized in that: An Inner-CIoU loss function is constructed, and the Inner-CIoU loss function is used to optimize the training of the lightweight small target forest fire detection model, wherein the formula of the constructed Inner-CIoU loss function is: , in, represents the final Inner-CIoU loss, represents CIoU loss, IoU represents the intersection-over-union ratio between the predicted box and the target box, Represents the IoU value of the auxiliary box, where , , , in, , , , , Among them, inter represents the area of ​​the intersection of the auxiliary box corresponding to the real box and the auxiliary box corresponding to the predicted box, and union represents the area of ​​the union of the auxiliary box corresponding to the real box and the auxiliary box corresponding to the predicted box. , represents the width and length of the real box, ( , ) represents the center coordinate of the real frame, ( , ) represents the center coordinate of the anchor box, w and h represent the width and height of the anchor box respectively, and ratio is the corresponding scale factor. , Respectively represent the horizontal coordinates of the auxiliary frame corresponding to the real frame, , Represent the ordinates of the four vertices of the auxiliary frame corresponding to the real frame, Respectively represent the horizontal coordinates of the auxiliary frame corresponding to the prediction frame, , They represent the ordinate of the auxiliary box corresponding to the predicted box.

3. The training method of a lightweight small target forest fire detection model according to claim 1 is characterized in that: The extraction process of using the StarELAN network as the main network for feature extraction in the YOLOv9 model includes: The input initial tensor is subjected to 1*1 point-by-point convolution, followed by batch normalization and SiLU activation function. The output initial tensor is evenly divided into tensor 1 and tensor 2 along the channel dimension. Tensor 2 is input into the BandBlock structure to obtain tensor 3. Tensors 1, 2, and 3 are multiplied along the channel dimension, and then 1*1 point-by-point convolution, batch normalization, and SiLU activation are performed to obtain the tensor output of the StarELAN network.

4. The training method of a lightweight small target forest fire detection model according to claim 3 is characterized in that: The process of inputting tensor 2 into the BandBlock structure to obtain tensor 3 includes: The tensor 2 is input, and a 1*7 strip convolution is first performed, followed by batch normalization and SiLU activation function, and then a 7*1 strip convolution is performed, followed by batch normalization and SiLU activation function, to obtain the output tensor 3.

5. The training method of a lightweight small target forest fire detection model according to claim 1 is characterized in that: The tuning process for downscaling the YOLOv9 model includes: The channel scaling factor and the depth scaling factor of the YOLOv9 model are adjusted to reduce the number of network channels to one quarter of the original number and the number of repetitions to one third of the original number.

6. The training method of a lightweight small target forest fire detection model according to claim 1, characterized in that: The process of adding a small target detection head to the lightweight YOLOv9 model and introducing the LSK attention mechanism in all detection heads includes: Set the number of detection heads in the lightweight YOLOv9 model to N, where the number of additional small-target detection heads is M, and M < N. After the input image dataset is subjected to feature extraction through the StarELAN network, it is respectively input into the detection heads corresponding to the StarELAN network. After feature fusion through the PANet network, N feature layers are obtained in each detection head according to the LSK attention mechanism, where M of the N feature layers represent the feature layers detecting small-target forest fires.

7. The method for training a lightweight small target forest fire detection model according to claim 6, characterized in that: The processing process of the LSK attention mechanism includes: Input the output tensor of the StarELAN network, output it as attention map one through depthwise separable convolution, output attention map one as attention map two through dilated convolution, halve the number of channels of attention map one and attention map two through convolution, then connect attention map one and attention map two in the channel dimension through feature fusion to obtain an attention map, calculate the average attention and maximum attention of the attention map, connect them in the channel dimension to obtain output one, perform convolution on output one, and through the sigmoid activation function, obtain the channel attention weight. Multiply attention map one and attention map two by the channel attention weight respectively, perform weighted summation in the channel dimension to obtain a weighted feature map, restore the original number of channels of the weighted feature map through convolution, and multiply the output tensor of the StarELAN network by the weighted feature map to obtain the output of the LSK attention mechanism.

8. A forest fire detection method for a lightweight small-target forest fire detection model, characterized in that Obtain an initial image of a forest fire, and input the initial image into the lightweight small-target forest fire detection model obtained by the training method of the lightweight small-target forest fire detection model according to any one of claims 1 to 7, and output a detection result.

9. A training system for a lightweight small target forest fire detection model, characterized in that: The system includes: A data acquisition module, configured to acquire an initial image dataset of a forest fire and perform data augmentation on the initial image dataset; A lightweight feature extraction module, configured to construct a StarELAN network, use the StarELAN network as the main network for feature extraction in the YOLOv9 model, and perform a shrinking adjustment on the YOLOv9 model to lightweight the YOLOv9 model; the StarELAN network is a feature extraction network including 1*1 pointwise convolution, batch normalization, SiLU activation function, feature segmentation, BandBlock structure processing, and feature fusion through channel dimension multiplication, and the BandBlock structure is a specific convolutional neural network structure including 1*7 and 7*1 strip convolutions, batch normalization, and SiLU activation function; A small-target detection module, configured to add small-target detection heads to the lightweight YOLOv9 model and introduce the LSK attention mechanism into all detection heads to capture small-target forest fires; A loss calculation module, used for constructing an Inner-CIoU loss function, and using the Inner-CIoU loss function as the final loss function of the lightweight small target forest fire detection model; The result output module is used to perform detection training on the lightweight small target forest fire detection model using the data-enhanced initial image dataset according to the Inner-CIoU loss function.

10. A computer device, characterized in that: The computer device includes a memory, a processor, and a processing program stored in the memory and executable on the processor. When the processing program is executed by the processor, a training method for a lightweight small target forest fire detection model as described in any one of claims 1 to 7 is implemented.