A method for automatically identifying weather phenomena in low-light conditions

By using a region growing algorithm and HSV color space conversion to enhance road features under low-light conditions, combined with deep learning image enhancement and meteorological element fusion, the problem of low accuracy in nighttime driving weather recognition under low-light conditions is solved, achieving efficient weather recognition results.

CN117746374BActive Publication Date: 2026-11-24NANJING UNIV OF INFORMATION SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311822572.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2026-11-24
Estimated Expiration
2043-12-26

AI Technical Summary

Technical Problem

In low-light conditions, existing technologies struggle to effectively identify weather phenomena during nighttime driving, especially due to unstable lighting and difficulty in extracting sky features, resulting in low accuracy and high computational resource consumption.

Method used

The algorithm employs a region growing algorithm and HSV color space conversion to enhance road area features. It combines a deep learning-based low-light image enhancement algorithm and the ND-WeatherNet model with three-channel feature extraction and meteorological element fusion to enhance and extract features from nighttime driving images.

Benefits of technology

Without increasing training costs, this method effectively extracts road features and focuses on feature channels under different weather conditions, improving the accuracy and efficiency of nighttime driving weather recognition while reducing computational resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117746374B_ABST
    Figure CN117746374B_ABST
Patent Text Reader

Abstract

This invention discloses an automatic weather phenomenon recognition method under low-light conditions. First, low-light images captured during nighttime driving are classified to obtain enhanced road area images and overall enhanced images. Common features between the original and enhanced images are learned, and the influence of noise is limited by a loss function between the two channels. Then, a channel attention mechanism is used in deep image information processing to focus on important image information. Transfer learning is used to build auxiliary channels to help the model fit in the early stages of training. Meteorological elements are also fused to generate meteorological data weight vectors, which are then integrated into the model to improve its recognition ability. Finally, a Result mechanism is designed to perform multi-scale data fusion across three channels. The loss function is a combination of cross-entropy loss, branch difference loss, and brightness / darkness dual-channel loss. The Adam optimizer is used to optimize the learning rate, and a callback function is used to adjust the learning rate in a timely manner, achieving weather recognition under low-light conditions such as nighttime driving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to the design of an automatic weather phenomenon recognition method under low-light conditions. Background Technology

[0002] Weather recognition plays an important role in fields such as autonomous driving and traffic safety. Traditional weather recognition technologies using machine learning and deep learning often utilize the features of important areas such as the sky and the ground in images for identification. Among these, there are many studies on weather recognition in traffic scenarios. However, images obtained in low-light scenarios at night often suffer from problems such as unstable lighting, almost no sky features, and difficulty in extracting road features. Therefore, weather recognition in nighttime scenarios has become a top priority. At present, there are various methods for weather recognition in various scenarios.

[0003] Traditional weather recognition methods, such as those based on SVM and decision trees, are used to classify severe weather conditions in low visibility. Their advantage lies in their effectiveness in recognizing weather images in environments with poor visibility, such as sandstorms and haze. However, their feature representation capabilities and robustness are limited. In CNN (Convolutional Neural Network) methods, existing high-performing models like ResNet-50 and VGG-16 can be fine-tuned to adapt to different task requirements through transfer learning. This significantly reduces training time and data requirements for new tasks, but it is not applicable to all situations and may lead to negative transfer effects. Deep learning methods based on attention mechanisms can enable models to better focus on relevant information in the data, improving recognition efficiency and accuracy. However, they increase computational costs and the risk of overfitting.

[0004] In weather recognition tasks in road scenes, methods based on semantic segmentation models can effectively extract features of road areas and improve recognition accuracy in road scenes. However, the drawback is that additional training of the semantic segmentation model requires large-scale pixel-level labeled data, resulting in high computational resource consumption and cost. In image processing tasks in low-light scenes, there are methods based on Retinex theory to enhance low-light images, methods using gamma correction, and methods based on improved YOLOv5, all of which have achieved good enhancement results. However, the enhanced images are not suitable for all low-light image processing tasks. For example, the accuracy of weather recognition using enhanced nighttime images is consistently unsatisfactory. Therefore, directly using low-light enhancement for nighttime weather recognition is not yet a good processing method. Summary of the Invention

[0005] The problem to be solved by this invention is to provide an automatic weather phenomenon recognition method under low light conditions, which enhances road features in low light images of night driving, and focuses on different feature channels under different weather conditions to achieve weather recognition under low light conditions during night driving.

[0006] This invention adopts the following technical solution: an automatic identification method for weather phenomena under low-light conditions, comprising the following steps:

[0007] S1. Obtain original road images taken by the vehicle under low-light conditions at night, and obtain meteorological data at the corresponding locations of the original images through the vehicle's GPS and ERA5 dataset;

[0008] S2. Perform road region enhancement preprocessing on the original image. The road region is enhanced by using a region growing algorithm and HSV color space conversion to obtain a road region enhanced image.

[0009] S3. Use a deep learning-based low-light image enhancement algorithm to enhance the original image as a whole, and obtain the overall enhanced image;

[0010] S4. Construct the ND-WeatherNet model (nighttime driving weather recognition model), which includes three channels: WR channel, DW channel, and EN channel; input the enhanced image of the road area into the WR channel, and input the overall enhanced image into the DW channel and EN channel;

[0011] S5. Match the latitude and longitude of the meteorological data to obtain the meteorological elements at the corresponding locations of the original images. Perform feature recombination and scaling on the meteorological elements to generate a meteorological element weight vector.

[0012] S6. In the DW channel, a lightweight transfer learning-based model is used to extract the feature information of the sky and the ground from the overall enhanced image separately. Combining the overall feature information, the overall enhanced image is classified and recognized according to daytime mode, outputting a DW channel feature vector p containing classification information. Ai ;

[0013] S7. In the EN and WR channels, based on the channel attention mechanism, shallow and deep features are extracted from the overall enhanced image and the road region enhanced image, respectively. The shallow feature maps of the two channels are concatenated and fused to obtain a fused feature map, which is then input into the deep feature extraction module to obtain the fused EN channel feature vector p. Bi ;

[0014] S8. In the WR channel, the meteorological element weight vector is integrated into the fused feature map obtained in step S7, and then input into the deep feature extraction module to generate the fused WR channel feature vector p. Ci ;

[0015] S9. Convert the feature vectors p of the three channels Ai p Bi and p Ci Input the data into the Result module, perform fusion processing, calculate the loss function for nighttime driving weather recognition, perform backpropagation to update the model parameters, and output the obtained weather phenomenon recognition results.

[0016] Furthermore, the nighttime driving weather recognition model includes: a data input module, a preprocessing module, a three-channel feature extraction module, and a Result module;

[0017] The data input module acquires low-light road weather images for nighttime driving and retrieves the corresponding weather data from the meteorological data dataset as input to the model.

[0018] The preprocessing module includes an overall enhancement module and a road enhancement module. The overall enhancement module uses the Zero-DCE++ algorithm to enhance the nighttime image as a whole, while the road enhancement module uses the region growing algorithm and HSV color space conversion to enhance the road area. Meanwhile, meteorological elements undergo feature recombination and dimensional scaling operations in the preprocessing module to generate meteorological element weight vectors that meet the requirements of image model embedding.

[0019] The three-channel feature extraction module includes DW, EN, and WR channels. The overall enhanced image is processed through the DW and EN channels for feature extraction, while the road-enhanced image is processed through the WR channel for feature extraction. The output consists of DW channel feature vectors, EN channel feature vectors, and WR channel feature vectors, each containing four feature values.

[0020] The Result module is used to fuse the feature vectors output from the three channels, calculate the loss function value and perform backpropagation, and output the weather phenomenon recognition result obtained by fusing the feature information from the three channels.

[0021] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects:

[0022] 1. The present invention provides an automatic weather phenomenon recognition method under low light conditions. It uses a region growing algorithm and a low light image enhancement algorithm to enhance road features in low light images of nighttime driving. The growing operation is performed in the lower middle region of the image to identify the approximate area where the road is located. Then, by enhancing the corresponding road area in the brightness channel of the HSV color space, the road feature information in the image can be extracted well without extracting sky feature information or increasing the training cost.

[0023] 2. The present invention provides an automatic weather phenomenon recognition method under low light conditions. It uses linear scaling and attention mechanisms to fuse meteorological elements. By acquiring meteorological data corresponding to the weather in the image, scaling the data, and using bicubic interpolation to smooth and expand its dimensions to meet the embedding requirements of the image model, the data is then used as channel weights for image features. Different feature channels are focused on under different weather conditions, which further improves the recognition performance of the model.

[0024] 3. The present invention provides an automatic weather phenomenon recognition method under low-light conditions. By introducing channel attention and transfer learning, it achieves feature extraction and fusion of multimodal data such as overall enhanced images, road enhanced images, and meteorological elements. It uses a dual-channel structure for both bright and dark images to fully extract feature information from the images. It uses transfer learning to assist in the extraction of features from the enhanced images separately, and uses loss function constraints to enable the overall model to fit better in the early stages of training. It uses a meteorological element fusion method to enable the model to extract more effective weather information, thereby achieving weather recognition under low-light conditions such as night driving. Attached Figure Description

[0025] Figure 1 This is a flowchart of the automatic weather phenomenon recognition method under low light conditions according to the present invention;

[0026] Figure 2 This is a structural diagram of the overall model of the automatic weather phenomenon identification method under low light conditions of the present invention;

[0027] Figure 3 This is a schematic diagram of the ResDS_Block structure for deep feature extraction in an embodiment of the present invention;

[0028] Figure 4 This is a flowchart of the road feature enhancement algorithm in the ERF module of this invention;

[0029] Figure 5 A comparison image showing the road regions identified by the region growing algorithm in the ERF module's road enhancement algorithm and the enhancement effect;

[0030] Figure 6 This is a schematic diagram of the meteorological element fusion module of the present invention;

[0031] Figure 7 This is a schematic diagram of the scaling mechanism for different meteorological elements in this invention;

[0032] Figure 8 This is a comparison chart of the verification accuracy and verification loss results of the ablation experiment of this invention;

[0033] Figure 9 This is a comparison chart of the verification accuracy and verification loss results in the comparative experiments of the embodiments of the present invention;

[0034] Figure 10 This is a bar chart comparing the model accuracy, precision, recall, and F1 score of the comparative experiments in the embodiments of the present invention. Detailed Implementation

[0035] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the application will be further described in detail below with reference to the accompanying drawings. The described embodiments are only a part of the embodiments involved in this invention. All non-innovative embodiments based on these embodiments by other researchers in the art are within the protection scope of this invention. Furthermore, the step numbers in the embodiments of this invention are only set for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0036] In one embodiment of the present invention, an automatic weather phenomenon recognition technology under low-light conditions, such as... Figure 1 As shown, it includes the following steps:

[0037] S1. Obtain original road images taken by the vehicle under low-light conditions at night, and obtain meteorological data at the corresponding locations of the original images through the vehicle's GPS and ERA5 dataset;

[0038] S2. Perform road region enhancement preprocessing on the original image. The road region is enhanced by using a region growing algorithm and HSV color space conversion to obtain a road region enhanced image.

[0039] The preprocessing workflow for nighttime road images is as follows: Figure 4 As shown, the specific steps include:

[0040] S2.1 Input the original image into the ERF module, convert it from RGB color space to HSV color space, separate the luminance channel, identify the road region in the luminance channel using the region growing algorithm, and adjust the luminance using the following luminance adjustment formula:

[0041] EnhancedValue = GV·RRV·BF

[0042] Where EnhancedValue represents the enhanced brightness value of the road area, GV represents the grayscale value of the obtained brightness channel, RRV represents the grayscale value of the road area obtained by the region growing algorithm, and BF represents the brightness adjustment parameter. Increasing the BF value can enhance the brightness of the road area.

[0043] It should be noted that this formula can also be used to adjust the brightness value of non-road areas. Setting RRV to a fixed value of 1 and reducing the BF value can reduce the brightness of non-road areas to reduce the influence of surrounding lights.

[0044] S2.2. Use Gaussian filtering to blur the grayscale image of the road area, allowing for a natural transition between the brightened road area and the non-road area. The Gaussian filtering formula is as follows:

[0045]

[0046] Where H(i,j) is the value of the Gaussian kernel, ρ is the standard deviation of the Gaussian function, and i and j represent the offsets of the kernel in the horizontal and vertical directions, respectively.

[0047] However, directly adjusting the brightness of a grayscale image after Gaussian filtering will produce black borders at the road edges. To eliminate the black borders caused by blurring, the brightness adjustment formula above is modified as follows:

[0048]

[0049] Where DF is the brightness reduction factor; λ is the scaling parameter used to reduce the grayscale values ​​of the road area. The modified formula is used to adjust the brightness of the road area to eliminate the black borders caused by the blurring operation; the original formula is still used for non-road areas.

[0050] In this embodiment, the road feature enhancement result is as follows: Figure 5 As shown, this includes examples of road regions identified by the region growing algorithm, as well as comparison images of the effects before and after enhancement.

[0051] S3. Use a deep learning-based low-light image enhancement algorithm to enhance the original image as a whole, and obtain the overall enhanced image;

[0052] S4. Construct ND-WeatherNet (Night Driving Weather Recognition Model), which includes three channels: WR channel, DW channel, and EN channel; input the enhanced image of the road area into the WR channel, and input the overall enhanced image into the DW channel and EN channel;

[0053] S5. Match the meteorological data by latitude and longitude to obtain the meteorological elements at the corresponding locations in the original image. Perform feature recombination and scaling on the meteorological elements to generate a meteorological element weight vector. The specific processing steps include:

[0054] S5.1 Match the meteorological data with latitude and longitude to obtain the meteorological elements corresponding to the location of the original image; the meteorological elements include: air pressure, temperature, relative humidity, wind speed, precipitation, and snowfall.

[0055] S5.2 After rearranging the meteorological elements in the order of snow, snow, water, humidity, wind, pressure, pressure, wind, humidity, water, snow, snow, and so on, linear scaling is applied to each element. Then, bicubic interpolation is used to expand the weight vectors of the meteorological elements row-wise, maximizing the difference between the weight vectors generated for the four weather conditions. The formula for bicubic interpolation is shown below:

[0056]

[0057] In the formula, w(i,j) represents the weight function, f(x) i ,y j ) represents the coordinates (x) i ,y j The pixel value at (); the four weather conditions are: sunny, rainy, foggy, and snowy;

[0058] S5.3 Integrate the weight vector generated by meteorological elements into the ND-WeatherNet model through a transition structure. Use the weight vector of meteorological elements as the weight of the channel dimension of the image feature map, and re-weight the image feature map so that the model focuses on different channel dimensions under different weather conditions.

[0059] S6. In the DW channel, a lightweight transfer learning-based model is used to extract the feature information of the sky and the ground from the overall enhanced image separately. Combining the overall feature information, the overall enhanced image is classified and recognized according to daytime mode, outputting a DW channel feature vector p containing classification information. Ai ;

[0060] S7. In the EN and WR channels, based on the channel attention mechanism, shallow feature extraction is performed on the overall enhanced image and the road region enhanced image respectively to obtain shallow feature maps. The shallow feature extraction part includes 4 convolutional layers. Each convolutional layer adopts a depth-separable convolution method. The output shallow feature map of the second layer is concatenated with the original image. The first two layers do not change the width and height dimensions of the image features, while the last two layers reduce the width and height dimensions of the image features to reduce the number of parameters.

[0061] Extract the overall enhanced shallow features from the EN channel, including: enhanced edge, texture, color, and shape features;

[0062] The shallow features of road enhancement in low-light environments are extracted in the WR channel, including edge, texture, color, and shape features in low-light environments.

[0063] After concatenating and fusing the shallow feature maps of the two channels, a fused feature map is obtained. This fused feature map is then input into the deep feature extraction module to obtain the fused EN channel feature vector p. Bi and WR channel feature vector p CiThe specific processing procedure includes the following steps:

[0064] The shallow feature map of overall enhancement extracted from the S7.1 and EN channels and the shallow feature map of road enhancement in low light environment extracted from the WR channel are concatenated and fused using the Concatenate function. The fused feature map is then used for deep feature extraction.

[0065] By employing a dual-channel structure with EN and WR channels, shallow feature information for overall enhancement and road enhancement under low-light conditions is extracted, respectively. A loss function is designed between the shallow feature extraction modules of the two channels, as shown below:

[0066]

[0067] In the formula, C represents the number of channels in the feature map extracted by the shallow module, and a ijk and b ijk These represent the feature values ​​at corresponding positions in the bright and dark channels, respectively, and FM_loss represents the loss for both bright and dark channels.

[0068] This loss function allows the bright light channel to extract enhanced features while avoiding the influence of noise from over-enhanced or distorted areas on the recognition results. It also enables the dark light channel to extract dark features that were not originally recognized, allowing the two channels to constrain each other and fully extract useful feature information from the image.

[0069] S7.2 The fused feature map goes through a global average pooling layer and two fully connected layers. Through global average pooling, each two-dimensional feature channel is encoded as a parameter, and then the two fully connected layers are used to adjust the dimension of the channel parameter.

[0070] The formula for calculating global average pooling is:

[0071]

[0072] Where, P∈R 2C*1*1 H represents the channel feature vector output after global average pooling, H and W represent the height and width of the fused feature map, respectively, and i and j represent the spatial position of the feature.

[0073] S7.3 After applying the softmax function, a weight vector z of size C*1*1 is obtained, as shown in the following formula:

[0074] z=σ(W b δ(W a P))

[0075] Where, z∈R C*1*1 This represents the output weight vector, where P represents the output of the global average pooling layer, and W represents the weight vector.a and W b These represent the parameters of the two fully connected layers, where δ represents the ReLU layer and σ represents the softmax function.

[0076] S7.4. Using a weight vector that fuses the image features of the WR and EN channels, the features extracted from the EN channel are reweighted in the channel dimension to suppress noisy feature channels and reduce the impact of noise.

[0077] S8. In the WR channel, the meteorological element weight vector is integrated into the fused feature map obtained in step S7, and then input into the deep feature extraction module to generate the fused WR channel feature vector p. Ci The specific processing procedure includes the following steps:

[0078] S8.1 The transition structure for fusing meteorological elements is designed based on the U-Net structure network. It consists of two convolutional layers and two transposed convolutional layers. The image feature map formed by fusing the EN and WR channels first passes through two convolutional layers for downsampling, extracts the fused feature information, and adjusts the channel dimension of the feature map to meet the scale requirements of the meteorological element weight vector.

[0079] S8.2 Multiply the channel dimension of the downsampled feature map with the meteorological element weight vector, and reweight the channel dimension of the feature map using the meteorological element weight vector so that the model focuses on different channels under different weather conditions.

[0080] S8.3 After the image feature map is reweighted by meteorological elements, it is upsampled, so that the meteorological element features and weather image features are initially fused. The image feature information before fusion is maintained by skip connections.

[0081] S8.4. Perform deep feature extraction on the upsampled and restored fused feature map to fully extract effective feature information from the image and meteorological elements, thereby improving the model's recognition accuracy.

[0082] S9. Input the feature vector containing four feature values ​​obtained from the above three channels into the Result module for fusion processing and calculate the model's loss function to perform backpropagation and update the model parameters. Output the obtained weather phenomenon recognition result. The specific process includes the following steps:

[0083] S9.1 Calculate the branch difference loss:

[0084]

[0085]

[0086]

[0087] BD_loss = RMSE1 + RMSE2 + RMSE3

[0088] RMSE1 calculates the error between the DW and EN channels, RMSE2 calculates the error between the DW and WR channels, and RMSE3 calculates the error between the EN and WR channels. The total loss of the branch loss, BD_loss, is the sum of the losses of these three branches, where n is the number of feature values ​​contained in the feature vector.

[0089] The four feature values ​​are the log probabilities of the four weather types (sunny, rainy, foggy, and snowy) extracted from the corresponding channels.

[0090] S9.2 Calculate the cross-entropy loss. Based on the fact that the true labels corresponding to the three channels are the same, calculate the cross-entropy loss of the three branches respectively, and use the sum of their losses as the new cross-entropy loss function, as shown in the following formula:

[0091]

[0092] Where N represents the number of categories and M represents the number of model channels. y represents the classification probability of class i in channel j. i This represents the true label for category i;

[0093] S9.3 The total loss function, Total_loss, is composed of the branch difference loss, cross-entropy loss, and the bright / dark dual-channel loss from step S7.1, as shown in the following formula:

[0094] Total_loss=CE_loss+BD_loss+FM_loss.

[0095] S9.4 In addition to the loss function calculation section described above, the feature fusion processing of the results from the last three branches is also performed. To improve the accuracy of the results and enhance the generalization performance of the model, the prediction results of the three branches are weighted and summed, as shown in the following formula:

[0096]

[0097] Among them, z i It is the feature vector output from the three channels, λ i The normalization parameters for the three channels are λ1 + λ2 + λ3 = 1. The feature vectors output by the three channels are passed through the softmax function to obtain three normalized probabilities. i The parameters are normalized and summed over the normalized probabilities of the three branches to obtain a new probability distribution, in which the term with the largest probability value is the result of weather recognition.

[0098] The structure of the ND-WeatherNet model of this invention is as follows: Figure 2 As shown, the model presents a three-channel structure overall, and the specific construction process is as follows:

[0099] First, obtain nighttime driving weather images of low-light roads from the dataset and obtain the corresponding weather data from the meteorological data dataset, and input them into the model.

[0100] Then, after the nighttime images are entered into the model, they will enter the preprocessing module. This module performs two operations on the nighttime images: the overall enhancement module (EWF) and the road enhancement module (ERF). The overall enhancement uses the Zero-DCE++ algorithm, and the road enhancement uses the road feature enhancement algorithm proposed in this invention.

[0101] The overall enhanced image will be processed through the DW and EN channels for feature extraction, while the enhanced road image will be processed through the WR channel for feature extraction.

[0102] Meanwhile, meteorological elements undergo feature recombination and dimensional scaling operations in the preprocessing module. Scaling operations include... Figure 7 As shown, the rightmost column contains the scaled values ​​of each meteorological element, ultimately generating a weight vector that meets the requirements of image model embedding.

[0103] In this embodiment, the road feature enhancement algorithm flow is as follows: Figure 4 As shown in the figure, the effect obtained by the algorithm is as follows: Figure 5 As shown, Figure 5 The CCP presented enhanced images of four types of weather images. The first column shows the original nighttime road image from the NWTR-4 dataset. The second and third columns show the binary images of the road regions identified by the region growing algorithm and the blurred image after Gaussian filtering, respectively. The fourth and fifth columns show the heatmaps of the original image and the enhanced road image, respectively. It can be seen that the road regions in the enhanced image are significantly brighter than those in the original image, and the brightness of areas outside the road is also suppressed to some extent. The sixth column shows the final output image of the road feature enhancement algorithm.

[0104] The preprocessed images will then be fed into a deep learning model for feature extraction. The lightweight transfer learning model in the DW channel employs the "3C-CNN" weather recognition model. This model separates the feature information of the sky and ground in the image and combines it with the overall feature information to achieve daytime weather image classification, finally outputting a feature vector containing four feature values. In the EN channel, the results of the DSConv_Block (shallow) feature extraction are concatenated, and a channel attention mechanism is used to reweight the channel dimensions of the feature map. The reweighted feature map is then input into the ResDS_Block (deep) feature extraction module to obtain a feature vector containing four feature values. The ResDS_Block structure for deep feature extraction is as follows: Figure 3 As shown.

[0105] The WR and EN channels are largely the same, but the weight vector used for channel attention reweighting is generated from meteorological data, and the implementation process is as follows: Figure 6 As shown, deep fusion is achieved through a small U-Net structure, and finally a feature vector containing four feature values ​​is obtained.

[0106] The three feature vectors output from the three channels are fed into the final Result module for feature information fusion processing. The loss function value of the model is calculated and backpropagated to update the model parameters. Finally, the recognition result obtained by fusing the feature information from the three channels is output.

[0107] In this embodiment, regarding the meteorological data, due to the lack of hardware, it is impossible to obtain meteorological elements of the image shooting location in real time. Therefore, meteorological data that matches the weather of the image is matched from the ERA5 dataset, and a meteorological data dataset corresponding to the image dataset is created, so that each image corresponds to a set of meteorological data that matches its weather.

[0108] A portion of meteorological data is extracted as "forecast data" for model validation. Since ERA5 data provides extensive historical records of meteorological elements, it can be considered as an estimate of possible future weather conditions, providing sufficiently useful information to validate model performance. The aim is to provide a benchmark for future practical applications, enabling the model to make more accurate predictions based on actual meteorological data during implementation.

[0109] In subsequent work, the 24-hour historical meteorological data closest to the current time in ERA5 can be obtained by matching the latitude and longitude of the vehicle-mounted GPS, and the meteorological data at the current time can be predicted and estimated using this 24-hour historical data, so that the forecast results can be used as the real-time meteorological data input for the model.

[0110] Finally, ablation experiments were conducted on the meteorological element fusion module, the road feature enhancement module, and the transfer learning auxiliary channel, respectively. The results are as follows: Figure 8 As shown, Model-1 represents the baseline model, Model-2 represents the baseline model plus a transfer learning auxiliary channel module, Model-3 represents the baseline model plus a transfer learning auxiliary channel module plus a meteorological element fusion module, and ND-WeatherNet represents the complete model. The number of model parameters, size, and accuracy are shown in the table below:

[0111]

[0112] As can be seen, the complete ND-WeatherNet can achieve a recognition accuracy of 99.76% on the NWTR-4 validation set.

[0113] Furthermore, comparative experiments were conducted on the NWTR-4 dataset using common deep learning models such as VGG-16, ResNet18, GoogleNet, and MobileNet, and the ND-WeatherNet implementation from this invention. The results are as follows: Figure 9 As shown in Figure 10, the accuracy, precision, recall, and F1 score of each comparative model were also calculated, and the comparison results are shown in the bar chart in Figure 10.

[0114] These experimental results show that the ND-WeatherNet embodiment of the present invention outperforms other models.

[0115] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for automatically identifying weather phenomena under low-light conditions, characterized in that, Includes the following steps: S1. Obtain original road images taken by the vehicle under low-light conditions at night, and obtain meteorological data at the corresponding locations of the original images through the vehicle's GPS and ERA5 dataset; S2. Perform road region enhancement preprocessing on the original image. The road region is enhanced by using a region growing algorithm and HSV color space conversion to obtain a road region enhanced image. S3. Use a deep learning-based low-light image enhancement algorithm to enhance the original image as a whole, and obtain the overall enhanced image; S4. Construct a nighttime driving weather recognition model, including three channels: WR channel, DW channel and EN channel; Input the enhanced image of the road area into the WR channel, and input the overall enhanced image into the DW and EN channels; S5. Match the latitude and longitude of the meteorological data to obtain the meteorological elements at the corresponding locations of the original images. Perform feature recombination and scaling on the meteorological elements to generate a meteorological element weight vector. S6. In the DW channel, a lightweight transfer learning-based model is used to extract the feature information of the sky and the ground from the overall enhanced image separately. Combining the overall feature information, the overall enhanced image is classified and recognized according to daytime mode, outputting a DW channel feature vector p containing classification information. Ai ; S7. In the EN and WR channels, based on the channel attention mechanism, shallow and deep features are extracted from the overall enhanced image and the road region enhanced image, respectively. The shallow feature maps of the two channels are concatenated and fused to obtain a fused feature map, which is then input into the deep feature extraction module to obtain the fused EN channel feature vector p. Bi ; S8. In the WR channel, the meteorological element weight vector is integrated into the fused feature map obtained in step S7, and then input into the deep feature extraction module to generate the fused WR channel feature vector p. Ci ; S9. Convert the feature vectors p of the three channels Ai p Bi and p Ci Input the data into the Result module, perform fusion processing, calculate the loss function of the nighttime driving weather recognition model, perform backpropagation to update the model parameters, and output the obtained weather phenomenon recognition results.

2. The method for automatic identification of weather phenomena under low-light conditions according to claim 1, characterized in that, In step S2, the original image undergoes preprocessing for road region enhancement, including the following steps: S2.1 Input the original image into the ERF module, convert it from RGB color space to HSV color space, separate the luminance channel, identify the road region in the luminance channel using the region growing algorithm, and adjust the luminance using the following luminance adjustment formula: EnhancedValue = GV·RRV·BF Where EnhancedValue represents the enhanced brightness value of the road area, GV represents the grayscale value of the obtained brightness channel, RRV represents the grayscale value of the road area obtained by the region growing algorithm, and BF represents the brightness adjustment parameter. Increasing the BF value can enhance the brightness of the road area. S2.

2. Use Gaussian filtering to blur the grayscale image of the road area, allowing for a natural transition between the brightened road area and the non-road area. The Gaussian filtering formula is as follows: Where H(i,j) is the value of the Gaussian kernel, ρ is the standard deviation of the Gaussian function, and i and j represent the offsets of the kernel in the horizontal and vertical directions, respectively. Directly adjusting the brightness of a grayscale image processed by Gaussian filtering will produce black borders at the road edges. Therefore, the brightness adjustment formula in step S2.1 should be modified as follows: Where DF is the brightness reduction factor; λ is the scaling parameter used to reduce the grayscale value of the road area; The modified brightness adjustment formula is used to adjust the brightness of the road area to eliminate the black edges caused by the blurring operation. The brightness adjustment formula in step S2.1 is still used for the non-road area.

3. The method for automatic identification of weather phenomena under low-light conditions according to claim 1, characterized in that, Step S5 includes the following sub-steps: S5.1 Match the meteorological data with latitude and longitude to obtain the meteorological elements corresponding to the location of the original image; the meteorological elements include: air pressure, temperature, relative humidity, wind speed, precipitation, and snowfall. S5.2 After rearranging the meteorological elements in the order of snow, snow, water, humidity, wind, pressure, pressure, wind, humidity, water, snow, snow, and so on, linear scaling is applied to each element. Then, bicubic interpolation is used to expand the weight vectors of the meteorological elements row-wise, maximizing the difference between the weight vectors generated for the four weather conditions. The formula for bicubic interpolation is shown below: In the formula, w(i,j) represents the weight function, f(x) i ,y j ) represents the coordinates (x) i ,y j The pixel value at (); the four weather conditions are: sunny, rainy, foggy, and snowy; S5.3 Integrate the weight vector generated by meteorological elements into the night driving weather recognition model through a transition structure. Use the weight vector of meteorological elements as the weight of the channel dimension of the image feature map, and re-weight the image feature map so that the model focuses on different channel dimensions under different weather conditions.

4. The method for automatic identification of weather phenomena under low-light conditions according to claim 1, characterized in that, In step S7, shallow feature extraction is performed on the overall enhanced image and the road region enhanced image in the EN and WR channels based on the channel attention mechanism to obtain shallow feature maps, as follows: The shallow feature extraction part includes four convolutional layers. Each convolutional layer uses a depth-separable convolution method, and the output shallow feature map of the second layer is concatenated with the original image. The first two layers do not change the width and height dimensions of the image features, while the last two layers reduce the width and height dimensions of the image features to reduce the number of parameters. Extract the overall enhanced shallow features from the EN channel, including: enhanced edge, texture, color, and shape features; The shallow features of road enhancement in low-light environments are extracted in the WR channel, including edge, texture, color, and shape features in low-light environments.

5. The method for automatic identification of weather phenomena under low-light conditions according to claim 4, characterized in that, In step S7, the shallow feature maps of the EN and WR channels are concatenated and fused, as follows: The shallow feature map of overall enhancement extracted from the S7.1 and EN channels and the shallow feature map of road enhancement in low light environment extracted from the WR channel are concatenated and fused using the Concatenate function. The fused feature map is then used for deep feature extraction. S7.2 The fused feature map goes through a global average pooling layer and two fully connected layers. Through global average pooling, each two-dimensional feature channel is encoded as a parameter, and then the two fully connected layers are used to adjust the dimension of the channel parameter. The formula for calculating global average pooling is: Where, P∈R 2C*1*1 H represents the channel feature vector output after global average pooling, H and W represent the height and width of the fused feature map, respectively, and i and j represent the spatial position of the feature. S7.3 After applying the softmax function, a weight vector z of size C*1*1 is obtained, as shown in the following formula: z=σ(W b δ(W a P)) Where, z∈R C*1*1 This represents the output weight vector, where P represents the output of the global average pooling layer, and W represents the weight vector. a and W b These represent the parameters of the two fully connected layers, where δ represents the ReLU layer and σ represents the softmax function. S7.

4. Using a weight vector that fuses the image features of the WR and EN channels, the features extracted from the EN channel are reweighted in the channel dimension to suppress noisy feature channels and reduce the impact of noise.

6. The method for automatic identification of weather phenomena under low-light conditions according to claim 5, characterized in that, In step S7.1, shallow feature information of overall enhancement and road enhancement in low light environment is extracted through a dual-channel structure of EN and WR channels, respectively. A loss function is designed between the shallow feature extraction modules of the two channels, as shown below: In the formula, C represents the number of channels in the feature map extracted by the shallow module, and a ijk and b ijk These represent the feature values ​​at corresponding positions in the bright and dark channels, respectively, and FM_loss represents the loss for both bright and dark channels. This loss function allows the bright light channel to extract enhanced features while avoiding the influence of noise from over-enhanced or distorted areas on the recognition results. It also enables the dark light channel to extract dark features that were not originally recognized, allowing the two channels to constrain each other and fully extract useful feature information from the image.

7. The method for automatic identification of weather phenomena under low-light conditions according to claim 6, characterized in that, In step S8, the meteorological element weight vector is integrated into the WR channel image features, which includes the following sub-steps: S8.1 The transition structure for fusing meteorological elements is designed based on the U-Net structure network. It consists of two convolutional layers and two transposed convolutional layers. The image feature map formed by fusing the EN and WR channels first passes through two convolutional layers for downsampling, extracts the fused feature information, and adjusts the channel dimension of the feature map to meet the scale requirements of the meteorological element weight vector. S8.2 Multiply the channel dimension of the downsampled feature map with the meteorological element weight vector, and reweight the channel dimension of the feature map using the meteorological element weight vector so that the model focuses on different channels under different weather conditions. S8.3 After the image feature map is reweighted by meteorological elements, it is upsampled, so that the meteorological element features and weather image features are initially fused. The image feature information before fusion is maintained by skip connections. S8.

4. Perform deep feature extraction on the upsampled and restored fused feature map to fully extract effective feature information from the image and meteorological elements, thereby improving the model's recognition accuracy.

8. The method for automatic identification of weather phenomena under low-light conditions according to claim 1, characterized in that, In step S9, the feature vectors output from the three channels are fed into the Result module for loss function calculation. The loss function consists of three parts: branch difference loss, cross-entropy loss, and bright / dark dual-channel loss, as detailed below: S9.1 Calculate the branch difference loss: BD_loss = RMSE1 + RMSE2 + RMSE3 RMSE1 calculates the error between the DW and EN channels, RMSE2 calculates the error between the DW and WR channels, and RMSE3 calculates the error between the EN and WR channels. The total loss of the branch loss, BD_loss, is the sum of the losses of these three branches, where n is the number of feature values ​​contained in the feature vector. The feature vectors of the three channels contain four feature values, which are the log probabilities of the four weather types (sunny, rainy, foggy, and snowy) extracted from the corresponding channels. S9.2 Calculate the cross-entropy loss. Based on the fact that the true labels corresponding to the three channels are the same, calculate the cross-entropy loss of the three branches respectively, and use the sum of their losses as the new cross-entropy loss function, as shown in the following formula: Where N represents the number of categories and M represents the number of model channels. y represents the classification probability of class i in channel j. i This represents the true label for category i; S9.3 The total loss function, Total_loss, is composed of the branch difference loss, cross-entropy loss, and the bright / dark dual-channel loss from step S7.1, as shown in the following formula: Total_loss=CE_loss+BD_loss+FM_loss.

9. The method for automatic identification of weather phenomena under low-light conditions according to claim 8, characterized in that, Step S9 also includes feature fusion processing of the prediction results of the three branches, as shown in the following formula: Among them, z i It is the feature vector output from the three channels, λ i The normalization parameters for the three channels are λ1 + λ2 + λ3 = 1. The feature vectors output by the three channels are passed through the softmax function to obtain three normalized probabilities. i The parameters are normalized and summed over the normalized probabilities of the three branches to obtain a new probability distribution, in which the term with the largest probability value is the result of weather recognition.

10. The method for automatic identification of weather phenomena under low-light conditions according to claim 1, characterized in that, The nighttime driving weather recognition model includes: a data input module, a preprocessing module, a three-channel feature extraction module, and a Result module; The data input module acquires low-light road weather images for nighttime driving and retrieves the corresponding weather data from the meteorological data dataset as input to the model. The preprocessing module includes an overall enhancement module and a road enhancement module. The overall enhancement module uses the Zero-DCE++ algorithm to enhance the nighttime image as a whole, while the road enhancement module uses the region growing algorithm and HSV color space conversion to enhance the road area. Meanwhile, meteorological elements undergo feature recombination and dimensional scaling operations in the preprocessing module to generate meteorological element weight vectors that meet the requirements of image model embedding. The three-channel feature extraction module includes DW, EN, and WR channels. The overall enhanced image is processed through the DW and EN channels for feature extraction, while the road-enhanced image is processed through the WR channel for feature extraction. The output consists of DW channel feature vectors, EN channel feature vectors, and WR channel feature vectors, each containing four feature values. The Result module is used to fuse the feature vectors output from the three channels, calculate the loss function value and perform backpropagation, and output the weather phenomenon recognition result obtained by fusing the feature information from the three channels.

Citation Information

Patent Citations

  • Atmospheric scattering model and deep learning-based license plate recognizing system in dense fog weather

    CN108734189A

  • System and method for detecting state of parking barrier gate rod

    CN114928720A