Forest fire early warning method and system based on Retinex algorithm
By applying Retinex algorithm and multi-module processing technology in the forest fire early warning system, the problem of poor forest fire image recognition accuracy in low-light and small sample scenarios is solved, and higher recognition accuracy and model generalization capabilities are achieved.
Patent Information
- Application Number
- CN202510307590.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-04-15
- 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 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 spread unevenly.
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, a low-light detection module and a low-light enhancement module are constructed to capture and enhance the low-light characteristics of the image, and the low-light image reconstruction module and a small sample classification module are used to generate identification results to determine whether to conduct early warnings.
The forest fire image recognition accuracy in low-light, uneven light and scarce samples is improved, the generalization ability of the model is enhanced, and the recognition accuracy of fire images can be effectively improved.
Smart Images

Figure CN119832681A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of forest fire early warning, and in particular relates to a forest fire early warning method and system based on a Retinex algorithm. Background Art
[0002] With the development of artificial intelligence and computer vision technology, image recognition technology has played an important role in the monitoring and early warning of forest fires. Forest fire image recognition technology is mainly used for early fire monitoring before disasters and post-disaster fire scope assessment. Image recognition technology can accurately identify fire characteristics such as flames and smoke through intelligent analysis of satellite remote sensing images, drone aerial images, and surveillance camera videos, detect potential fires in a timely manner, and reduce the workload of patrol personnel. In addition, this technology can also evaluate the spread trend of fires. The images are combined with multimodal data such as meteorological data and geographic information to help firefighters develop more efficient fire-fighting plans and optimize emergency resource scheduling. Forest fire image recognition technology improves the real-time and accuracy of fire monitoring and provides important technical support for forest ecological environmental protection.
[0003] However, in low-light environments, the visual features of flames and smoke are easily disturbed by weak light or noise, resulting in a decrease in the accuracy of forest fire image recognition models. 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 small number of samples limits the generalization ability of the model. General fire detection models have difficulty accurately detecting fires when faced with drastic changes in lighting, obstructed fire sources, or uneven smoke diffusion.
[0004] Therefore, the present invention proposes a low-light and few-sample forest fire early warning method based on the Retinex algorithm, which is used to solve the problem of poor forest fire image recognition accuracy 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 early warning method and system based on Retinex algorithm.
[0006] In order to achieve the above object, the present invention is implemented through the following technical solutions: The present invention provides a forest fire early warning method based on Retinex algorithm, comprising the following steps: S1. Acquisition of low-light forest fire images ; S2. Low-light forest fire images Input into the photosensitive decomposition module, and decompose the image into a reflection map based on the Retinex theory. and light map ; S3. Build a weak light detection module and convert the illumination map The input is sent to the low-light detection module, which captures the low-light features of low-light images through multi-scale convolutional layers, accurately locates the low-light features of low-light forest fire images, and generates a low-light attention feature map through Sigmoid activation function, splicing operation and convolutional layer. ; S4. Construct a low-light enhancement module to transform the low-light attention feature map and reflection map Input to the low-light enhancement module to finally generate a low-light enhancement illumination map ; S5. Build a low-light image reconstruction module to enhance the low-light illumination map With reflection map Element-wise multiplication and stacking of low-light forest fire images through residual connections , and finally generate low-light reconstructed images through photosensitive channel attention ; S6. Build a low-light image small sample classification module to reconstruct the low-light image Input low-light image small sample classification module, which first reconstructs the image The image is divided into feature blocks of equal size, and feature extraction is performed on the feature blocks to capture the local information of the reconstructed image. Finally, image decision recognition is performed by calculating the distance between the image and the image in the database to obtain the recognition result, and whether to issue an early warning is determined based on the recognition result.
[0007] Furthermore, 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. Low-light forest fire images The input is sent to the photosensitive decomposition module. Based on the image retinex theory, the intermediate features of the low-light image are obtained through two layers of convolution. , intermediate features of low-light images After the global pooling layer, global average pooling is performed to generate feature channel representation ; Feature channel representation After processing by the fully connected layer, the channel weight is obtained ; Set the channel weight With intermediate features Multiply each channel to get enhanced low-light features , the formula is as follows: , , , in, and Represent the height and width of the low-light forest fire image, and denote the first weight and the second weight respectively, represents the ReLU activation function, represents the Sigmoid activation function, Represents a channel-by-channel multiplication operation; S22. Enhanced low-light features Input them into the reflection convolution layer and the illumination convolution layer respectively to get the reflection map And the light map , the formula is as follows: , , in, represents the operation of the reflected convolutional layer, Represents the operation of the illumination convolution layer.
[0008] Furthermore, 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. Lighting map After feature extraction through multi-scale convolutional layers, the first multi-scale feature and the second multi-scale feature , the formula is as follows: , , in, Indicates that the convolution kernel size is The convolution operation, Indicates that the convolution kernel size is Convolution operation; S32. The first multi-scale feature and the second multi-scale feature The first multi-scale attention map is generated by the Sigmoid activation function and the second multi-scale attention map , the first multi-scale attention map and the second multi-scale attention map Perform upsampling and compare with the light map Splicing and fusion to generate splicing feature map , the formula is as follows: , , , in, represents the Sigmoid activation function, Represents a splicing operation, Represents an upsampling operation; S33. Use convolutional layers to adjust the concatenated feature map The number of channels is used to generate the low-light attention feature map , the formula is as follows: , in, Indicates that the convolution kernel size is The convolution operation.
[0009] Furthermore, step S4 specifically includes: 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 convolution kernel size of The convolution layer, ReLU activation function and convolution kernel size are The light-sensing feature capturer includes a convolution kernel size of The convolution layer, ReLU activation function and convolution kernel size are The decoder has 5 layers, each of which includes a convolution kernel size of The deconvolution layer, ReLU activation function and convolution kernel size are The light mapper includes two convolution kernels with a size of The convolutional layer; S41. Low-light attention feature map and reflection map Perform feature splicing and fusion to generate input features for the low-light enhancement module , the feature Input into the encoder for processing to obtain the feature map generated by the encoder , the formula is as follows: , , in, represents the pixel overlay operation, Represents a splicing operation, Indicates that the convolution kernel size is The convolution operation, Indicates that the convolution kernel size is The convolution operation, represents the ReLU activation function, Indicates the encoder The feature map generated by the layer, 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 connection, 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 light-sensing features , the formula is as follows: , in, Indicates that the convolution kernel size is Convolution operation; S43. Light-sensing features The input is processed into the decoder, and the resolution of the features is gradually restored through deconvolution operations to obtain the final features of the decoder. , the calculation formula of the first layer of the decoder is: , in, Indicates that the convolution kernel size is The deconvolution operation, Indicates that the convolution kernel size is The deconvolution operation of the decoder layer 5 is calculated as: , 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 get the low light enhanced light map .
[0010] Furthermore, step S5 specifically includes: S51. Enhance the illumination map with weak light With reflection map Multiply element by element to generate low-light reconstructed image , reconstructing the image from weak light Forest fire images with low light Superposition to generate residual enhanced image , the formula is as follows: , , in, represents an element-wise multiplication operation, Represents a pixel overlay operation; S52. Residual Enhanced Image After the convolution kernel size is The convolutional layer, ReLu activation function and photosensitive channel attention module generate low-light reconstructed images , the formula is as follows: , , , , in, represents the convolution residual enhanced image, represents the feature channel representation of the convolution residual enhanced image, represents the channel weights of the convolution residual enhanced image, and Respectively represent the residual enhanced image The height and width of and Represent the third weight and fourth weight respectively.
[0011] Further, step S6 specifically includes: The low-light image small sample classification module includes a feature block extraction module and a convolution kernel size of The convolutional layer; Reconstructing low-light images Input to the feature block extraction module, the input reconstructed image Split into feature blocks of equal size ,in, , To reconstruct the image The number of divided feature blocks, each feature block represents a part of the local features of the reconstructed image, the formula is as follows: , in, represents the feature block extraction process, Represents the reconstructed image from Extracted feature blocks; The input to the convolution kernel size is In the convolutional layer, a small window is used to extract each feature block The feature representation captures the subtle local information of the image. Each feature block Generate the corresponding feature vector , the formula is as follows: ; All the feature vectors obtained Concatenate and fuse to generate feature vector , the formula is as follows: , in, Represents a splicing operation; Calculate the category samples in the data set, assuming that The characteristics of low-light forest fire sample images are , is the total number of categories in the dataset samples, then The category calculation formula for low-light fire sample images is: , in, For category samples The prototype, For the The feature vector of the category sample; in the actual detection stage, for each sample that needs to be identified, after the above operations, the corresponding feature vector is first extracted Then, the Euclidean distance between the feature vector and each category prototype is calculated. The feature vector With category samples Prototype Euclidean distance The calculation formula is: , in, 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.
[0012] The present invention also provides a forest fire early warning system based on the Retinex algorithm, and the implementation of the forest fire early warning method based on the Retinex algorithm includes: 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.
[0013] The advantages of the present invention are: The present invention uses the Retinex theory to enhance the illumination and optimize the contrast of objects in low-light images, and enhances the visibility of forest fire image features such as flames and smoke by decomposing the illumination component and the reflection component. At the same time, the proposed method combines few-sample learning to improve the generalization ability of the model through adaptive feature extraction and data enhancement. This method can effectively improve the recognition accuracy of forest fire images in complex scenes with low light, uneven illumination and scarce samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0015] Figure 1 A flow chart of the steps of the method of the present invention; Figure 2 This is the actual comparison effect of the model of the method of the present invention and the existing method in the DFSD data set. DETAILED DESCRIPTION
[0016] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0017] Example 1 In this embodiment, Figure 1 As shown, the present invention provides a forest fire early warning method based on the Retinex algorithm, and the specific steps include: S1. Acquisition of low-light forest fire images ; S2. Low-light forest fire images Input into the photosensitive decomposition module, and decompose the image into a reflection map based on the Retinex theory. and light map ; 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; S21. Low-light forest fire images Input to the photosensitive decomposition module, based on the image Retinex theory, after the convolution kernel size is The two convolutional layers obtain the intermediate features of low-light images , intermediate features of low-light images After the global pooling layer, global average pooling is performed to generate feature channel representation ; Feature channel representation After processing by the fully connected layer, the channel weight is obtained ; Set the channel weight With intermediate features Multiply each channel to get enhanced low-light features , the formula is as follows: , , , in, and Represent the height and width of the low-light forest fire image, and denote the first weight and the second weight respectively, represents the ReLU activation function, represents the Sigmoid activation function, Represents a channel-by-channel multiplication operation; S22. Enhanced low-light features Input to the convolution kernel size is The reflection convolution layer and the convolution kernel size are In the illumination convolution layer, we get the reflection map And the light map , the formula is as follows: , , in, represents the operation of the reflected convolutional layer, Represents the operation of the illumination convolution layer.
[0018] S3. Build a weak light detection module and convert the illumination map The input is sent to the low-light detection module, which captures the low-light features of low-light images through multi-scale convolutional layers, accurately locates the low-light features of low-light forest fire images, and generates a low-light attention feature map through Sigmoid activation function, splicing operation and convolutional layer. ; Specifically, the weak light detection module includes a multi-scale convolution layer, a Sigmoid activation function, a feature fusion layer and a convolution layer; S31. Lighting map After feature extraction through multi-scale convolutional layers, the first multi-scale feature and the second multi-scale feature , the formula is as follows: , , in, Indicates that the convolution kernel size is The convolution operation, Indicates that the convolution kernel size is Convolution operation; S32. The first multi-scale feature and the second multi-scale feature The first multi-scale attention map is generated by the Sigmoid activation function and the second multi-scale attention map , the first multi-scale attention map and the second multi-scale attention map Perform upsampling and compare with the light map Splicing and fusion to generate splicing feature map , the formula is as follows: , , , in, represents the Sigmoid activation function, Represents a splicing operation, Represents an upsampling operation; S33. Use convolutional layers to adjust the concatenated feature map The number of channels is used to generate the low-light attention feature map , the formula is as follows: , in, Indicates that the convolution kernel size is The convolution operation.
[0019] S4. Build a low-light enhancement module to transform the low-light attention feature map and reflection map Input to the low-light enhancement module, the low-light attention feature map can retain the lighting details and improve the brightness of the image during the low-light enhancement process, which is conducive to reconstructing high-quality image lighting information, and finally generating a low-light enhanced lighting map ; Specifically, 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 multiple layers of convolution, and each layer in the encoder includes a convolution kernel size of The convolution layer, ReLU activation function and convolution kernel size are The light-sensing feature capturer includes a convolution kernel size of The convolution layer, ReLU activation function and convolution kernel size are The decoder has 5 layers, each of which includes a convolution kernel size of The deconvolution layer, ReLU activation function and convolution kernel size are The light mapper includes two convolution kernels with a size of The convolutional layer; S41. Low-light attention feature map and reflection map Perform feature splicing and fusion to generate input features for the low-light enhancement module , the feature Input into the encoder for processing to obtain the feature map generated by the encoder , the formula is as follows: , , in, represents the pixel overlay operation, Represents a splicing operation, Indicates that the convolution kernel size is The convolution operation, Indicates that the convolution kernel size is The convolution operation, represents the ReLU activation function, Indicates the encoder The feature map generated by the layer, 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 connection, 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 light-sensing features , the formula is as follows: , in, Indicates that the convolution kernel size is Convolution operation; S43. Light-sensing features The input is processed into the decoder, and the resolution of the features is gradually restored through deconvolution operations to obtain the final features of the decoder. , the calculation formula of the first layer of the decoder is: , in, Indicates that the convolution kernel size is The deconvolution operation, Indicates that the convolution kernel size is The deconvolution operation of the decoder layer 5 is calculated as: , 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 get the low light enhanced light map .
[0020] S5. Build a low-light image reconstruction module to enhance the low-light illumination map With reflection map Element-wise multiplication and stacking of low-light forest fire images through residual connections , and finally generate low-light reconstructed images through photosensitive channel attention ; Specifically, S51. enhance the weak light illumination map With reflection map Multiply element by element to generate low-light reconstructed image , restore the color and texture of the image, and reconstruct the image in low light Forest fire images with low light Superposition to generate residual enhanced image , the formula is as follows: , , in, represents an element-wise multiplication operation, Represents a pixel overlay operation; S52. Residual Enhanced Image After the convolution kernel size is The convolutional layer, ReLu activation function and photosensitive channel attention module generate low-light reconstructed images , the formula is as follows: , , , , in, represents the convolution residual enhanced image, represents the feature channel representation of the convolution residual enhanced image, represents the channel weights of the convolution residual enhanced image, and Respectively represent the residual enhanced image The height and width of and Represent the third weight and fourth weight respectively.
[0021] S6. Build a small sample classification module for low-light images and reconstruct low-light images Input low-light image small sample classification module, which first reconstructs the image The image is divided into feature blocks of equal size, and feature extraction is performed on the feature blocks to capture the local information of the reconstructed image. Finally, image decision recognition is performed by calculating the distance between the image and the image in the database to obtain the recognition result, and whether to issue an early warning is determined based on the recognition result.
[0022] Specifically, the low-light image small sample classification module includes a feature block extraction module and a convolution kernel size of The convolutional layer; Reconstructing low-light images Input to the feature block extraction module, the input reconstructed image Split into feature blocks of equal size ,in, , To reconstruct the image The number of divided feature blocks, each feature block represents a part of the local features of the reconstructed image, the formula is as follows: , in, represents the feature block extraction process, Represents the reconstructed image from Extracted feature blocks; The input to the convolution kernel size is In the convolutional layer, a small window is used to extract each feature block The feature representation captures the subtle local information of the image. Each feature block Generate the corresponding feature vector , the formula is as follows: ; All the feature vectors obtained Concatenate and fuse to generate feature vector , the formula is as follows: , in, Represents a splicing operation; Calculate the category samples in the data set, assuming that The characteristics of low-light forest fire sample images are , is the total number of categories in the dataset samples, then The category calculation formula for low-light fire sample images is: , in, For category samples The prototype, For the The feature vector of the category sample; in the actual detection stage, for each sample that needs to be identified, after the above operations, the corresponding feature vector is first extracted Then, the Euclidean distance between the feature vector and each category prototype is calculated. The feature vector With category samples Prototype Euclidean distance The calculation formula is: , in, 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.
[0023] Example 2 The present invention compares the proposed low-light and few-sample forest fire image recognition method based on the Retinex algorithm with other fire image recognition methods, and verifies the effectiveness of the method proposed in the present invention under unified experimental conditions and environmental configuration. 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, which 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 amount of calculation of the model, but the model is relatively weak in the recognition of detailed boundaries in image objects. 3. DeepLabV3+ model: This model uses void convolution, encoding and decoding structures, which can effectively capture the multi-scale information of features, but the computational complexity of the model is high. 4. Swin Transformer model: This model is a Transformer model based on a 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-distance dependencies and improve classification accuracy. However, due to the lack of convolution operations, the feature extraction efficiency of high-resolution images is low.
[0024] Four experimental indicators are used in comparative experiments to verify the effectiveness of the proposed method, namely, Accuracy (Acc), Precision (Pre), Recall, and F1-score. Acc represents the proportion of samples of forest fire images correctly identified by the model to the total number of samples. The higher the value of accuracy, the stronger the image recognition ability of the proposed method. Pre is used to measure the proportion of forest fire images among all samples predicted by the model. The higher the value of precision, the lower the misjudgment rate of the model for forest fire image target recognition. Recall represents the proportion of correctly predicted samples of the proposed method among all true positive samples. The F1 score represents the harmonic mean of precision and recall, which is used to measure the comprehensive image recognition performance of the proposed method.
[0025] The proposed low-light and few-sample forest fire image recognition method based on the Retinex algorithm was verified in the DFSD dataset. The experimental results are shown in Tables 1 and Figure 1 shown.
[0026] Table 1 Comparison results of the proposed method and existing methods in the DFSD dataset model As can be seen from the table, the proposed method performs better than other fire image recognition models in the experimental results. Among them, the accuracy is higher than other models, which is 91.60%, indicating that the proposed method has the strongest fire image recognition ability; the precision is 93.11%, which is significantly higher than other comparison methods, indicating that the model has the lowest misjudgment rate in the fire image detection task; the recall rate is 89.05%, indicating that the model can cover more comprehensive fire categories when identifying fire scenes. Figure 1 It can be seen that the proposed method can better identify forest fires under low light conditions, with an accuracy rate of 89% in the comparative experiment, achieving the best result among all the comparative models. The experimental results show that the proposed method has higher accuracy and robustness in fire identification tasks, verifying its effectiveness in fire image recognition in complex scenes.
[0027] Example 3 This embodiment provides a forest fire early warning system based on the Retinex algorithm, which executes the forest fire early warning method based on the Retinex algorithm described in Embodiment 1, including: 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.
[0028] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in 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. Acquisition of low-light forest fire images ; S2. Low-light forest fire images Input into the photosensitive decomposition module, and decompose the image into a reflection map based on the Retinex theory. and light map ; S3. Build a weak light detection module and convert the illumination map The input is sent to the low-light detection module, which captures the low-light features of low-light images through multi-scale convolutional layers, accurately locates the low-light features of low-light forest fire images, and generates a low-light attention feature map through Sigmoid activation function, splicing operation and convolutional layer. ; S4. Build a low-light enhancement module to transform the low-light attention feature map and reflection map Input to the low-light enhancement module to finally generate a low-light enhancement illumination map ; S5. Build a low-light image reconstruction module to enhance the low-light illumination map With reflection map Element-wise multiplication and stacking of low-light forest fire images through residual connections , and finally generate low-light reconstructed images through photosensitive channel attention ; S6. Build a small sample classification module for low-light images and reconstruct low-light images Input low-light image small sample classification module, which first reconstructs the image The image is divided into feature blocks of equal size, and feature extraction is performed on the feature blocks to capture the local information of the reconstructed image. Finally, image decision recognition is performed by calculating the distance between the image and the image in the database to obtain the recognition result, and whether to issue an early warning is determined 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. Low-light forest fire images The input is sent to the photosensitive decomposition module. Based on the image retinex theory, the intermediate features of the low-light image are obtained through two layers of convolution. , intermediate features of low-light images After the global pooling layer, global average pooling is performed to generate feature channel representation ; Feature channel representation After processing by the fully connected layer, the channel weight is obtained ; Set the channel weight With intermediate features Multiply each channel to get enhanced low-light features , the formula is as follows: , , , in, and Represent the height and width of the low-light forest fire image, and denote the first weight and the second weight respectively, represents the ReLU activation function, represents the Sigmoid activation function, Represents a channel-by-channel multiplication operation; S22. Enhanced low-light features Input them into the reflection convolution layer and the illumination convolution layer respectively to get the reflection map And the light map , the formula is as follows: , , in, represents the operation of the reflected convolutional layer, 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. Lighting map After feature extraction through multi-scale convolutional layers, the first multi-scale feature and the second multi-scale feature , the formula is as follows: , , in, Indicates that the convolution kernel size is The convolution operation, Indicates that the convolution kernel size is Convolution operation; S32. The first multi-scale feature and the second multi-scale feature The first multi-scale attention map is generated by the Sigmoid activation function and the second multi-scale attention map , the first multi-scale attention map and the second multi-scale attention map Perform upsampling and compare with the light map Splicing and fusion to generate splicing feature map , the formula is as follows: , , , in, represents the Sigmoid activation function, Represents a splicing operation, Represents an upsampling operation; S33. Use convolutional layers to adjust the concatenated feature map The number of channels is used to generate the low-light attention feature map , the formula is as follows: , in, Indicates that the convolution kernel size is The convolution operation.
4. The forest fire early warning method based on Retinex algorithm according to claim 3 is characterized in that: Step S4 specifically includes: 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 convolution kernel size of The convolution layer, ReLU activation function and convolution kernel size are The light-sensing feature capturer includes a convolution kernel size of The convolution layer, ReLU activation function and convolution kernel size are The decoder has 5 layers, each of which includes a convolution kernel size of The deconvolution layer, ReLU activation function and convolution kernel size are The light mapper includes two convolution kernels with a size of The convolutional layer; S41. Low-light attention feature map and reflection map Perform feature splicing and fusion to generate input features for the low-light enhancement module , the feature Input into the encoder for processing to obtain the feature map generated by the encoder , the formula is as follows: , , in, represents the pixel overlay operation, Represents a splicing operation, Indicates that the convolution kernel size is The convolution operation, Indicates that the convolution kernel size is The convolution operation, represents the ReLU activation function, Indicates the encoder The feature map generated by the layer, 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 connection, 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 light-sensing features , the formula is as follows: , in, Indicates that the convolution kernel size is Convolution operation; S43. Light-sensing features The input is processed into the decoder, and the resolution of the features is gradually restored through deconvolution operations to obtain the final features of the decoder. , the calculation formula of the first layer of the decoder is: , in, Indicates that the convolution kernel size is The deconvolution operation, Indicates that the convolution kernel size is The deconvolution operation of the decoder layer 5 is calculated as: , 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 get the low light enhanced light map .
5. The forest fire early warning method based on Retinex algorithm according to claim 4 is characterized in that: Step S5 specifically includes: S51. Enhance the illumination map with weak light With reflection map Multiply element by element to generate low-light reconstructed image , reconstructing the image from weak light Forest fire images with low light Superposition to generate residual enhanced image , the formula is as follows: , , in, represents an element-wise multiplication operation, Represents a pixel overlay operation; S52. Residual Enhanced Image After the convolution kernel size is The convolutional layer, ReLu activation function and photosensitive channel attention module generate low-light reconstructed images , the formula is as follows: , , , , in, represents the convolution residual enhanced image, represents the feature channel representation of the convolution residual enhanced image, represents the channel weights of the convolution residual enhanced image, and Respectively represent the residual enhanced image The height and width of and Represent the third weight and fourth weight respectively.
6. The forest fire early warning method based on Retinex algorithm according to claim 5, characterized in that: Step S6 specifically includes: The low-light image small sample classification module includes a feature block extraction module and a convolution kernel size of The convolutional layer; Reconstructing low-light images Input to the feature block extraction module, the input reconstructed image Split into feature blocks of equal size ,in, , To reconstruct the image The number of divided feature blocks, each feature block represents a part of the local features of the reconstructed image, the formula is as follows: , in, represents the feature block extraction process, Represents the reconstructed image from Extracted feature blocks; The input to the convolution kernel size is In the convolutional layer, a small window is used to extract each feature block The feature representation captures the subtle local information of the image. Each feature block Generate the corresponding feature vector , the formula is as follows: ; All the feature vectors obtained Concatenate and fuse to generate feature vector , the formula is as follows: , in, Represents a splicing operation; Calculate the category samples in the data set, assuming that The characteristics of low-light forest fire sample images are , is the total number of categories in the dataset samples, then The category calculation formula for low-light fire sample images is: , in, For category samples The prototype, For the The feature vector of the category sample; in the actual detection stage, for each sample that needs to be identified, after the above operations, the corresponding feature vector is first extracted Then, the Euclidean distance between the feature vector and each category prototype is calculated. The feature vector With category samples Prototype Euclidean distance The calculation formula is: , in, 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.
7. A forest fire early warning system based on Retinex algorithm, executing the forest fire early warning method based on 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 color image enhancement method based on Retinex and convolutional neural network
CN110232661A
Fatigue detection method and device based on target detection algorithm, and storage medium
CN115273188A
Low-illumination image enhancement method based on multi-attention mechanism and Retinex
CN116645305A
Low-illumination image enhancement method based on semi-quadratic splitting optimization
CN117745576A
Cited By
Fire event detection method based on brain-like vision deconvolution coding and decoding model
CN121305447A