Forest Fire Early Warning Method and System Based on Retinex Algorithm
By applying Retinex algorithm and low-light feature enhancement technology in forest fire image recognition, the problems of low forest fire recognition accuracy and scarce samples in low-light environments are solved, and higher recognition accuracy and generalization capabilities are achieved.
Patent Information
- Application Number
- CN202510307590.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-03-17
AI Technical Summary
In low-light environments, the accuracy of the forest fire image recognition model decreases, and due to the small number of forest fire data samples, the generalization ability of the model is limited, making it difficult to accurately detect fire conditions under severe light changes, fire sources are blocked or smoke is unevenly spread.
The forest fire early warning method based on the Retinex algorithm is adopted, and the low-light image is decomposed into reflection maps and light maps through the photosensitive decomposition module, and the low-light detection and enhancement module is constructed to capture and enhance the low-light features of the image, generate low-light reconstruction images, and identify them through the small sample classification module.
The forest fire image recognition accuracy in low-light, uneven light and scarce samples is improved, and the generalization ability of the model is enhanced, and forest fires can be detected and warned more accurately.
Smart Images

Figure CN119832681B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of forest fire warning, and particularly relates to a forest fire warning method and system based on the Retinex algorithm. Background Art
[0002] With the development of artificial intelligence and computer vision technologies, image recognition technology has played an important role in the monitoring and warning of forest fires. Forest fire image recognition technology is mainly used for early fire monitoring before a disaster and fire area assessment after a disaster. Through intelligent analysis of satellite remote sensing images, UAV aerial images, and surveillance camera videos, image recognition technology can accurately identify fire features such as flames and smoke, timely detect potential fire hazards, and reduce the workload of personnel patrols. In addition, this technology can also evaluate the fire spread trend, combine images with multi-modal data such as meteorological data and geographical information to help firefighters formulate more efficient fire extinguishing plans, and optimize the emergency resource allocation. Forest fire image recognition technology improves the real-time and accuracy of fire monitoring, and provides important technical support for forest ecological environment protection.
[0003] However, in low-light environments, the visual features of flames and smoke are easily interfered by weak light or noise, resulting in a decline in the accuracy of the forest fire image recognition model. In addition, traditional deep learning methods usually rely on large-scale labeled data for training, but forest fire data is often difficult to obtain, and the problem of small sample size limits the generalization ability of the model. General fire detection models are difficult to accurately detect fire hazards in the case of drastic changes in illumination, blocked fire sources, or uneven smoke diffusion.
[0004] Therefore, the present invention proposes a low-light and few-sample forest fire warning method based on the Retinex algorithm to solve the problem of poor accuracy in forest fire image recognition in low-light and few-sample scenarios. Summary of the Invention
[0005] In order to solve the above problems, the present invention provides a forest fire warning method and system based on the Retinex algorithm.
[0006] To achieve the above object, the present invention is realized through the following technical solutions:
[0007] The present invention provides a forest fire warning method based on the Retinex algorithm, including the following steps:
[0008] S1. Obtain low-light forest fire images ;
[0009] S2. Input the low-light forest fire images into the photosensitive decomposition module, and decompose the images into reflection maps based on the Retinex theory And the illumination map ;
[0010] S3. Construct a low-light detection module and input the illumination map into the low-light detection module. This module captures the low-light features of the low-light image through a multi-scale convolutional layer, accurately locates the low-light features of the low-light forest fire image, and generates a low-light attention feature map through the Sigmoid activation function, concatenation operation, and convolutional layer ;
[0011] S4. Construct a low-light enhancement module and input the low-light attention feature map and the reflection map into the low-light enhancement module, and finally generate a low-light enhanced illumination map ;
[0012] S5. Construct a low-light image reconstruction module, multiply the low-light enhanced illumination map element-wise with the reflection map , and superimpose the low-light forest fire image through residual connection, and finally generate a low-light reconstructed image ;
[0013] S6. Construct a low-light image few-shot classification module and input the low-light reconstructed image into the low-light image few-shot classification module. This module first divides the reconstructed image into equal-sized feature blocks, extracts features from the feature blocks to capture the local information of the reconstructed image, and finally makes an image decision and recognition by calculating the distance between the image and the images in the database, obtains the recognition result, and judges whether to give an early warning according to the recognition result
[0014] Furthermore, step S2 specifically includes:
[0015] The photosensitive decomposition module includes two convolutional layers, a photosensitive decomposition attention module, a reflection convolutional layer, and an illumination convolutional layer; the photosensitive decomposition attention module includes a global pooling layer and a fully connected layer
[0016] S21. Input the low-light forest fire image into the photosensitive decomposition module. Based on the image Retinex theory, obtain the intermediate features of the low-light image after two convolutional layers , and perform global average pooling on the intermediate features of the low-light image through the global pooling layer to generate a feature channel representation ; the feature channel representation is processed through the fully connected layer to obtain the channel weight ; multiply the channel weight with the intermediate features Multiply channel by channel to obtain the enhanced low-light features , which is expressed by the formula as follows:
[0017] ,
[0018] ,
[0019] ,
[0020] wherein, and respectively represent the height and width of the low-light forest fire image, and respectively represent the first weight and the second weight, represents the ReLU activation function, represents the Sigmoid activation function, represents the channel-by-channel multiplication operation;
[0021] S22. Input the enhanced low-light features into the reflection convolutional layer and the illumination convolutional layer respectively to obtain the reflection map and the illumination map , which is expressed by the formula as follows:
[0022] ,
[0023] ,
[0024] wherein, represents the operation of the reflection convolutional layer, represents the operation of the illumination convolutional layer.
[0025] Furthermore, step S3 specifically includes:
[0026] The weak light detection module includes a multi-scale convolutional layer, a Sigmoid activation function, a feature fusion layer, and a convolutional layer;
[0027] S31. The illumination map is subjected to feature extraction through the multi-scale convolutional layer to obtain the first multi-scale feature and the second multi-scale feature , which is expressed by the formula as follows:
[0028] ,
[0029] ,
[0030] wherein, represents the convolutional operation with a convolutional kernel size of Represents a convolution operation with a convolution kernel size of ;
[0031] S32. The first multi-scale feature and the second multi-scale feature generate the first multi-scale attention map and the second multi-scale attention map through the Sigmoid activation function. The first multi-scale attention map and the second multi-scale attention map are subjected to an upsampling operation and concatenated and fused with the illumination map to generate a concatenated feature map , and the formula is as follows:
[0032] ,
[0033] ,
[0034] ,
[0035] where, represents the Sigmoid activation function, represents the concatenation operation, represents the upsampling operation;
[0036] S33. Use a convolutional layer to adjust the number of channels of the concatenated feature map to generate a low-light attention feature map , and the formula is as follows:
[0037] ,
[0038] where, represents a convolution operation with a convolution kernel size of ;
[0039] Furthermore, step S4 specifically includes:
[0040] The low-light enhancement module includes an encoder, a light-sensing feature capturer, a decoder, and a light-sensing mapper; the encoder gradually captures image features through multiple layers of convolution, and each layer in the encoder includes a convolutional layer with a convolution kernel size of , a ReLU activation function, and a convolutional layer with a convolution kernel size of ; the light-sensing feature capturer includes a convolutional layer with a convolution kernel size of , a ReLU activation function, and a convolutional layer with a convolution kernel size of ; the decoder has 5 layers, and each layer includes a convolutional layer with a convolution kernel size of The deconvolution layer, ReLU activation function, and convolution kernel size are The deconvolution layer; the light perception mapper includes two convolution kernel sizes of The convolutional layer;
[0041] S41. Concatenate and fuse the low-light attention feature map and the reflection map to generate the input feature of the low-light enhancement module , input the feature into the encoder for processing to obtain the feature map generated by the encoder. The formula is as follows:
[0042] ,
[0043] ,
[0044] where represents the pixel superposition operation, represents the concatenation operation, represents the convolution operation with a convolution kernel size of , represents the convolution operation with a convolution kernel size of , represents the ReLU activation function, represents the feature map generated by the th layer of the encoder, ; Each layer extracts features through convolution operations and ReLU activation functions, and gradually increases the number of channels of the features. The residual operation is used to add the input features to the convolved features through skip connections to finally obtain the encoder features ;
[0045] S42. Input the obtained encoder features into the light perception feature catcher to capture the illumination information of the image using high-dimensional feature representation and generate the light perception feature . The formula is as follows:
[0046] ,
[0047] where represents the convolution operation with a convolution kernel size of ;
[0048] S43. Input the light perception feature into the decoder for processing, and gradually restore the resolution of the features through deconvolution operations to obtain the final features of the decoder. The calculation formula for the first layer of the decoder is:
[0049] ,
[0050] Among them, represents a deconvolution operation with a convolution kernel size of ; represents a deconvolution operation with a convolution kernel size of ; The calculation formula for the fifth layer of the decoder is:
[0051] ,
[0052] The operations of the second to fourth layers are the same;
[0053] S44. Input the final features of the decoder into the light perception mapper to obtain a low-light enhanced illumination map .
[0054] Furthermore, step S5 specifically includes:
[0055] S51. Multiply the low-light enhanced illumination map element-wise with the reflection map to generate a low-light reconstructed image , and superimpose the low-light reconstructed image with the low-light forest fire image to generate a residual enhanced image . The formula is as follows:
[0056] ,
[0057] ,
[0058] Among them, represents the element-wise multiplication operation, represents the pixel superposition operation;
[0059] S52. The residual enhanced image passes through a convolutional layer with a convolution kernel size of , the ReLu activation function, and the photosensitive channel attention module respectively to generate a low-light reconstructed image . The formula is as follows:
[0060] ,
[0061] ,
[0062] ,
[0063] ,
[0064] Among them, Denote the convolutional residual enhanced image, Denote the feature channel representation of the convolutional residual enhanced image, Denote the channel weights of the convolutional residual enhanced image, and respectively denote the height and width of the residual enhanced image , and respectively denote the third weight and the fourth weight.
[0065] Furthermore, step S6 specifically includes:
[0066] The low-light image small sample classification module includes a feature block extraction module and a convolutional layer with a convolutional kernel size of ;
[0067] Input the low-light reconstructed image into the feature block extraction module, and the input reconstructed image is segmented into feature blocks of the same size , where , is the number of feature blocks into which the reconstructed image is divided, and each feature block represents a part of the local features of the reconstructed image. The formula is as follows:
[0068] ,
[0069] where represents the feature block extraction process, represents the feature blocks extracted from the reconstructed image ; Input the feature blocks into the convolutional layer with a convolutional kernel size of , and use a small window to extract the feature representation of each feature block , capture the fine local information of the image, and each feature block generates a corresponding feature vector . The formula is as follows:
[0070] ;
[0071] Concatenate and fuse all the obtained feature vectors to generate a feature vector . The formula is as follows:
[0072] ,
[0073] where represents the concatenation operation;
[0074] Calculate the class samples in the dataset. Assume that the characteristics of the low-light forest fire sample images of the th class are . If
[0075] is the total number of classes in the dataset samples, then the class calculation formula for the low-light fire sample images of the
[0076] th class sample is: where is the prototype of the class sample , and is the feature vector of the th class sample; in the actual detection stage, for each sample to be recognized, after the above operations, first extract its corresponding feature vector . Then, calculate the Euclidean distance between this feature vector and each class prototype. The Euclidean distance between the feature vector
[0077] and the prototype
[0078] of the th
[0079] class sample is calculated as:
[0080] where
[0081] represents the Euclidean norm; after calculating the distances of all class prototypes, select the class corresponding to the minimum distance as the predicted class for the recognized image sample.
[0082] The present invention also provides a forest fire warning system based on the Retinex algorithm, which executes the forest fire warning method based on the Retinex algorithm, including:
[0083] A data acquisition module: used to acquire low-light forest fire images;
[0084] Low-light image reconstruction module: It is used to multiply the low-light enhanced illumination map and the reflection map element by element, superimpose the low-light forest fire image through residual connection, and finally generate a low-light reconstructed image through photosensitive channel attention;
[0085] Low-light image few-shot classification module: It is used to divide the low-light reconstructed image into equal-sized feature blocks, extract features from the feature blocks to capture the local information of the reconstructed image, and make an image decision and recognition by calculating the distance between the image and the images in the database to obtain the recognition result;
[0086] Forest fire warning module: It is used to receive the recognition result obtained by the low-light image few-shot classification module and judge whether to give a warning according to the recognition result.
[0087] The advantages of the present invention are as follows:
[0088] The present invention uses the Retinex theory to enhance the object illumination and optimize the contrast of low-light images. By decomposing the illumination component and the reflection component, the visibility of forest fire image features such as flames and smoke is enhanced. At the same time, the proposed method combines few-shot learning, and improves the generalization ability of the model through feature adaptive extraction and data augmentation. This method can effectively improve the recognition accuracy of forest fire images in complex scenarios with low light, uneven illumination and scarce samples. Brief Description of the Drawings
[0089] The drawings are used to provide a further understanding of the present invention, and constitute a part of the specification. They are used together with the embodiments of the present invention to explain the present invention, and do not constitute a limitation to the present invention.
[0090] Figure 1 The flowchart of the steps of the method of the present invention;
[0091] Figure 2 It is the actual comparison effect of the model of the method of the present invention and the existing method in the DFSD dataset. Detailed Embodiments
[0092] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative work shall fall within the protection scope of the present invention.
[0093] Embodiment 1
[0094] In this embodiment, as Figure 1 shown, the present invention provides a forest fire warning method based on the Retinex algorithm, and the specific steps include:
[0095] S1. Obtain low-light forest fire images ;
[0096] S2. Input the low-light forest fire images into the photosensitive decomposition module, and decompose the images into a reflection map and an illumination map ;
[0097] Specifically, the photosensitive decomposition module includes two convolutional layers, a photosensitive decomposition attention module, a reflection convolutional layer, and an illumination convolutional layer; the photosensitive decomposition attention module includes a global pooling layer and a fully connected layer;
[0098] S21. Input the low-light forest fire images into the photosensitive decomposition module. Based on the image Retinex theory, obtain intermediate features of the low-light images through two convolutional layers with a convolutional kernel size of . The intermediate features of the low-light images are globally average pooled through the global pooling layer to generate a feature channel representation ; the feature channel representation is processed through the fully connected layer to obtain a channel weight ; the channel weight is multiplied element-wise with the intermediate features to obtain enhanced low-light features , and the formula is as follows:
[0099] ,
[0100] ,
[0101] ,
[0102] where and respectively represent the height and width of the low-light forest fire images, and respectively represent the first weight and the second weight, represents the ReLU activation function, represents the Sigmoid activation function, represents the element-wise multiplication operation;
[0103] S22. Input the enhanced low-light features into the reflection convolutional layer with a convolutional kernel size of and the illumination convolutional layer with a convolutional kernel size of respectively to obtain a reflection map and the illumination map , which is expressed by the formula as follows:
[0104] ,
[0105] ,
[0106] Among them, represents the operation of the reflection convolution layer, represents the operation of the illumination convolution layer.
[0107] S3. Construct a low-light detection module and input the illumination map into the low-light detection module. This module captures the low-light features of the low-light image through a multi-scale convolution layer, accurately locates the low-light features of the low-light forest fire image, and generates a low-light attention feature map through the Sigmoid activation function, splicing operation, and convolution layer ;
[0108] Specifically, the low-light detection module includes a multi-scale convolution layer, a Sigmoid activation function, a feature fusion layer, and a convolution layer;
[0109] S31. The illumination map undergoes feature extraction through a multi-scale convolution layer to obtain the first multi-scale feature and the second multi-scale feature , which is expressed by the formula as follows:
[0110] ,
[0111] ,
[0112] Among them, represents the convolution operation with a convolution kernel size of , represents the convolution operation with a convolution kernel size of ;
[0113] S32. The first multi-scale feature and the second multi-scale feature generate the first multi-scale attention map and the second multi-scale attention map through the Sigmoid activation function. The first multi-scale attention map and the second multi-scale attention map are subjected to an upsampling operation and spliced and fused with the illumination map to generate a spliced feature map , which is expressed by the formula as follows:
[0114] ,
[0115] ,
[0116] ,
[0117] Among them, represents the Sigmoid activation function, represents the concatenation operation, represents the upsampling operation;
[0118] S33. Use a convolutional layer to adjust the number of channels of the concatenated feature map to generate a low-light attention feature map , and the formula is as follows:
[0119] ,
[0120] Among them, represents a convolution operation with a convolution kernel size of .
[0121] S4. Construct a low-light enhancement module, and input the low-light attention feature map and the reflection map into the low-light enhancement module. The low-light attention feature map can retain the illumination details and enhance the brightness of the image during the low-light enhancement process, which is beneficial to reconstructing high-quality image illumination information, and finally generates a low-light enhanced illumination map ;
[0122] Specifically, the low-light enhancement module includes an encoder, a light-sensing feature capturer, a decoder, and a light-sensing mapper; the encoder gradually captures image features through multiple layers of convolution, and each layer in the encoder includes a convolutional layer with a convolution kernel size of , a ReLU activation function, and a convolutional layer with a convolution kernel size of ; the light-sensing feature capturer includes a convolutional layer with a convolution kernel size of , a ReLU activation function, and a convolutional layer with a convolution kernel size of ; the decoder has 5 layers, and each layer includes a deconvolutional layer with a convolution kernel size of , a ReLU activation function, and a deconvolutional layer with a convolution kernel size of ; the light-sensing mapper includes two convolutional layers with a convolution kernel size of ;
[0123] S41. Perform feature concatenation and fusion on the low-light attention feature map and the reflection map to generate the input feature of the low-light enhancement module , and the feature It is input into the encoder for processing to obtain the feature map generated by the encoder. , which is expressed by the formula as follows:
[0124] ,
[0125] ,
[0126] Among them, represents the pixel superposition operation, represents the concatenation operation, represents the convolution operation with a convolution kernel size of ; represents the convolution operation with a convolution kernel size of ; represents the ReLU activation function, represents the feature map generated by the th layer of the encoder, ; Each layer extracts features through convolution operations and the ReLU activation function, and gradually increases the number of channels of the features. The residual operation is used to add the input features to the convolved features through skip connections, and finally the encoder features are obtained;
[0127] S42. The obtained encoder features are input into the light-sensing feature capturer to capture the illumination information of the image using high-dimensional feature representation, and generate the light-sensing feature , which is expressed by the formula as follows:
[0128] ,
[0129] Among them, represents the convolution operation with a convolution kernel size of ;
[0130] S43. The light-sensing feature is input into the decoder for processing, and the resolution of the features is gradually restored through deconvolution operations to obtain the final decoder features . The calculation formula for the first layer of the decoder is:
[0131] ,
[0132] Among them, represents the deconvolution operation with a convolution kernel size of , represents the deconvolution operation with a convolution kernel size of ; The calculation formula for the fifth layer of the decoder is:
[0133] ,
[0134] The operations of the second to fourth layers are the same;
[0135] S44. Input the final features of the decoder into the light perception mapper to obtain a low-light enhanced illumination map .
[0136] S5. Construct a low-light image reconstruction module, and multiply the low-light enhanced illumination map element-wise with the reflection map , and stack the low-light forest fire image through residual connection, and finally generate a low-light reconstructed image ;
[0137] Specifically, S51. Multiply the low-light enhanced illumination map element-wise with the reflection map to generate a low-light reconstructed image , restore the color and texture of the image, and stack the low-light reconstructed image with the low-light forest fire image to generate a residual enhanced image , and the formula is as follows:
[0138] ,
[0139] ,
[0140] where represents the element-wise multiplication operation, represents the pixel stacking operation;
[0141] S52. The residual enhanced image passes through a convolutional layer with a convolutional kernel size of , the ReLu activation function, and the photosensitive channel attention module respectively to generate a low-light reconstructed image , and the formula is as follows:
[0142] ,
[0143] ,
[0144] ,
[0145] ,
[0146] where represents the convolutional residual enhanced image, represents the feature channel representation of the convolutional residual enhanced image, represents the channel weight of the convolutional residual enhanced image, and respectively represent the residual enhanced image height and width of and respectively represent the third weight and the fourth weight.
[0147] S6. Construct a low-light image small sample classification module, and input the low-light reconstructed image into the low-light image small sample classification module. This module first divides the reconstructed image into equally sized feature blocks, extracts features from the feature blocks to capture the local information of the reconstructed image, and finally makes an image decision and recognition by calculating the distance between the image and the images in the database to obtain the recognition result, and determines whether to give an early warning according to the recognition result.
[0148] Specifically, the low-light image small sample classification module includes a feature block extraction module and a convolutional layer with a convolutional kernel size of ;
[0149] Input the low-light reconstructed image into the feature block extraction module. The input reconstructed image is divided into feature blocks of the same size , where , is the number of feature blocks into which the reconstructed image is divided. Each feature block represents a part of the local features of the reconstructed image. The formula is as follows:
[0150] ,
[0151] where represents the feature block extraction process, represents the extracted from the reconstructed image feature blocks; Input the feature blocks into the convolutional layer with a convolutional kernel size of to extract the feature representation of each feature block using a small window to capture the fine local information of the image. Each feature block generates a corresponding feature vector . The formula is as follows:
[0152] ;
[0153] Concatenate and fuse all the obtained feature vectors to generate a feature vector . The formula is as follows:
[0154] ,
[0155] Among them, represents the splicing operation;
[0156] Calculate the category samples in the dataset. Assume that the feature of the th class of low-light forest fire sample images is , is the total number of categories in the dataset samples. Then, the category calculation formula for the th class of low-light fire sample images is:
[0157] ,
[0158] Among them, is the prototype of the category sample , is the th category sample's feature vector; in the actual detection stage, for each sample to be recognized, after the above operations, first extract its corresponding feature vector , and then calculate the Euclidean distance between this feature vector and each category prototype. The Euclidean distance between the feature vector and the prototype of the category sample is calculated as:
[0159] ,
[0160] Among them, represents the Euclidean norm; after calculating the distances of all category prototypes, select the category corresponding to the minimum distance as the predicted category for the recognized image sample.
[0161] Example 2
[0162] The present invention compares the proposed method for identifying low-light and few-sample forest fire images based on the Retinex algorithm with other fire image recognition methods to verify the effectiveness of the method proposed in the present invention under unified experimental conditions and environmental configurations. The following models are used as comparison models in this experiment: 1. U-Net model: This neural network is a classic image recognition and segmentation model. Its model structure realizes the extraction and fusion of multi-scale features through convolution and deconvolution operations, and is suitable for basic image recognition and segmentation tasks. 2. SegNet model: This model is a semantic recognition and segmentation network with an encoder-decoder structure. Its structure can effectively reduce the computational complexity of the model, but its ability to recognize the detailed boundaries in image objects is relatively weak. 3. DeepLabV3+ model: This model uses dilated convolution, encoding, and decoding structures, which can effectively capture multi-scale information of features, but the computational complexity of the model is relatively high. 4. Swin Transformer model: This model is a Transformer model based on the sliding window attention mechanism, which can effectively capture local and global information. 5. SETR model: This model is a semantic recognition method based on Transformer. It processes image data in a sequence-to-sequence manner, can capture long-range dependencies, and improve the classification accuracy. However, due to the lack of convolution operations, the feature extraction efficiency for high-resolution images is relatively low.
[0163] In the comparative experiment, four experimental metrics are used to verify the effectiveness of the proposed method, namely accuracy (Accuracy, Acc), precision (Precision, Pre), recall, and F1-score. Acc represents the proportion of the number of samples in which the model correctly identifies forest fire images to the total number of samples. The higher the value of the accuracy, the stronger the image recognition ability of the proposed method; Pre is used to measure the proportion of samples that are truly forest fire images among all samples predicted as forest fires. The higher the value of the precision, the lower the misjudgment rate of the model for the target recognition of forest fire images; Recall represents the proportion of the proposed method that is correctly predicted among all true positive samples; The F1 score represents the harmonic mean of precision and recall, and is used to measure the comprehensive image recognition performance of the proposed method.
[0164] The proposed method for identifying low-light and few-sample forest fire images based on the Retinex algorithm is verified in the DFSD dataset. The experimental results are shown in Table 1 and Figure 1 as follows.
[0165] Table 1 Comparison results of the model of the method of the present invention and the existing methods in the DFSD dataset
[0166]
[0167] As can be seen from the table, the proposed method has better performance in the comparison of experimental results with other fire image recognition models. Among them, the accuracy rate is higher than that of other models, reaching 91.60%, indicating that the proposed method has the strongest fire image recognition ability; the precision rate is 93.11%, significantly higher than other comparison methods, indicating that the model has the lowest false positive rate in the fire image detection task; the recall rate is 89.05%, indicating that the model can cover a more comprehensive range of fire categories when identifying fire scenes. From Figure 1 it can be seen that the method proposed in the present invention can better identify the fire situation in the forest under low light conditions, and the accuracy rate reaches 89% in the comparative experiment, achieving the best result among all comparative models. The experimental results show that the proposed method has higher accuracy and robustness in the fire recognition task, verifying the effectiveness of its fire image recognition ability in complex scenarios.
[0168] Example 3
[0169] This embodiment provides a forest fire warning system based on the Retinex algorithm, which executes the forest fire warning method based on the Retinex algorithm described in Embodiment 1, including:
[0170] Data acquisition module: used to acquire low-light forest fire images;
[0171] Photosensitive decomposition module: used to input the low-light forest fire image into the photosensitive decomposition module, and decompose the image into a reflection map and an illumination map based on the Retinex theory;
[0172] Weak light detection module: used to input the illumination map into the weak light detection module, capture the weak light features of the low-light image through a multi-scale convolutional layer, accurately locate the weak light features of the low-light forest fire image, and generate a weak light attention feature map through the Sigmoid activation function, splicing operation, and convolutional layer;
[0173] Weak light enhancement module: used to input the weak light attention feature map and the reflection map into the weak light enhancement module, and finally generate a weak light enhanced illumination map;
[0174] Low-light image reconstruction module: used to multiply the weak light enhanced illumination map and the reflection map element by element, and superimpose the low-light forest fire image through residual connection, and finally generate a low-light reconstructed image through the photosensitive channel attention;
[0175] Low-light image small sample classification module: used to divide the low-light reconstructed image into equal-sized feature blocks, extract features from the feature blocks to capture the local information of the reconstructed image, and make an image decision recognition by calculating the distance between the image and the images in the database to obtain the recognition result;
[0176] Forest fire warning module: It is used to receive the recognition results obtained by the low-light image small sample classification module and determine whether to give a warning according to the recognition results.
[0177] Finally, it should be noted that the above are only the preferred embodiments of the present invention and are not used to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, for those skilled in the art, they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A forest fire early warning method based on Retinex algorithm, characterized in that: The following steps are involved: S1. Obtain a low-light forest fire image S; S2. Input the low-light forest fire image S into the photosensitive decomposition module, and decompose the image into a reflectance map R and an illumination map I based on the Retinex theory; S3. Construct a low-light detection module and input the illumination map I into the low-light detection module. The module captures the low-light features of the low-light image through a multi-scale convolutional layer, accurately locates the low-light features of the low-light forest fire image, and generates a low-light attention feature map I′ through a Sigmoid activation function, a splicing operation, and a convolutional layer; S4. construct a weak light enhancement module, input the weak light attention feature map I′ and the reflection map R into the weak light enhancement module, and finally generate a weak light enhanced illumination map I″; The specific operation is as follows: the low-light enhancement module includes an encoder, a light feature capturer, a decoder and a light mapper; the encoder gradually captures image features through multi-layer convolution, and each layer in the encoder includes a convolution layer with a convolution kernel size of 11×11, a ReLU activation function and a convolution layer with a convolution kernel size of 15×15; the light feature capturer includes a convolution layer with a convolution kernel size of 3×3, a ReLU activation function and a convolution layer with a convolution kernel size of 1×1; the decoder has 5 layers, each layer includes a deconvolution layer with a convolution kernel size of 15×15, a ReLU activation function and a deconvolution layer with a convolution kernel size of 11×11; the light mapper includes two convolution layers with a convolution kernel size of 1×1; S41. Concatenate and fuse the low-light attention feature map I′ and the reflection map R to generate the input feature T of the low-light enhancement module in , the feature T in Input into the encoder for processing to obtain the feature map generated by the encoder The formula is as follows: T in =Concat(I′,R), Among them, + represents the pixel superposition operation, Concat(π) represents the splicing operation, Conv 15×15 Represents a convolution operation with a convolution kernel size of 15×15, Conv 11×11 represents a convolution operation with a convolution kernel size of 11×11, ReLU represents the ReLU activation function, represents the feature map generated by the encoder layer l-1, l = {1, ..., 5}; each layer extracts features through convolution operation and ReLU activation function, and gradually increases the number of channels of features. The residual operation is used to add the input features to the convolution features through skip connections, and finally the encoder features are obtained. S42. Obtained encoder features Input to the light-sensing feature capturer, use high-dimensional feature representation to capture the lighting information of the image, and generate the light-sensing feature T′. The formula is as follows: Among them, Conv 3×3 Indicates a convolution operation with a convolution kernel size of 3×3; S43. Input the light-sensing feature T′ into the decoder for processing, and gradually restore the resolution of the feature through deconvolution operations to obtain the final feature of the decoder The calculation formula of the first layer of the decoder is: Among them, Deconv 11×11 Deconvolution operation with a convolution kernel size of 11×11, Deconv 15×15 represents the deconvolution operation with a convolution kernel size of 15×15; the calculation formula for the fifth layer of the decoder is: The operations from the second to the fourth layers are the same; S44. The final feature of the decoder Input to the light mapper to obtain the low-light enhanced illumination map I″; S5. Construct a low-light image reconstruction module, multiply the low-light enhanced illumination map I″ and the reflectance map R element by element, and superimpose the low-light forest fire image S through residual connection, and finally generate the low-light reconstructed image S″ through the photosensitive channel attention; S6. Construct a low-light image small sample classification module and input the low-light reconstructed image S″ into the low-light image small sample classification module. The module first divides the reconstructed image S″ into feature blocks of equal size, extracts features from the feature blocks to capture the local information of the reconstructed image, and finally performs image decision recognition by calculating the distance between the image and the image in the database to obtain the recognition result, and determines whether to issue an early warning based on the recognition result.
2. The forest fire early warning method based on Retinex algorithm according to claim 1, characterized in that: Step S2 specifically includes: The photosensitive decomposition module includes two convolutional layers, a photosensitive decomposition attention module, a reflection convolutional layer and an illumination convolutional layer; the photosensitive decomposition attention module includes a global pooling layer and a fully connected layer; S21. Input the low-light forest fire image S into the photosensitive decomposition module. Based on the image Retinex theory, the low-light image intermediate feature X is obtained through two convolution layers. The low-light image intermediate feature X is globally averaged pooled through the global pooling layer to generate the feature channel representation z. c ; Feature channel represents z c After processing by the fully connected layer, the channel weight s is obtained c ; Set the channel weight s c Multiply it channel by channel with the intermediate feature X to obtain the enhanced low-light feature X′, which is expressed as follows: s c =σ(W2δ(W1z c )), X′=s c ·X, Where h and w represent the height and width of the low-light forest fire image, respectively; W1 and W2 represent the first weight and the second weight, respectively; δ represents the ReLU activation function, σ represents the Sigmoid activation function, and π represents the channel-by-channel multiplication operation; S22. Input the enhanced low-light feature X′ into the reflection convolution layer and the illumination convolution layer respectively to obtain the reflection map R and the illumination map I. The formula is as follows: R=Conv R (X′), I=Conv I (X′), Among them, Conv R Represents the operation of the reflective convolution layer, Conv I Represents the operation of the illumination convolution layer.
3. The forest fire early warning method based on Retinex algorithm according to claim 2 is characterized in that: Step S3 specifically includes: The low-light detection module includes a multi-scale convolution layer, a Sigmoid activation function, a feature fusion layer and a convolution layer; S31. The illumination image I is subjected to feature extraction through a multi-scale convolutional layer to obtain a first multi-scale feature I 1 and the second multi-scale feature I 2 , the formula is as follows: I 1 =Conv 5×5 (I), I 2 =Conv 7×7 (I), Among them, Conv 5×5 (·) indicates a convolution operation with a kernel size of 5×5. 7×7 (π) represents the convolution operation with a kernel size of 7×7; S32. The first multi-scale feature I 1 and the second multi-scale feature I 2 The first multi-scale attention map A is generated by the Sigmoid activation function 1 and the second multi-scale attention map A 2 , the first multi-scale attention map A 1 and the second multi-scale attention map A 2 Perform upsampling and merge it with the illumination map I to generate a spliced feature map I concat , the formula is as follows: A 1 =σ(I 1 ), A 2 =σ(I 2 ), I Concat =Concat(I,Upsample(A 1 ),Upsample(A 2 )), Among them, σ represents the Sigmoid activation function, Concat(·) represents the concatenation operation, and Upsample(·) represents the upsampling operation; S33. Use convolutional layers to adjust the concatenated feature map I concat The number of channels is , and the low-light attention feature map I′ is generated. The formula is as follows: I′=Conv 1×1 (I concat ), Among them, Conv 1×1 Represents a convolution operation with a kernel size of 1×1.
4. The forest fire early warning method based on Retinex algorithm according to claim 3 is characterized in that: Step S5 specifically includes: S51. Multiply the weak light enhanced illumination map I″ and the reflection map R element by element to generate a weak light reconstructed image S enh , reconstruct the weak light image S enh Superimposed with the low-light forest fire image S to generate the residual enhanced image S res , the formula is as follows: S res =S enh +S, in, represents an element-by-element multiplication operation, and + represents a pixel superposition operation; S52. Residual enhanced image S res After passing through the convolution layer with a convolution kernel size of 1×1, the ReLu activation function, and the photosensitive channel attention module, a low-light reconstructed image S″ is generated. The formula is as follows: S′ res =δ(Conv 1×1 (S res )), s s =σ(W4δ(W3z s )), S″=s s ·S′ res , Among them, S′ res represents the convolution residual enhanced image, z s represents the feature channel representation of the convolution residual enhanced image, s s represents the channel weight of the convolution residual enhanced image, h 1 and w 1 Respectively represent the residual enhanced image S res , W3 and W4 represent the third weight and the fourth weight respectively.
5. The forest fire early warning method based on Retinex algorithm according to claim 4 is characterized in that: Step S6 specifically includes: The low-light image small sample classification module includes a feature block extraction module and a convolution layer with a convolution kernel size of 3×3; The low-light reconstructed image S″ is input into the feature block extraction module, and the input reconstructed image S″ is divided into feature blocks P of the same size. i , where i = {1, ..., n}, n is the number of feature blocks into which the reconstructed image S″ is divided, and each feature block represents a part of the local features of the reconstructed image. The formula is as follows: PatchExtractor(S″)→{P1,P2,...,P n }, Among them, PatchExtractor(·) represents the feature patch extraction process, P1, P2, ..., P n Represents n feature blocks extracted from the reconstructed image S″; the feature block P i Input into the convolution layer with a convolution kernel size of 3×3, and use a small window to extract each feature block P i The feature representation captures the subtle local information of the image. Each feature block P i Generate the corresponding feature vector f(P i ), the formula is as follows: f(P i )=Conv 3×3 (P i ); All the obtained eigenvectors f(P i ) Splice and fuse to generate feature vector f test , the formula is as follows: f test =Concat(f(P1),f(P2),...,f(P i ),...,f(P n )), Among them, Concat represents the concatenation operation; Calculate the category samples in the data set, assuming that the features of the low-light forest fire sample image of category a are {f1, f2, ..., f k }, k is the total number of categories in the dataset samples, then the category calculation formula for the a-th low-light fire sample image is: Among them, a′ is the prototype of category sample a, f i is the feature vector of the sample of category a; in the actual detection stage, for each sample to be identified, after the above operations, first extract its corresponding feature vector f test Then, the Euclidean distance between the feature vector and each category prototype is calculated. The feature vector f test The Euclidean distance d from the prototype a′ of category sample a score The calculation formula is: d score (f test ,a′)=||f test -a′||, Among them, ||·|| represents the Euclidean norm; after calculating the distances of all category prototypes, the category corresponding to the minimum distance is selected as the predicted category of the recognized image sample.
6. A forest fire early warning system based on the Retinex algorithm, executing the forest fire early warning method based on the Retinex algorithm as claimed in claim 1, characterized in that: include: Data acquisition module: used to acquire low-light forest fire images; Photosensitive decomposition module: used to input low-light forest fire images into the photosensitive decomposition module and decompose the images into reflection maps and illumination maps based on Retinex theory; Weak-light detection module: used to input the illumination map into the weak-light detection module, capture the weak-light features of the low-light image through the multi-scale convolution layer, accurately locate the weak-light features of the low-light forest fire image, and generate the weak-light attention feature map through the Sigmoid activation function, splicing operation and convolution layer; Low-light enhancement module: used to input the low-light attention feature map and the reflection map into the low-light enhancement module, and finally generate a low-light enhanced illumination map; Low-light image reconstruction module: used to multiply the low-light enhanced illumination map and the reflectance map element by element, and superimpose the low-light forest fire image through residual connection, and finally generate the low-light reconstructed image through the photosensitive channel attention; Low-light image small sample classification module: used to divide the low-light reconstructed image into feature blocks of equal size, extract features from the feature blocks to capture local information of the reconstructed image, and perform image decision recognition by calculating the distance between the image and the image in the database to obtain the recognition result; Forest fire warning module: used to receive the recognition results obtained by the low-light image small sample classification module, and determine whether to issue a warning based on the recognition results.
Citation Information
Patent Citations
Efficient forest fire detecting system
CN107248252A
Low-illumination image enhancement method based on multi-attention mechanism and Retinex
CN116645305A