Lightweight fire detection method based on image enhancement
Through a lightweight fire detection method based on image enhancement, using the IEH image enhancement module and the LE-ADown lightweight downsampling module, combined with the RS-EIOU target box regression loss function, the problems of false alarms and missed detections in complex environments are solved, and the accuracy and robustness of fire detection are improved.
Patent Information
- Application Number
- CN202510819681.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-10-17
AI Technical Summary
Existing fire detection methods are prone to false alarms and missed detections in complex environments, especially in low-light or enclosed spaces. Existing datasets are difficult to cover all possible real-world scenarios, making fire identification difficult.
A lightweight fire detection method based on image enhancement is adopted. Through the IEH image enhancement module, the LE-ADown lightweight downsampling module and the RS-EIOU target box regression loss function, the image quality is improved and the model robustness and accuracy are enhanced.
The accuracy and robustness of fire detection have been significantly improved, false positives and missed negatives have been reduced, and the performance of the model in complex environments has been enhanced, especially the detection accuracy in low light and complex backgrounds.
Smart Images

Figure CN120807862A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of fire detection, in particular to a lightweight fire detection method based on image enhancement. BACKGROUND
[0002] Fire is one of the most serious natural disasters worldwide, and the timeliness and accuracy of fire detection technology are crucial for reducing property losses and protecting life safety. Traditional fire detection methods mainly rely on physical means such as smoke, temperature and gas sensors. However, these methods are easily affected by false positives and missed detections in complex environments, especially in closed or semi-closed spaces such as forests, tunnels, industrial parks, etc. The limitations of relying solely on sensors for early warning of fire are obvious. Therefore, fire detection methods based on image processing and computer vision have gradually become a research hotspot.
[0003] Although image and video-based fire detection methods have made significant progress in recent years, they still face many challenges in practical applications. The quality and diversity of the dataset are crucial for fire detection. The limitations of existing fire detection datasets in some aspects often affect the generalization ability of the model and the actual application effect. Specifically, during the collection of fire images, the image may be blurred, the difference between the smoke and the surrounding environment may be too small, or even in some scenarios, the color of the smoke and the background are very similar, making it very difficult to identify the fire. This problem is particularly prominent in low-light environments or complex scenarios (such as industrial parks, forests, etc.), and existing datasets often fail to cover all possible real-world scenarios.
[0004] Fire images are often affected in clarity due to high temperatures, smoke or other physical factors. Especially images taken by remote monitoring videos or low-quality monitoring devices often contain more noise, increasing the difficulty of fire detection model recognition. The diversity and complexity of fire images, such as different colors, shapes, and motion patterns of flames, as well as background environmental interference (such as changes in lighting, weather effects, etc.), make accurate detection of fire very difficult. In some cases, the smoke produced by the fire is very close in color to the background environment, especially in warm environments, the smoke may be almost indistinguishable from the surrounding climate or building background, making it difficult for traditional color or texture-based detection methods to effectively distinguish. And the background factors in the image also interfere with the recognition of fire smoke, such as changes in lighting, weather effects (such as smog, rain, snow, etc.), other industrial smoke, etc., which can easily interfere with the normal recognition of fire, leading to false positives or missed detections.
[0005] Therefore, a lightweight fire detection method based on image enhancement is proposed. SUMMARY
[0006] TECHNICAL PROBLEMS SOLVED
[0007] In view of the deficiencies of the prior art, the present application provides a lightweight fire detection method based on image enhancement, which meets the demand for fire detection in complex environments, solves the limitations of existing fire detection methods in terms of image quality, background interference and model complexity, and improves the real-time performance and accuracy on resource-constrained devices through a lightweight fire detection model, thereby effectively reducing false positives and false negatives and improving the reliability and practicality of the fire warning system.
[0008] Technical scheme
[0009] To achieve the above object, the present application provides the following technical scheme: a lightweight fire detection method based on image enhancement, comprising the following steps:
[0010] Step one: establish a model and add an IEH image enhancement module, a LE-ADown lightweight downsampling module and an RS-EIOU target frame regression loss function;
[0011] Step two: then use a proportional division and preprocessing method to process the fire image dataset in a complex scene, divide it into a training set, a validation set and a test set in a 7:2:1 ratio, and use the IEH image enhancement module to enhance the image of the full data set;
[0012] Step three: integrate the LE-ADown lightweight downsampling module as a downsampling layer, extract features through a mixed mode of deep convolution and standard convolution, fuse multi-layer information using residual connection, and enhance the robustness of the model;
[0013] Step four: use the training set to iteratively train the model, with an iteration number of 200 times, and update the model weight;
[0014] Step five: test the model performance, including evaluating the validation set indicators of the optimal model and the test set detection picture performance.
[0015] Preferably, the IEH image enhancement module in step one includes non-local mean denoising, histogram equalization, brightness adjustment and contrast enhancement, and hue adjustment and saturation enhancement;
[0016] Non-local mean denoising:
[0017] In a fire image, smoke and other physical factors often cause image blur and noise, and the use of non-local mean denoising method (NL-Means) can remove noise by using global information in the image while preserving the detailed structure of the image. First, calculate the similarity weight, for each pixel x i , calculate the weight w(i,j) by calculating the similarity with other pixels:
[0018]
[0019] where I(x i ) and I(x j ) represent the image blocks around pixel x i and x j , h is a smoothing parameter, which is adjusted according to the noise level of the image, determines the influence range of the similarity, and then the weighted average of the surrounding pixels is obtained using the similarity weight to obtain the denoised pixel value
[0020]
[0021] where w(i,j) is the similarity weight between pixel x i and x j , and Ω represents the neighborhood region of pixel x i ; this method can effectively remove the noise caused by smoke, haze and other factors by calculating the similarity between pixels and weighted average, while maintaining the details of the image, especially the flame and smoke edges in the fire image.
[0022] Preferably, the histogram equalization is:
[0023] Let the gray value range of the original image I(x,y) be [0,L-1], where L=256 is the number of gray levels, then the steps of histogram equalization are:
[0024] 1) Calculate the cumulative distribution function CDF:
[0025]
[0026] where p(r i ) is the probability distribution of the gray value r i , and r k is any value of the gray level in the image;
[0027] 2) Normalization:
[0028]
[0029] where CDF min is the minimum value of the cumulative distribution function, N is the total number of pixels in the image, and T(r k ) is the mapped gray value.
[0030] 3) Update the gray value of the image I(x,y) using the mapping function T;
[0031] Brightness adjustment and contrast enhancement:
[0032] After histogram equalization, the brightness and contrast of the image may need further adjustment, especially in poor lighting or low contrast situations. Brightness adjustment can be achieved through linear transformation, and contrast enhancement can be achieved by stretching the gray scale range. The following methods can be used:
[0033] 1) Brightness adjustment:
[0034] I'(x, y) = α·I(x, y) + β
[0035] where α ∈ [1.0, 1.5] is the brightness adjustment coefficient, which determines the brightness change of the image; β is the bias, which controls the translation of the image brightness;
[0036] 2) Contrast enhancement:
[0037]
[0038] where μ and σ are the mean and standard deviation of the image I'(x, y), respectively, and C ∈ [1.5, 2.5] is the contrast enhancement factor, which controls the contrast of the image;
[0039] Hue adjustment and saturation enhancement:
[0040] Flames and smoke in fire images usually have specific hue and saturation. Adjusting hue and saturation can help highlight the color features of the fire area. Hue adjustment changes the color of the image by modifying the hue, and saturation enhancement increases the purity of the color, making the color of the fire area more vivid;
[0041] 1) Hue adjustment:
[0042] H'(x, y) = (H(x, y) + ΔH) mod 360
[0043] where H(x, y) is the hue of pixel (x, y), and ΔH ∈ [10, 30] is the adjustment amount of hue, which can enhance the color contrast of flames and smoke;
[0044] 2) Saturation enhancement:
[0045] S'(x, y) = S(x, y)·λ
[0046] where S(x, y) is the saturation of pixel (x, y), and λ ∈ [1.5, 2.0] is the saturation enhancement factor. By first denoising, then improving image quality through histogram equalization, brightness adjustment and contrast enhancement, and finally increasing the visual features of the fire area through hue and saturation adjustment, the visibility and recognition of the fire area can be effectively improved, and false positives and false negatives caused by noise, low light and complex background interference can be reduced.
[0047] Preferably, the LE-ADown lightweight downsampling module in step one first inputs feature compression:
[0048] An input feature map with a size of HxWxC is input, where H and W are the height and width of the feature map, respectively, and C is the number of channels;
[0049] The input image is compressed in the number of channels by 1x1 convolution, reducing the dimension of the feature map and effectively filtering noise and redundant information in the image;
[0050] The compressed image is then passed through three branches, two of which are efficient feature extraction branches. The image features are extracted through the feature extraction branches. First, 3x3DConv is used to extract local features through channel-by-channel convolution. After deep convolution, a standard 3x3Conv is used for feature fusion to further capture spatial features on a global scale.
[0051] The outputs of the two branches are then fused to obtain a higher-dimensional and more rich feature map;
[0052] The compressed feature map and the outputs of the two feature extraction branches are connected in residual to fuse multi-layer information, while preserving more original information and ensuring that the network can combine low-level and high-level features;
[0053] Batch normalization is performed on the merged feature map, and then the activation function PRELU is used to make the network adapt to different data characteristics and recognize complex fire features;
[0054] 1x1 convolution is then used to compress and adjust the number of channels of the input image, reducing the amount of calculation while preserving important feature information;
[0055] The output image is processed through two branches. First, global average pooling is performed on each channel to aggregate the spatial information of each channel into a scalar value, obtaining the global features of each channel. Then, 1x1 convolution is used to compress the channels again, and a fully connected layer is used to extract high-dimensional features.
[0056] The second branch first uses deep convolution to extract local features and reduce computational complexity. The outputs of the two branches are then fused through residual connection. The fused result is batch normalized to standardize the features, and finally output.
[0057] Preferably, the derivation process of the RS-EIOU target box regression loss function in step one is as follows:
[0058] First, the image region is segmented. The size of image I is WxH, which is divided into NxM small regions, and the size of each sub-region is The division is as follows:
[0059] I→{R1,R2,...,R k}, where and
[0060] where k is the total number of regions, R i represents the i-th region, I is the original image;
[0061] For each region R i , the target frame A i , B i , C i in the region, find the minimum bounding box D i as the reference frame, accurately represent the target region, help the model better locate the target:
[0062] D i = min_bbox(A i ∪B i ∪C i )
[0063] For the target frame A i and the real frame B i in the region, first calculate the local IoU, which is the most basic loss function for measuring the degree of overlap between the predicted frame and the real frame, which is defined as:
[0064]
[0065] where IoU i is the intersection over union between the target frame and the real frame;
[0066] Introduce multi-scale auxiliary frame, generate auxiliary bounding box D i,s of different scales by using scaling factor s, optimize the loss in a multi-scale way; for each region R i , calculate the minimum bounding box under multiple scales:
[0067] D i,s = s·D i
[0068] For each region R i , combine IoU and penalty term (penalty for uncovered region) to optimize each region, help improve the matching degree of target frame and real frame, the penalty term is used to calculate the part of the bounding box D i,s that is not covered by the target frame, encourage the model to tighten the frame and improve accuracy; under each scale, calculate the loss after removing irrelevant regions, and combine the information of multiple scales to get the final optimization target;
[0069]
[0070] wherein, D i,s \(A i ∪B i ∪C i ) represents the area of the minimum bounding box D i,s remaining after removing the target frame area, the proportion of the area in the minimum bounding box is calculated, and the influence of irrelevant areas on the loss is avoided by removing the non-overlapping area, so that the loss calculation is more focused on the target area, and the detection accuracy is further improved.
[0071] For each region R i of the image, the region loss is calculated.
[0072]
[0073] Finally, the total loss function L is obtained by summarizing the loss of all regions:
[0074]
[0075] wherein k is the total number of regions, is the loss of the i-th region.
[0076] Preferably, the training set in step two is used for model training to update the model weight; the validation set is used for model evaluation after each round of training; and the test set is used for evaluating the final detection performance of the model after training.
[0077] Preferably, the data set format is converted to txt in step two to adapt to the input requirements of the model.
[0078] Preferably, the evaluation index in step five includes accuracy, recall rate, average detection accuracy when IOU is 0.5, computational complexity, and parameter quantity; the accuracy refers to the ratio of the number of correctly predicted positive samples to the total number of positive samples predicted by the model; and the recall rate refers to the ratio of the number of correctly predicted positive samples to the total number of actual positive samples.
[0079] Compared with the prior art, the present application provides a lightweight fire detection method based on image enhancement, which has the following beneficial effects:
[0080] 1、The lightweight fire detection method based on image enhancement improves the performance of the fire detection model under conditions such as poor image quality and complex environment by using the IEH image enhancement module, while retaining key features, improving the discrimination between fire and background, making the fire area more prominent, significantly improving the image quality, and helping to improve the accuracy and robustness of the fire detection model; by using the LE-ADown lightweight downsampling module, the sensitivity and accuracy of the model to fire features are improved while ensuring efficient feature extraction, and the performance of the model under complex environment and low light in fire images is effectively improved, enhancing the robustness and generalization ability of the model.
[0081] 2、The lightweight fire detection method based on image enhancement uses the RS-EIOU target box regression loss function to introduce region segmentation and local optimization technology, combined with a multi-scale auxiliary frame mechanism and a scaling factor, to more accurately consider the local overlap between target boxes during calculation by dividing the image into multiple small regions and optimizing them independently, which not only effectively reduces the computational load, but also significantly improves the accuracy and robustness of the model in handling complex shapes, low overlap targets and uneven target distribution, while the local adjustment mechanism optimizes the target box matching accuracy and speeds up the convergence of the model, especially in scenes with dense targets or complex backgrounds. BRIEF DESCRIPTION OF DRAWINGS
[0082] Fig. 1 The LE-ResNet network diagram of the present application;
[0083] Fig. 2 The lightweight fire detection diagram based on image enhancement of the present application. DETAILED DESCRIPTION
[0084] The technical solutions in the embodiments of the present application will be described in detail below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0085] Please refer to Figs. 1-2 ;
[0086] Embodiment:
[0087] A lightweight fire detection method based on image enhancement, comprising the following steps:
[0088] Step 1: Establish a model and add an IEH image enhancement module, a LE-ADown lightweight downsampling module and a RS-EIOU target box regression loss function;
[0089] Step two: Then the ratio division and pretreatment method is used to process the fire image dataset in complex scene, which is divided into training set, validation set and test set according to the ratio of 7:2:1, and the IEH image enhancement module is used to enhance the image of the full data set;
[0090] Step three: The LE-ADown lightweight down-sampling module is integrated as a down-sampling layer, which extracts features through a mixed mode of deep convolution and standard convolution, fuses multi-layer information through residual connection, and enhances the robustness of the model;
[0091] Step four: The training set is used to iteratively train the model, and the iteration number is 200 times to update the model weight;
[0092] Step five: Test the model performance, including evaluating the validation set indicators of the optimal model and the test set detection picture performance.
[0093] Preferably, the IEH image enhancement module in step one includes non-local mean denoising, histogram equalization, brightness adjustment and contrast enhancement, and hue adjustment and saturation enhancement;
[0094] Non-local mean denoising:
[0095] In the fire image, smoke and other physical factors often cause image blur and noise, and the non-local mean denoising method (NL-Means) can remove noise by using global information in the image while preserving the detailed structure of the image. First, calculate the similarity weight, for each pixel x i , the weight w(i,j) is obtained by calculating the similarity with other pixels:
[0096]
[0097] Where I(x i ) and I(x j ) represent the image blocks around pixels x i and x j , h is a smoothing parameter adjusted according to the noise level of the image, which determines the influence range of the similarity, and then the weighted average of the surrounding pixels is obtained using the similarity weight
[0098]
[0099] Where w(i,j) is the similarity weight between pixels x i and x j , and Ω represents the pixel x ineighborhood region; this method can effectively remove the noise caused by smoke, haze and other factors by weighted average of the similarity between pixels, while maintaining the details of the image, especially the flame and smoke edge in the fire image.
[0100] Preferably, histogram equalization:
[0101] Let the original image I(x, y) gray value range is [0, L-1], wherein L = 256 is the number of gray levels, then the steps of histogram equalization are:
[0102] 1), calculate the cumulative distribution function CDF:
[0103]
[0104] Where, p(r i ) is the probability distribution of gray value r i , r k is any value of the gray level in the image;
[0105] 2), normalization:
[0106]
[0107] Where, CDF min is the minimum value of the cumulative distribution function, N is the total number of pixels in the image, T(r k ) is the mapped gray value;
[0108] 3), using the mapping function T to update the gray value of the image I(x, y);
[0109] Brightness adjustment and contrast enhancement:
[0110] After histogram equalization, the brightness and contrast of the image may need to be further adjusted, especially in the case of poor lighting or low contrast, brightness adjustment can be achieved by linear transformation, and contrast enhancement can be achieved by stretching the gray scale; as follows:
[0111] 1), brightness adjustment:
[0112] I'(x, y) = α·I(x, y) + β
[0113] Where α ∈ [1.0, 1.5] is the brightness adjustment coefficient, which determines the brightness change of the image; β is the bias, which controls the translation of the image brightness;
[0114] 2), contrast enhancement:
[0115]
[0116] where μ and σ are the mean and standard deviation of the image I'(x, y) respectively, C ∈ [1.5, 2.5] is a contrast enhancement factor that controls the contrast of the image;
[0117] Hue adjustment and saturation enhancement:
[0118] Flames and smokes in fire images usually have specific hue and saturation, adjusting hue and saturation can help highlight the color features of the fire area, hue adjustment is to change the color of the image by modifying the hue, and saturation enhancement can increase the purity of the color, making the color of the fire area more vivid;
[0119] 1) Hue adjustment:
[0120] H'(x, y) = (H(x, y) + ΔH) mod 360
[0121] where H(x, y) is the hue of pixel (x, y), and ΔH ∈ [10, 30] is the adjustment amount of hue, which can enhance the color contrast of flames and smokes;
[0122] 2) Saturation enhancement:
[0123] S'(x, y) = S(x, y) · λ
[0124] where S(x, y) is the saturation of pixel (x, y), and λ ∈ [1.5, 2.0] is the saturation enhancement factor; By first denoising, then through histogram equalization, brightness adjustment and contrast enhancement, etc. to improve the image quality, and finally through hue and saturation adjustment to increase the visual features of the fire area, it can effectively improve the visibility and recognition of the fire area, and reduce false positives and false negatives caused by noise, low light and complex background interference.
[0125] Preferably, the LE-ADown lightweight downsampling module in step one first inputs feature compression:
[0126] An input feature map with size H × W × C is input, where H and W are the height and width of the feature map respectively, and C is the number of channels;
[0127] The input image is compressed in channel number by 1x1 convolution, which reduces the dimension of the feature map and can effectively filter noise and redundant information in the image;
[0128] Then the compressed image is respectively passed through three branches, two of which are efficient feature extraction branches, which extract image features through the feature extraction branches, first pass through 3x3DConv to extract local features through channel-by-channel convolution, and then use standard 3x3Conv for feature fusion to further capture spatial features on a global scale;
[0129] The outputs of the two branches are then fused to obtain a higher-dimensional and richer feature map;
[0130] The compressed feature map and the output of the two feature extraction branches are connected with residuals to fuse multiple layers of information, which ensures that the network can combine low-level and high-level features while retaining more original information.
[0131] The merged feature maps are batch normalized and then activated using the PRELU function to enable the network to adapt to different data characteristics and identify complex fire characteristics.
[0132] Then use 1x1 convolution to compress and adjust the number of channels of the input image, reducing the amount of calculation while retaining important feature information;
[0133] The output image is processed through two branches. First, global average pooling is performed on each channel to aggregate the spatial information of each channel into a scalar value, thereby obtaining the global features of each channel. Then, the channel is compressed again through 1x1 convolution, and high-dimensional features are extracted using a fully connected layer.
[0134] The second branch first uses deep convolution to extract local features to reduce computational complexity, then fuses the outputs of the two branches through residual connections, performs batch normalization on the fused results to standardize the features, and finally outputs them.
[0135] Preferably, the derivation process of the RS-EIOU target box regression loss function in step 1 is:
[0136] First, image region segmentation is performed. The size of image I is W×H, which is divided into N×M small regions. The size of each sub-region is The division is as follows:
[0137] I→{R1,R2,...,R k}, where R i ∈I, and
[0138] Where k is the total number of regions, R i represents the i-th region, I is the original image;
[0139] For each region R i , target box A in the area i 、B i 、C i , find the minimum bounding box D i As a reference frame, it accurately represents the target area and helps the model better locate the target:
[0140] Di = min_bbox(A i ∪B i ∪C i )
[0141] For the target frame A i and the real frame B i in the region, first, the local IoU calculation is carried out, which is the most basic loss function for measuring the degree of overlap between the predicted frame and the real frame, which is defined as:
[0142]
[0143] Where IoU i is the intersection over union between the target frame and the real frame;
[0144] A multi-scale auxiliary frame is introduced, and different scales of auxiliary enclosing frames D i,s are generated by using a scaling factor s, and the loss is optimized in a multi-scale manner; for each region R i , the minimum enclosing frame under multiple scales is calculated:
[0145] D i,s = s·D i
[0146] For each region R i , the IoU and the penalty term (penalty for the uncovered region) are combined to optimize the calculation of each region, which helps to improve the matching degree of the target frame and the real frame. The penalty term is used to calculate the part of the enclosing frame D i,s that is not covered by the target frame, which encourages the model to tighten the frame and improve the accuracy; under each scale, the loss after removing the irrelevant region is calculated, and the information of multiple scales is combined to obtain the final optimization target;
[0147]
[0148] Where D i,s \(A i ∪B i ∪C i ) represents the remaining region in the minimum enclosing frame D i,s after removing the target frame region, the proportion of this region to the minimum enclosing frame is calculated, and by removing the non-overlapping region, the influence of irrelevant regions on the loss is avoided, so that the loss calculation is more focused on the target region, further improving the detection accuracy;
[0149] For each region R i of the image, the region loss
[0150]
[0151] Finally, the total loss function L is obtained by summing the loss of all regions:
[0152]
[0153] where k is the total number of regions, is the loss of the i-th region.
[0154] Preferably, in step two, the training set is used for model training to update the model weights, the validation set is used for model evaluation after each round of training, and the test set is used to evaluate the final detection performance of the model after training.
[0155] Preferably, in step two, the training set is used for model training to update the model weights, the validation set is used for model evaluation after each round of training, and the test set is used to evaluate the final detection performance of the model after training.
[0156] Preferably, in step five, the evaluation indicators include accuracy, recall, average detection precision when IOU is 0.5, computational complexity, and parameter quantity. The accuracy refers to the ratio of the number of correctly predicted positive samples to the total number of positive samples predicted by the model. The recall refers to the ratio of the number of correctly predicted positive samples to the total number of actual positive samples.
[0157] The beneficial effects of the present application are: the lightweight fire detection method based on image enhancement improves the performance of the fire detection model under conditions such as poor image quality and complex environment by using the IEH image enhancement module, while retaining key features, improving the discrimination between fire and background, making the fire area more prominent, significantly improving the image quality, and helping to improve the accuracy and robustness of the fire detection model; by using the LE-ADown lightweight downsampling module, the sensitivity and accuracy of the model to fire features such as flames and smoke are improved while ensuring efficient feature extraction, and the performance of the model in complex environments and low light in fire images is effectively improved, enhancing the robustness and generalization ability of the model; by using the RS-EIOU target frame regression loss function, the local overlap between target frames is more accurately considered in the calculation process by introducing region segmentation and local optimization techniques, combining a multi-scale auxiliary frame mechanism and a scaling factor, by dividing the image into multiple small regions and optimizing them independently, the computational complexity is effectively reduced, and the precision and robustness of the model in handling complex shapes, low overlap targets, and uneven target distribution are significantly improved. At the same time, the local adjustment mechanism optimizes the target frame matching accuracy and speeds up the convergence of the model, especially in target dense or complex background scenes.
[0158] Although embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the appended claims and their equivalents.
Claims
1. A lightweight fire detection method based on image enhancement, characterized in that: The following steps are involved: Step 1: Build the model and add the IEH image enhancement module, the LE-ADown lightweight downsampling module, and the RS-EIOU target box regression loss function; Step 2: Then, the fire image dataset in complex scenes is processed using the proportional partitioning and preprocessing method. It is divided into training set, validation set and test set in a ratio of 7:2:1, and the IEH image enhancement module is used to perform image enhancement on the entire dataset. Step 3: Integrate the LE-ADown lightweight downsampling module as the downsampling layer, extract features through a hybrid mode of depthwise convolution and standard convolution, and use residual connections to fuse multi-layer information to enhance model robustness; Step 4: Use the training set to iteratively train the model for 200 times and update the model weights; Step 5: Test model performance, including evaluating the validation set metrics and test set image detection performance of the optimal model.
2. A lightweight fire detection method based on image enhancement according to claim 1, characterized in that: The IEH image enhancement module in step 1 includes non-local mean denoising, histogram equalization, brightness adjustment and contrast enhancement, and hue adjustment and saturation enhancement; Non-local means denoising: In fire images, smoke and other physical factors often cause image blur and noise. The non-local mean denoising method (NL-Means) can remove noise by utilizing the global information in the image while preserving the image's detailed structure. First, calculate the similarity weight. For each pixel x i , and the weight w(i,j) is obtained by calculating the similarity with other pixels: Where I(x i ) and I(x j ) represents pixel x i and x j The surrounding image blocks, h is a smoothing parameter, which is adjusted according to the noise level of the image and determines the influence range of the similarity. Secondly, the similarity weight is used to perform weighted averaging on the surrounding pixels to obtain the denoised pixel value. where w(i,j) is the pixel x i with x j The similarity weight between pixels x i This method calculates the similarity between pixels to perform weighted averaging, which can effectively remove noise caused by factors such as smoke and haze, while maintaining image details, especially the edges of flames and smoke in fire images.
3. A lightweight fire detection method based on image enhancement according to claim 2, characterized in that: The histogram equalization: Assume that the grayscale value range of the original image I(x,y) is [0, L-1], where L = 256 is the number of grayscale levels. The steps of histogram equalization are: 1) Calculate the cumulative distribution function CDF: Among them, p(r i ) is the gray value r i The probability distribution of r k is an arbitrary value of the gray level in the image; 2) Normalization: Among them, CDF min is the minimum value of the cumulative distribution function, N is the total number of pixels in the image, T(r k ) is the grayscale value after mapping; 3) Use the mapping function T to update the grayscale value of the image I(x,y); Brightness adjustment and contrast enhancement: After histogram equalization, the brightness and contrast of the image may need further adjustment, especially in poor lighting or low contrast conditions. Brightness adjustment can be achieved through linear transformation, and contrast enhancement can be achieved by stretching the grayscale range; as follows: 1) Brightness adjustment: I'(x,y)=α·I(x,y)+β Where α∈[1.0,1.5] is the brightness adjustment coefficient, which determines the brightness change of the image; β is the bias, which controls the translation of the image brightness; 2) Contrast enhancement: Where μ and σ are the mean and standard deviation of the image I'(x,y), respectively, and C∈[1.5,2.5] is the contrast enhancement factor that controls the contrast of the image; Hue adjustment and saturation enhancement: The flames and smoke in fire images usually have a specific hue and saturation. Adjusting the hue and saturation can help highlight the color characteristics of the fire area. Hue adjustment changes the color of the image by modifying the hue, while saturation enhancement can increase the color purity and make the color of the fire area more vivid. 1) Tone adjustment: H'(x,y)=(H(x,y)+ΔH)mod360 Where H(x,y) is the hue of pixel (x,y), and ΔH∈[10,30] is the amount of adjustment of the hue, which can enhance the color contrast of flame and smoke; 2) Saturation enhancement: S'(x,y)=S(x,y)·λ Where S(x,y) is the saturation of pixel (x,y) and λ∈[1.5,2.0] is the saturation enhancement factor.
4. A lightweight fire detection method based on image enhancement according to claim 1, characterized in that: In step 1, the LE-ADown lightweight downsampling module first inputs feature compression: enter An input feature map of size H×W×C, where H and W are the height and width of the feature map, respectively, and C is the number of channels; The input image is compressed by 1x1 convolution, which reduces the dimension of the feature map and effectively filters out noise and redundant information in the image. The compressed image is then passed through three branches, two of which are efficient feature extraction branches. The feature extraction branches extract image features. First, they pass through 3x3DConv to extract local features through channel-by-channel convolution. After the depth convolution, the standard 3x3Conv is used for feature fusion to further capture spatial features at the global scale. The outputs of the two branches are then fused to obtain a higher-dimensional and richer feature map; The compressed feature map and the output of the two feature extraction branches are connected with residuals to fuse multiple layers of information, which ensures that the network can combine low-level and high-level features while retaining more original information. The merged feature maps are batch normalized and then activated using the PRELU function to enable the network to adapt to different data characteristics and identify complex fire characteristics. Then use 1x1 convolution to compress and adjust the number of channels of the input image, reducing the amount of calculation while retaining important feature information; The output image is processed through two branches. First, global average pooling is performed on each channel to aggregate the spatial information of each channel into a scalar value, thereby obtaining the global features of each channel. Then, the channel is compressed again through 1x1 convolution, and high-dimensional features are extracted using a fully connected layer. The second branch first uses deep convolution to extract local features to reduce computational complexity, then fuses the outputs of the two branches through residual connections, performs batch normalization on the fused results to standardize the features, and finally outputs them.
5. The lightweight fire detection method based on image enhancement according to claim 1, characterized in that: The derivation process of the RS-EIOU target box regression loss function in step 1 is: First, image region segmentation is performed. The size of image I is W×H, which is divided into N×M small regions. The size of each sub-region is The division is as follows: I→{R1,R2,...,R k }, where R i ∈I, and Where k is the total number of regions, R i represents the i-th region, I is the original image; For each region R i , target box A in the area i 、B i 、C i , find the minimum bounding box D i As a reference frame, it accurately represents the target area and helps the model better locate the target: D i =min_bbox(A i ∪B i ∪C i ) For the target box A in the area i and the real frame B i First, the local IoU calculation is performed, which is the most basic loss function used to measure the degree of overlap between the predicted box and the real box, and is defined as: Among them, IoU i It is the intersection-over-union ratio between the target box and the ground-truth box; Introducing multi-scale auxiliary boxes, by using the scaling factor s to generate auxiliary bounding boxes D of different scales i,s , optimize the loss in a multi-scale manner; for each region R i , calculate the minimum bounding box at multiple scales: D i,s =s·D i For each region R i , combined with IoU and penalty term (penalty for uncovered areas), each area is optimized and calculated to help improve the matching degree between the target box and the real box. The penalty term is used to calculate the bounding box D i,s The parts of the image not covered by the target box are used to encourage the model to tighten the box and improve accuracy. At each scale, the loss after removing irrelevant areas is calculated, and the final optimization target is obtained by combining information from multiple scales. Among them, D i,s \(A i ∪B i ∪C i ) indicates that after removing the target box area, the minimum bounding box D i,s The remaining area in the minimum bounding box is calculated, and the proportion of the area in the minimum bounding box is calculated. By removing the non-overlapping areas, the influence of irrelevant areas on the loss is avoided, so that the loss calculation is more focused on the target area, further improving the detection accuracy; For each region R of the image i Calculating regional losses Finally, the losses of all regions are summed up to get the total loss function L: where k is the total number of regions, is the loss of the ith region.
6. A lightweight fire detection method based on image enhancement according to claim 1, characterized in that: The training set in step 2 is used for model training to update the model weights; the validation set is used for model evaluation after each round of training; and the test set is used to evaluate the final detection performance of the model after training.
7. A lightweight fire detection method based on image enhancement according to claim 1, characterized in that: The second step finally converts the dataset format into txt to adapt to the model input requirements.
8. The lightweight fire detection method based on image enhancement according to claim 1, characterized in that: The evaluation indicators in step 5 include accuracy, recall, average detection precision when IOU is 0.5, computational complexity, and parameter quantity; the accuracy refers to the ratio of the number of correctly predicted positive samples to the total number of positive samples predicted by the model; the recall refers to the ratio of the number of correctly predicted positive samples to the total number of actual positive samples.