Dynamic attention driving-based traffic scene refined weather identification method and system

By using a dynamic attention-driven three-level weather recognition model, the problem of refined weather recognition in traffic scenarios under the difference between day and night lighting is solved, achieving high-precision weather recognition and early warning in complex environments, and meeting the traffic control needs of highways.

CN122432867APending Publication Date: 2026-07-21SUN YAT SEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUN YAT SEN UNIV
Filing Date
2026-04-17
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing traffic scene weather recognition technologies lack sufficient accuracy in complex and dynamic environments, especially in situations with differences in day and night lighting and complex weather conditions, making it difficult to achieve refined recognition and failing to meet the actual needs of highway traffic management.

Method used

A three-level weather recognition model based on dynamic attention is adopted, including day and night classification, main weather coarse classification and sub-weather fine classification. It combines EfficientNet feature extraction and grouped cross-channel spatial adaptive attention module. Night images are optimized by day and night classification module and night image adaptive enhancement module. Feature extraction and fusion are performed by global and local bi-branch weather perception dynamic attention module.

Benefits of technology

It enables refined weather recognition of traffic scenarios under varying day and night lighting conditions, improving the accuracy and robustness of weather recognition. It provides a fully functional application platform that supports early warning of meteorological disasters and traffic control on highways.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122432867A_ABST
    Figure CN122432867A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on dynamic attention drive's traffic scene fine weather identification method and system, the method includes: display user interface, the user interface includes identification control area and analysis feedback area;Through the first identification control component in the identification control area, trigger transmission process, obtain first to be identified data, and the first to be identified data is displayed through the analysis feedback area;Through the second identification control component in the identification control area, trigger detection process to the first to be identified data is carried out three-level weather identification operation, generates weather identification result and early warning prompt, and the weather identification result and the early warning prompt are displayed through the analysis feedback area;Wherein, the three-level weather identification operation includes day and night classification operation, main weather rough classification operation and sub-weather fine classification operation.The application can improve weather identification precision, and can be widely applied in computer vision technology field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, and in particular to a method and system for refined weather recognition in traffic scenes based on dynamic attention-driven approaches. Background Technology

[0002] Traffic scene weather recognition is a core supporting technology for intelligent transportation systems and autonomous driving environmental perception. Its recognition accuracy and robustness directly determine the safety and reliability of traffic operations under complex weather and lighting conditions. Early weather recognition research mainly relied on handcrafted features, using physical attributes such as color histograms, texture descriptors, and contrast to complete classification tasks. However, these methods are highly dependent on specific prior assumptions and lack adaptability to complex and dynamic traffic scenarios, making it difficult to adapt to the variability of actual traffic environments. Existing research mostly focuses on building general weather classification models. While this coarse-grained classification system can meet the basic needs of macro-meteorological monitoring, it still has significant shortcomings in highway traffic control scenarios with stringent safety requirements. For example, the impact of light snow accumulation on road surface adhesion coefficient differs significantly from that of heavy snow accumulation: the former only requires a speed reduction warning, while the latter requires emergency response measures such as road closures or snow removal operations. However, existing public datasets generally lack fine-grained annotations for weather types, making it difficult for models to learn discriminative features that can distinguish key differences such as different rainfall intensities and snow accumulation levels, thus failing to meet the practical application requirements of highway traffic control for fine-grained weather recognition. In addition, existing weather recognition architectures generally do not specifically optimize for the differences in day and night lighting when processing all-day scenes. Nighttime images are affected by insufficient light, resulting in a significantly lower signal-to-noise ratio. Furthermore, the non-uniform illumination interference caused by artificial light sources such as streetlights and vehicle lights leads to a significant domain shift in feature distribution compared to daytime images. Summary of the Invention

[0003] In view of this, the main objective of the embodiments of the present invention is to provide a method and system for refined weather recognition in traffic scenes based on dynamic attention-driven approaches, in order to solve at least one of the problems in the prior art. The present invention can improve the accuracy of weather recognition.

[0004] To achieve the above objectives, one aspect of the present invention provides a method for refined weather recognition in traffic scenes based on dynamic attention-driven approaches, the method comprising: The user interface includes an identification control area and an analysis feedback area. The transmission process is triggered by the first identification control component in the identification control area to acquire the first data to be identified, and the first data to be identified is displayed in the analysis feedback area. The detection process is triggered by the second identification control component in the identification control area. Using a traffic scene refined weather identification model based on dynamic attention, a three-level weather identification operation is performed on the first data to be identified to generate weather identification results and warning prompts. The weather identification results and warning prompts are then displayed in the analysis feedback area. The three-level weather identification operation includes day and night classification, main weather coarse classification, and sub-weather fine classification.

[0005] In some embodiments, the traffic scene refined weather recognition model based on dynamic attention includes a first-level day / night classification network, a second-level main weather coarse classification network, and a third-level sub-weather fine classification network; the first-level day / night classification network includes a day / night classification module and a nighttime image adaptive enhancement module; the second-level main weather coarse classification network includes an EfficientNet feature extraction module and a grouped cross-channel spatial adaptive attention module; the third-level sub-weather fine classification network includes a normal weather confirmation branch, a rainy weather fine classification branch, a snowy weather fine classification branch, a foggy weather fine classification branch, and a sandstorm weather confirmation branch; the rainy weather fine classification branch, the snowy weather fine classification branch, and the foggy weather fine classification branch all include a weather perception dynamic attention module; the weather perception dynamic attention module includes global and local dual branches.

[0006] In some embodiments, triggering the transmission process and acquiring the first data to be identified through the first identification control component in the identification control area includes the following steps: By selecting a single image through the first transmission sub-component in the first recognition control component, the first data to be recognized is obtained; Alternatively, the first data to be identified can be obtained by selecting a batch of images through the second transmission sub-component in the first identification control component; Alternatively, the first data to be identified can be obtained by selecting a video file through the third transmission sub-component in the first identification control component; Alternatively, the first data to be identified can be obtained by selecting monitoring data through the fourth transmission sub-component in the first identification control component.

[0007] In some embodiments, selecting monitoring data through the fourth transmission sub-component in the first identification control component to obtain the first data to be identified includes the following steps: In response to the command to select monitoring data, read the input monitoring device address, username, and password; Based on the monitoring device address, the username, and the password, the target monitoring device is accessed, and the monitoring data is dynamically acquired through the target monitoring device to obtain the first data to be identified.

[0008] In some embodiments, the detection process is triggered by the second identification control component in the identification control area, and a three-level weather identification operation is performed on the first data to be identified using a traffic scene refined weather identification model based on dynamic attention to generate weather identification results and warning prompts, including the following steps: The second identification control component uses the day-night classification module to perform day-night classification on the first data to be identified and outputs a binary classification result. When the binary classification result of the first data to be identified belongs to daytime data, the first data to be identified is input into the secondary main weather coarse classification network for main weather coarse classification operation, and the first intermediate processing feature and the five-class classification result are output. Based on the five-class classification results, the first intermediate processing feature is input into the three-level sub-weather fine classification network to perform sub-weather fine classification operation, and the sub-weather fine classification results are obtained. The weather identification result is generated based on the binary classification result, the five-class classification result, and the sub-weather classification result. The warning message is generated based on the weather recognition results.

[0009] In some embodiments, the detection process is triggered by the second identification control component in the identification control area, and a three-level weather identification operation is performed on the first data to be identified using a traffic scene refined weather identification model based on dynamic attention to generate weather identification results and warning prompts, including the following steps: The second identification control component uses the day-night classification module to perform day-night classification on the first data to be identified and outputs a binary classification result. When the binary classification result of the first data to be identified belongs to nighttime data, the nighttime image adaptive enhancement module performs nighttime image enhancement operation on the first data to be identified to obtain the second data to be identified. The second data to be identified is input into the secondary main weather coarse classification network to perform main weather coarse classification operation, and the second intermediate processing feature and the five-class classification result are output. Based on the five-class classification results, the second intermediate processing feature is input into the three-level sub-weather fine classification network to perform sub-weather fine classification operation, and the sub-weather fine classification results are obtained. The weather identification result is generated based on the binary classification result, the five-class classification result, and the sub-weather classification result. The warning message is generated based on the weather recognition results.

[0010] In some embodiments, when the binary classification result of the first data to be identified belongs to nighttime data, the nighttime image adaptive enhancement module performs nighttime image enhancement on the first data to be identified to obtain the second data to be identified, including the following steps: The first data to be identified is converted in data format and normalized to a preset range to obtain the first intermediate processed data; When the first intermediate processing data is a color image, the first intermediate processing data is converted into YCrCb space to obtain the second intermediate processing data. Then, the brightness channel of the second intermediate processing data is denoised by bilateral filtering to obtain a denoised image. When the first intermediate processing data is a grayscale image, a single channel of the first intermediate processing data is denoised by bilateral filtering to obtain a denoised image. The denoised image is subjected to adaptive gamma correction and contrast-limited adaptive histogram equalization to obtain an enhanced image. The enhanced image is subjected to inverse format conversion and normalization to obtain the second data to be identified.

[0011] In some embodiments, the target data to be identified includes first data to be identified or second data to be identified, and the target features include first intermediate processing features or second intermediate processing features. The target data to be identified is input into the secondary main weather coarse classification network for main weather coarse classification, and the target features are output, including the following steps: The EfficientNet feature extraction module performs feature extraction on the target data to be identified to obtain the third intermediate processing feature. The third intermediate processing feature is enhanced, compressed, and subjected to nonlinear transformation through the first residual block to obtain the fourth intermediate processing feature. The fourth intermediate processing feature is processed by channel grouping through the first intermediate processing block to obtain multiple groups of fifth intermediate processing features; By performing cross-group attention interaction on the fifth intermediate processing feature through a cross-group attention fusion block, a sixth intermediate processing feature is obtained; The global average feature and local peak feature of the sixth intermediate processing feature are extracted through the dual-path spatial attention enhancement block, the average pooling path and the max pooling path, respectively. The global average feature and the local peak feature are fused using a channel-space feature fusion block to obtain the channel-space joint attention weight. The channel-space feature fusion block is used to perform element-wise multiplication of the channel-space joint attention weight with the sixth intermediate processing feature to obtain the seventh intermediate processing feature. The seventh intermediate processing feature and the fourth intermediate processing feature are residually connected through the second intermediate processing block to obtain the eighth intermediate processing feature; The target feature is obtained by performing dimensionality enhancement on the eighth intermediate processing feature through the second residual block; Wherein, when the target data to be identified is the first data to be identified, the target feature is the first intermediate processing feature; when the target data to be identified is the second data to be identified, the target feature is the second intermediate processing feature; the grouped cross-channel spatial adaptive attention module includes the first residual block, the first intermediate processing block, the cross-group attention fusion block, the dual-path spatial attention enhancement block, the channel-spatial feature fusion block, the second intermediate processing block, and the second residual block.

[0012] In some embodiments, the target feature includes a first intermediate processing feature or a second intermediate processing feature. Based on the five-class classification result, the target feature is input into the three-level sub-weather fine classification network for sub-weather fine classification operation to obtain the sub-weather fine classification result, including the following steps: When the five-class classification result indicates that the target feature belongs to normal weather data, the target feature is input into the normal weather confirmation branch to obtain the first confidence level that the target feature belongs to normal weather data; When the five-class classification result indicates that the target feature belongs to rainy day data, the target feature is input into the rainy day fine classification branch. Feature extraction and dynamic fusion processing are performed through the global and local dual branches to obtain the rainy day fine classification result. When the five-class classification result indicates that the target feature belongs to the snowy weather data, the target feature is input into the snowy weather sub-classification branch. Feature extraction and dynamic fusion processing are performed through the global and local dual branches to obtain the snowy weather sub-classification result. When the five-class classification result indicates that the target feature belongs to foggy weather data, the target feature is input into the foggy weather sub-classification branch. Feature extraction and dynamic fusion processing are performed through the global and local dual branches to obtain the foggy weather sub-classification result. When the five-class classification result indicates that the target feature belongs to the dust storm data, the target feature is input into the dust storm weather confirmation branch to obtain the second confidence level that the target feature belongs to the dust storm data.

[0013] To achieve the above objectives, another aspect of this invention proposes a refined weather recognition system for traffic scenes based on dynamic attention-driven methods, the system comprising: A visualization module is used to display the user interface, which includes an identification control area and an analysis feedback area; The data transmission module is used to trigger a transmission process through the first identification control component in the identification control area, acquire the first data to be identified, and display the first data to be identified through the analysis feedback area; The data detection module is used to trigger the detection process through the second identification control component in the identification control area, and to perform a three-level weather identification operation on the first data to be identified using a traffic scene refined weather identification model based on dynamic attention, generate weather identification results and warning prompts, and display the weather identification results and warning prompts through the analysis feedback area. The three-level weather identification operation includes day and night classification, main weather coarse classification, and sub-weather fine classification.

[0014] To achieve the above objectives, another aspect of the present invention provides an electronic device, the electronic device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method described above.

[0015] To achieve the above objectives, another aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.

[0016] To achieve the above objectives, another aspect of the present invention provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions to cause the computer device to perform the aforementioned method.

[0017] The embodiments of the present invention include at least the following beneficial effects: The present invention provides a method and system for refined weather recognition in traffic scenarios based on dynamic attention. This solution provides an intuitive and convenient visualization platform through a user interface, which includes a recognition control area and an analysis feedback area. A transmission process is triggered by a first recognition control component in the recognition control area to acquire first data to be recognized, and this first data to be recognized is displayed in the analysis feedback area, providing a reliable data foundation for subsequent analysis. A detection process is triggered by a second recognition control component in the recognition control area, and a three-level weather recognition operation is performed on the first data to be recognized using a refined weather recognition model for traffic scenarios based on dynamic attention. This generates weather recognition results and warning prompts, which are then displayed in the analysis feedback area. The three-level weather recognition operation includes day / night classification, main weather coarse classification, and sub-weather fine classification, forming a multimodal input-intelligent recognition-result display and warning business logic. This achieves time period differentiation, coarse weather type classification, and fine weather severity classification, improving the accuracy of weather recognition. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the implementation environment for refined weather recognition in traffic scenarios based on dynamic attention-driven methods provided in this embodiment of the invention. Figure 2 This is a flowchart of a traffic scene refined weather recognition method based on dynamic attention-driven approach provided in an embodiment of the present invention; Figure 3 This is a diagram showing the interface of the weather recognition system provided in an embodiment of the present invention; Figure 4 This is a network architecture diagram of a traffic scene refined weather recognition model based on dynamic attention-driven approach provided in an embodiment of the present invention; Figure 5 This is a training loss curve of the traffic scene refined weather recognition model based on dynamic attention driven provided in an embodiment of the present invention; Figure 6 This is a training accuracy curve of the traffic scene refined weather recognition model based on dynamic attention driven provided in the embodiments of the present invention; Figure 7 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this invention; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this invention as detailed in the appended claims.

[0021] It should be noted that although functional modules are divided in the system diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first / S100" and "second / S200" in the specification, claims, and the foregoing drawings may be used herein to describe various concepts, but unless specifically stated otherwise, these concepts are not limited by these terms. These terms are used only to distinguish one concept from another. For example, first information may also be referred to as second information without departing from the scope of the embodiments of the invention, and similarly, second information may also be referred to as first information. Depending on the context, the words "if" or "when" as used herein may be interpreted as "when," "in response to a determination," or "in the event of a determination."

[0022] The terms “at least one,” “multiple,” “each,” “any,” etc., used in this invention, “at least one” includes one, two, or more than two; “multiple” includes two or more than two; “each” refers to each of the corresponding multiple; and “any” refers to any one of the multiple.

[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.

[0024] In related weather recognition technologies, traditional recognition models are mostly designed based on sufficient daytime lighting conditions, neglecting issues such as headlight glare, road surface reflection, and blurred weather features in low-light nighttime environments. Nighttime weather features (such as the reflective effect of raindrops and the scattering intensity of fog) differ significantly from daytime features. When directly using models trained during the day for nighttime recognition, the accuracy generally drops by 20%-30%, failing to meet the needs of 24 / 7 monitoring. Furthermore, existing methods often employ end-to-end single classification networks (such as ResNet50 and VGG16), merging day / night determination, weather type identification, and level subdivision into a single task. This architecture presents two major problems: first, high task complexity, making it difficult for the model to simultaneously learn the complex relationships between the temporal domain (day / night) and the spatial domain (weather features); second, error propagation effects, where incorrect weather type identification directly leads to the failure of subsequent level subdivision, resulting in poor overall robustness. Simultaneously, existing networks are insufficiently adapted to the feature differences of different weather conditions and lack targeted feature extraction structures.

[0025] In view of this, this invention provides a method and system for refined weather recognition in traffic scenarios based on dynamic attention. This solution, based on a dynamic attention-driven refined weather recognition system for traffic scenarios, deeply integrates the capabilities of a three-level weather recognition model through a visual user interface. It revolves around the business logic of "multimodal input (single image, batch, video, monitoring) - intelligent recognition - result display and early warning," achieving full-scenario coverage from offline batch analysis to real-time monitoring and recognition. The day-night classification, main weather coarse classification, and sub-weather fine classification capabilities of the dynamic attention-driven refined weather recognition model for traffic scenarios are visualized through the interface. It can be applied to the perception of meteorological disaster precursors and traffic control on highways, providing a fully functional and user-friendly application platform.

[0026] refer to Figure 1 This invention also provides an implementation environment diagram for refined weather recognition in traffic scenes based on dynamic attention-driven methods. For example... Figure 1 As shown, this implementation environment includes a terminal 101 and a server 102. The terminal 101 carries a software system that can display a user interface, which is a visual interface. In this user interface, the embodiment triggers processes by identifying components in the control area and the analysis feedback area, intelligently identifies weather based on input multimodal data, and displays the identification results and warning prompts. In this implementation environment, the terminal 101 can be any electronic product that allows human-computer interaction through one or more methods such as a keyboard, touchpad, touchscreen, remote control, voice interaction, or handwriting device. This electronic product can receive commands input by the user through components via its visual user interface and display the response results of the commands in real time. For example, as... Figure 1As shown, the terminal 101 can be a personal computer (PC), mobile phone, personal digital assistant (PDA), wearable device, handheld computer (PPC), tablet computer, etc.

[0027] Figure 2 This is an optional flowchart of a method for refined weather recognition in traffic scenes based on dynamic attention-driven approaches provided in an embodiment of the present invention. Figure 2 The method may include, but is not limited to, steps S100 to S300: Step S100: Display the user interface, which includes an identification control area and an analysis feedback area; Step S200: By identifying the first identification control component in the identification control area, the transmission process is triggered to obtain the first data to be identified, and the first data to be identified is displayed in the analysis feedback area; Step S300: By identifying the second identification control component in the identification control area, the detection process is triggered. Using the traffic scene refined weather identification model based on dynamic attention, the first data to be identified is subjected to a three-level weather identification operation to generate weather identification results and warning prompts. The weather identification results and warning prompts are then displayed in the analysis feedback area. The three-level weather identification operation includes day and night classification, main weather coarse classification, and sub-weather fine classification.

[0028] In step S100 of some embodiments, the user interface may include an identification control area and an analysis feedback area. The identification control area is used to provide components including, but not limited to, components for triggering a transmission process and components for triggering a detection process. The analysis feedback area is used to provide components including, but not limited to, displaying first data to be identified, displaying weather identification results, displaying early warning prompts, and triggering a data export process.

[0029] For example, such as Figure 3The diagram shows an optional weather recognition system interface. The system name (200) and current time (300) are displayed at the top of the interface, clearly indicating the system's location and time context. Optionally, if the system is positioned for weather recognition on highways, the system name (200) will be "Highway Weather Recognition System"; if the system is positioned for weather recognition on urban roads, the system name (200) will be "Urban Road Weather Recognition System." No restrictions are imposed here. The system interface also includes an analysis feedback area (400) and a recognition control area (500). The analysis feedback area 400 may include, but is not limited to, an image / video display area 401, used to display the first uploaded data to be identified. It can load a single image (supporting JPEG and PNG formats), a video frame (supporting MP4 format), or a monitoring screen (supporting RTSP and HTTP protocols), allowing users to intuitively view the original input content. The identification result area 402 is used to display the three-level weather classification categories and their corresponding confidence levels, intuitively presenting the model's identification results for the weather. The early warning prompt area 403 is used to output early warning prompts for severe weather such as heavy rain, severe snow accumulation, and extremely dense fog, thereby providing decision-making basis for traffic management departments. The historical data area 404 is used to display an identification result information table, which records the entire process information of each detection in detail, using "serial number, (source) type, path (IP), time period, (time period) confidence level, weather type, (weather type) confidence level, weather severity, (weather severity) confidence level" as dimensions, realizing multi-dimensional archiving and traceability of the three-level weather identification results. The recognition control area 500 is divided into an image recognition area 510 and a video recognition area 520 according to the multi-source data type.

[0030] In some embodiments, such as Figure 3 As shown, the historical data area 404 in the analysis feedback area 400 includes a data export component. By triggering this data export component, the historical identification result information table can be exported as an Excel spreadsheet to obtain offline data.

[0031] In some embodiments, the step of triggering a transmission process and acquiring the first data to be identified by identifying a first identification control component in the identification control area may include, but is not limited to, the following steps: Step S210: Select a single image through the first transmission sub-component in the first identification control component to obtain the first data to be identified; or, select a batch of images through the second transmission sub-component in the first identification control component to obtain the first data to be identified; or, select a video file through the third transmission sub-component in the first identification control component to obtain the first data to be identified; or, select monitoring data through the fourth transmission sub-component in the first identification control component to obtain the first data to be identified.

[0032] In step S210 of some embodiments, such as Figure 3As shown, the first recognition control component in the image recognition area 510 includes a single image selection control 511 and a batch image selection control 512. The first recognition control component in the video recognition area 520 includes a video file selection control 521 and a surveillance video selection control 522. Optionally, the user selects a single highway scene image as the first data to be recognized using the first transmission sub-component (i.e., the single image selection control 511), and displays the single highway scene image in the image / video display area 401. Alternatively, the user selects a local folder or an external device (such as a USB drive) folder using the second transmission sub-component (i.e., the batch image selection control 512), directly imports a multi-image folder as the first data to be recognized, and displays all highway scene images in the multi-image folder in the image / video display area 401. Alternatively, the user selects and imports a video file, such as historical highway surveillance video, as the first data to be recognized using the third transmission sub-component (i.e., the video file selection control 521), and displays the video file in the image / video display area 401. Alternatively, the user can select and connect to the monitoring device through the fourth transmission sub-component (i.e., the selected monitoring video control 522), dynamically acquire and import the monitoring data of the monitoring device as the first data to be identified, and display the monitoring data in the image / video display area 401.

[0033] In some embodiments, the step of selecting monitoring data and obtaining the first data to be identified by means of the fourth transmission sub-component in the first identification control component may include, but is not limited to, steps S211 to S212: Step S211: In response to the command to select monitoring data, read the input monitoring device address, username and password; Step S212: Connect to the target monitoring device based on the monitoring device address, username, and password. Dynamically acquire monitoring data through the target monitoring device to obtain the first data to be identified.

[0034] In steps S211 to S212 of some embodiments, after the user triggers the fourth transmission sub-component, a dialog box pops up on the interface. The dialog box includes a monitoring device IP address input field, a username input field, and a password input field. Through the various input fields in the dialog box, the monitoring device IP address, username, and password entered by the user are obtained. Identity and permission information are verified, and access is established to the target monitoring device corresponding to the monitoring device IP address. Through this target monitoring device, real-time monitoring footage (such as real-time monitoring footage of highways or urban roads, etc., which is not limited here) can be obtained, thereby obtaining the first data to be identified.

[0035] In step S300 of some embodiments, such as Figure 3As shown, the image recognition area 510 also includes a second recognition control component, namely the start image detection control 513, and the video recognition area 520 also includes a second recognition control component, namely the start video detection control 523. After transmitting the first data to be recognized, by clicking the second recognition control component in the corresponding area, the first data to be recognized uploaded in the corresponding area can be input into the traffic scene refined weather recognition model based on dynamic attention driving, to perform a three-level weather recognition operation, thereby generating weather recognition results and corresponding weather warnings. At the same time, the generated weather recognition results and corresponding confidence levels are displayed in the recognition result area 402 of the analysis feedback area 400, and the warning information corresponding to the recognized weather is displayed in the warning information area 403 of the analysis feedback area 400.

[0036] like Figure 4 As shown, this embodiment of the invention constructs a refined weather recognition model for traffic scenes based on dynamic attention. This model employs a hierarchical network architecture consisting of a first-level day / night classification network, a second-level main weather coarse classification network, and a third-level sub-weather fine classification network. The first-level day / night classification network includes a day / night classification module and a nighttime image adaptive enhancement module. The second-level main weather coarse classification network includes an EfficientNet feature extraction module and a grouped cross-channel spatial adaptive attention module. For different weather characteristics, dedicated branches are designed in the third-level sub-weather fine classification network, including a normal weather confirmation branch, a rainy weather fine classification branch, a snowy weather fine classification branch, a foggy weather fine classification branch, and a sandstorm weather confirmation branch. This enables accurate identification of five main weather types (normal, rainy, snowy, foggy, and sandstorm) and their 15 sub-levels, while ensuring stable performance under different daytime and nighttime lighting conditions, providing reliable technical support for intelligent traffic weather early warning. Among them, the rainy day sub-classification branch, the snowy day sub-classification branch, and the foggy day sub-classification branch all have a weather perception dynamic attention module, which includes global and local dual branches.

[0037] In some embodiments, a first-level day / night classification network can quickly and accurately determine the day / night state of the input image, providing a basis for subsequent image preprocessing. This network includes a day / night classification module and a nighttime image adaptive enhancement module: the day / night classification module is responsible for classifying the day / night state, providing temporal context information for weather recognition; the nighttime image adaptive enhancement module optimizes the quality of nighttime images to address issues such as insufficient lighting and significant noise, ensuring the input stability of the subsequent weather classification network. A second-level main weather coarse classification network can quickly distinguish between five main weather types: normal, rain, fog, snow, and sandstorm, providing reliable category prior information for the third-level sub-weather fine classification network. This network uses EfficientNet as the feature extraction backbone, combined with a grouped cross-channel spatial adaptive attention module to enhance the channel and spatial discrimination capabilities of the features. Finally, the classifier outputs the prediction results for the five main weather types. Based on the results of the second-level main weather coarse classification, a third-level sub-weather fine classification network can achieve refined discrimination of the intensity level under each main weather type. In the three-level sub-weather fine classification network, dedicated sub-classification branches are set up to address the feature differences of different primary weather conditions. A weather-aware dynamic attention module is introduced to enhance fine-grained feature representation, thereby improving the intensity classification accuracy. The three-level sub-weather fine classification network contains five dedicated branches, corresponding to the five primary weather types: normal, rain, fog, snow, and sandstorm. Each branch shares the basic network structure of "feature projection + classifier," differing only in the configuration of the weather-aware dynamic attention module to adapt to different weather features. For example, normal weather and sandstorms only contain one intensity level and do not require additional attention enhancement; therefore, the normal weather branch and the sandstorm branch do not have a weather-aware dynamic attention module. The rain, snow, and fog branches all introduce the weather-aware dynamic attention module, and different global-local branch weights are set according to the uniqueness of the fine-grained features of each type of weather, achieving weather-adaptive adjustment of attention weights.

[0038] For example, refer to Figure 4 The input image first passes through a primary day / night classification network to determine its day / night state. If it is a nighttime image, it undergoes quality optimization through a nighttime image adaptive enhancement module. Then, it is input together with the directly normalized daytime image into a secondary primary weather coarse classification network, which outputs predictions for five primary weather types: normal, rain, fog, snow, and sandstorm. Based on the primary weather coarse classification results, the deep features extracted from the secondary primary weather coarse classification network (such as the first and second intermediate processing features) are directionally input into the corresponding tertiary sub-weather fine classification network, ultimately completing the refined discrimination of different intensity levels under each primary weather condition.

[0039] In some embodiments, a traffic scene refined weather recognition model based on dynamic attention is trained. Before model training, the training set is preprocessed using Normalize based on ImageNet mean ([0.485, 0.456, 0.406]) and standard deviation ([0.229, 0.224, 0.225]), and data augmentation strategies of random horizontal flipping (probability 0.5) and random cropping (size 224×224) are used to improve the model's generalization ability. The training set and validation set are divided in an 8:2 ratio to ensure consistent data distribution. A custom loss function is used. Optionally, the cross-entropy loss function is used to calculate the time period loss, weather type (main weather) loss, and weather severity (sub-weather) loss, and the time period loss (weight 0.3), weather type loss (weight 0.3), and weather severity loss (weight 0.4) are weighted and summed to obtain the custom loss function. The optimizer is AdamW, and the initial learning rate is set to... Weight decay is To achieve Regularization.

[0040] During model training, the batch size was set to 64, the number of data loading threads to 8, and the training device to CUDA:0. A total of 200 training rounds were executed. The training set was divided into a training subset (12,600 images, used for parameter gradient descent updates) and a validation subset (3,150 images, used for real-time monitoring of generalization ability) in an 8:2 ratio. After each training round, the accuracy of day / night classification, coarse classification of main weather, and fine classification of sub-weather on the validation set was calculated. Finally, the model weights with the best performance on the validation set were saved, resulting in a trained, dynamically attention-driven, refined weather recognition model for traffic scenes. This model was then used for real-time weather recognition. For example, model loss and accuracy were monitored in real-time during training. The model training loss curve is shown below. Figure 5 As shown, the accuracy curve is as follows: Figure 6 As shown.

[0041] In some embodiments, the trained model undergoes a three-level test. The test dataset is independently divided from the original collected data, totaling 2900 valid images. These include 800 images for rainy days (subdivided into four categories: light rain, moderate rain, heavy rain, and torrential rain, with 100 images per category during the day and 100 at night); 800 images for snowy days (subdivided into four categories: light snow, moderate snow, heavy snow, and severe snow, with 100 images per category during the day and 100 at night); 1000 images for foggy days (subdivided into five categories: light fog, dense fog, heavy fog, very dense fog, and extremely dense fog, with 100 images per category during the day and 100 at night); 200 images for normal weather (100 images during the day and 100 at night); and 100 images for sandstorms (100 images during the day). Day and night samples for each subcategory are allocated in a 1:1 ratio to balance the testing ratio for different lighting scenarios. Before testing, all samples undergo the same preprocessing operations as the validation set, without data augmentation. The Level 1 day / night classification test targets all test samples, inputting them into the day / night classification module to output time period categories, and statistically analyzing the recognition accuracy for daytime, nighttime, and overall conditions. The Level 2 main weather coarse classification test, based on the Level 1 test results, inputs daytime samples and enhanced nighttime samples into the main weather coarse classification module, outputting five categories: normal, rainy, snowy, foggy, and sandstorm. It calculates the classification accuracy for each weather type in day / night scenarios and the overall average accuracy. The Level 3 sub-weather fine classification test, based on the Level 2 coarse classification, inputs corresponding category samples into the dedicated branch of the sub-weather fine classification module, outputting results for each sub-level. It calculates the sub-average accuracy for rainy, snowy, and foggy conditions, as well as the overall fine classification average accuracy, using accuracy as the core evaluation indicator to ensure that the overall fine classification average accuracy exceeds 90%, meeting the engineering application requirements for traffic meteorological early warning.

[0042] The trained, dynamic attention-driven traffic scene refined weather recognition model was subjected to three levels of testing. The model test results are as follows: (1) Level 1 Day-Night Classification Test: The model demonstrates extremely high accuracy in distinguishing between daytime and nighttime scenarios, providing a reliable foundation for subsequent coarse classification of main weather conditions and fine classification of sub-weather conditions. In daytime scenarios, the day-night classification accuracy is 99.6%; in nighttime scenarios, the accuracy is 99.8%. The overall average accuracy for day-night classification reaches 99.7%, as shown in Table 1 below. Table 1

[0043] (2) Secondary main weather classification test: The secondary test, serving as a "coarse classification filter," aims to quickly narrow down the scope of fine-category recognition. Experimental results show an overall average accuracy of 99.4%, meeting engineering requirements. Specifically, the average accuracy for snowy weather was 99.7% day and night. The white coverage of snow exhibits high contrast in both day and night scenes, with significant color differences between daytime snow cover and road surfaces, and strong contrast between the reflective snow cover and the dark background at night. The model can complete recognition without complex feature extraction. The average accuracy for normal weather was 100%, indicating stable features under disaster-free conditions. The average accuracy for foggy weather was 97.4%, with slightly lower accuracy at night due to the slightly higher visual similarity between light fog and normal weather. Daytime fog, however, remained unaffected by its blurred features, resulting in higher accuracy. The average accuracy for rainy weather was 99.9%, with slightly lower accuracy at night due to poor visibility and glare from lights. During sandstorms, the recognition accuracy was 100% due to the clear visual features. In summary, the main weather coarse classification exhibits only a very small number of misclassifications in scenarios with the superposition of "low light + weak disaster features," demonstrating excellent overall accuracy. It efficiently completes the "coarse classification filtering" task, providing clear guidance for subsequent detailed weather classification. The accuracy comparison of the main weather classification is shown in Table 2 below: Table 2

[0044] (3) Level 3 Sub-weather Classification Test: The three-level sub-weather classification is the core step in verifying the model's refined recognition capability, and its recognition accuracy directly determines the refined adaptation capability of traffic weather warnings. The results of this experiment show that the model performs well in categories with high feature discriminative power, but there is still room for optimization in categories with continuous feature gradients and weak discriminative power. The detailed performance of each category is shown in Table 3.

[0045] Table 3

[0046] In the basic weather categories, the model's recognition performance was consistently excellent: the recognition accuracy for normal weather was 100% in both daytime and nighttime scenarios; the recognition accuracy for sandstorm weather was 100% in daytime scenarios, with no nighttime test samples.

[0047] The model demonstrated the best overall recognition performance across all snow categories, with high average accuracy rates for each category both day and night. Specifically, the daytime accuracy rate for severe snow accumulation was 100%, and the nighttime accuracy rate was 99%; for moderate snow accumulation, the daytime accuracy rate was 94%, and the nighttime accuracy rate was 98%; for light snow accumulation, the daytime accuracy rate was 96%, and the nighttime accuracy rate was 92%; and for heavy snow accumulation, the daytime accuracy rate was 93%, and the nighttime accuracy rate was 87%. The average daytime accuracy rate for all snow categories reached 95.8%, and the average nighttime accuracy rate reached 94%. The white road surface coverage feature of snow accumulation exhibited extremely high recognizability in both daytime and nighttime scenarios. The model effectively distinguished snow accumulation levels based on road surface coverage ratios, and its overall performance fully met the needs of snow accumulation classification and early warning in traffic scenarios.

[0048] The recognition performance of various fog categories fluctuates to some extent. The best performance is seen in extremely dense fog, with 100% accuracy in both daytime and nighttime scenes. For other categories, the accuracy rate for strong dense fog remains consistently above 90% day and night; dense fog has an accuracy rate of 86% during the day and 88% at night; heavy fog has an accuracy rate of 85% during the day and 93% at night; and light fog has an accuracy rate of 91% during the day, but a significantly lower accuracy rate of only 82% at night. The recognition performance of most fog categories is adaptable to the traffic warning needs of fog at different visibility levels.

[0049] The performance of different rainy weather subcategories varied significantly. Light rain achieved 95% accuracy during the day and 97% at night; heavy rain achieved 84% accuracy during the day and 91% at night; and moderate rain achieved 80% accuracy during the day and 91% at night. Moderate rain performed the weakest, with 75% accuracy during the day and 63% at night. The average accuracy for all rainy weather subcategories was 83.5% during the day and 85.5% at night. In moderate and heavy rain scenarios, the combined effect of rain occlusion and lighting interference increased the difficulty of feature extraction, which is a key area for future model optimization.

[0050] Overall, the model's three-level sub-weather classification achieves an average accuracy of 91.4% for daytime scenarios and 90.8% for nighttime scenarios, demonstrating excellent and refined weather recognition capabilities that can meet the tiered early warning needs of most traffic scenarios.

[0051] In some embodiments, reference Figure 3 The user selects a single image from the image recognition area 510 of the system interface using the single image selection control 511. The system reads the image and displays it in the image / video display area 401. Then, the user clicks the start image detection control 513. The system quickly calls the trained traffic scene refined weather recognition model based on dynamic attention to perform three-level weather recognition on the read single highway scene image. The system then displays the three-level recognition results, including the time period (daytime or nighttime), weather type (normal, rain, snow, fog, or sandstorm), weather severity, and the corresponding confidence level, in the recognition results area 402.

[0052] In some embodiments, reference Figure 3 In the system interface, the user clicks the batch image control 512 in the image recognition area 510 and selects a folder to import multiple image files. The system reads these multiple image files and displays them in the image / video display area 401. The display method can be thumbnails, lists, etc., and there are no restrictions here. Then, the user clicks the start image detection control 513, and the system quickly calls the trained traffic scene refined weather recognition model based on dynamic attention to automatically perform three-level weather recognition on each of the read batch images, and displays the output three-level recognition results, including time period, weather type, and weather severity, as well as the corresponding confidence level, in the recognition result area 402. Optionally, the weather recognition results of a batch of images can be displayed in the recognition results area 402 in the following ways: the weather recognition results of all images are displayed in a scrolling list in the recognition results area 402; or, the image / video display area 401 and the recognition results area 402 form a master-slave display area, and when a certain image of a batch of images is clicked or selected in the image / video display area 401, the weather recognition results of that image will be dynamically loaded and fixedly displayed in the recognition results area 402; or, the result entries of all images are arranged vertically in the recognition results area 402, and when the user clicks the "expand" arrow of a certain entry or directly clicks the row, a details area will be dynamically expanded below the entry, while other previously expanded entries will be automatically collapsed.

[0053] In some embodiments, reference Figure 3 The user clicks the video file selection control 521 in the video recognition area 520 of the system interface to import historical monitoring videos such as those from highways or urban roads. The system reads the uploaded historical monitoring video and displays it in the image / video display area 401. Then, the user clicks the start video detection control 523. Based on a trained traffic scene refined weather recognition model driven by dynamic attention, the system analyzes the uploaded historical monitoring video frame by frame, performs three-level weather recognition, and displays the output three-level recognition results (time period, weather type, weather severity) and corresponding confidence scores in the recognition results area 402. Optionally, during the three-level weather recognition process, the user can flexibly control the detection process using the "pause, continue, end" buttons in the image / video display area 401, performing weather recognition frame by frame and overlaying real-time results onto the video screen to achieve weather recognition of dynamic video streams.

[0054] In some embodiments, reference Figure 3After the user selects the monitoring video control 522 in the video recognition area 520 of the system interface, a dialog box automatically pops up. The system reads the username, password, and IP address of the target monitoring device entered by the user in the dialog box. After successful authentication and permission verification, the system connects to the remote target monitoring device and captures the monitoring screen in real time. Then, the user clicks the start video detection control 523. Based on a pre-trained traffic scene refined weather recognition model driven by dynamic attention, the system analyzes the real-time captured monitoring screen frame by frame, performs three-level weather recognition, and displays the three-level recognition results (time period, weather type, weather severity) and corresponding confidence scores in the recognition results area 402, achieving full-scene coverage from offline data processing to real-time monitoring and recognition. Meanwhile, the image / video display area 401 is equipped with "Pause," "Continue," and "End" buttons, allowing flexible control of the detection process to meet the dynamic weather perception needs of real-time monitoring scenarios.

[0055] In some embodiments, step S300 may include, but is not limited to, steps S311 to S315: Step S311: Using the second identification control component and the day-night classification module, the first data to be identified is classified by day and night, and the binary classification result is output. Step S312: When the binary classification result of the first data to be identified belongs to daytime data, the first data to be identified is input into the secondary main weather coarse classification network for main weather coarse classification operation, and the first intermediate processing feature and the five-class classification result are output. Step S313: Based on the five-class classification results, the first intermediate processing features are input into the three-level sub-weather fine classification network to perform sub-weather fine classification operations and obtain the sub-weather fine classification results. Step S314: Generate weather identification results based on the binary classification results, the pentathlon classification results, and the sub-weather classification results; Step S315: Generate an early warning alert based on the weather identification results.

[0056] In step S311 of some embodiments, after reading the first data to be identified, the system responds to the detection process triggered by the second identification control component by inputting the first data to be identified into the day-night classification module to perform day-night classification on the first data to be identified. Optionally, the day-night classification module includes a feature extraction sub-block and a classification sub-block. The feature extraction sub-block consists of four sets of convolution-activation-pooling units, which extract key features related to image illumination by gradually increasing the number of channels and reducing the size of the feature map. The classification sub-block uses a fully connected layer to complete feature dimension mapping and category output. In the day-night classification module, the input first data to be identified is first processed by a convolutional layer and the ReLU activation function to complete preliminary feature extraction and nonlinear enhancement. Then, max pooling is used to reduce the size of the feature map, and the above convolution-activation-pooling operation is repeated. Then, an adaptive average pooling layer is used to obtain compact features. After flattening, the compact features are input into a fully connected layer. The ReLU activation function and the Dropout mechanism are used to suppress model overfitting. Finally, the fully connected layer outputs the day-night binary classification result to realize the day-night state judgment.

[0057] For example, refer to Figure 4 After the first data to be identified is input into the day and night classification module of the first-level day and night classification network, the first data to be identified first passes through three "3×3 Conv + ReLU + MaxPool" modules. The 3×3 convolutional kernel accurately captures local features related to illumination (such as sky brightness and road surface reflection differences). The ReLU activation function introduces nonlinearity to enhance feature expression ability, while MaxPool downsampling expands the receptive field while reducing the amount of computation, gradually extracting illumination features from the bottom layer to the top layer. Then, the features are further refined through the fourth "3×3 Conv + ReLU" module. Next, AdaptiveAvgPool unifies feature maps of different sizes into a fixed size, Flatten unfolds the two-dimensional feature map into a one-dimensional vector, performs feature transformation through the Linear layer (output dimension 256), and then performs ReLU activation and Dropout regularization (to prevent overfitting). Finally, the Linear layer outputs the binary classification result (day / night).

[0058] In step S312 of some embodiments, when the binary classification result output by the day-night classification module indicates that the first data to be identified belongs to daytime data, the first data to be identified is input into the secondary main weather coarse classification network, and the first intermediate processing feature and the five-class classification result are output. For example, after the first data to be identified is input into the main weather coarse classification network, the third intermediate processing feature is extracted based on the EfficientNet architecture, and then processed by the grouped cross-channel spatial adaptive attention module to output the first intermediate processing feature. Finally, the main weather classifier outputs the five-class classification result of "normal, rainy, snowy, foggy, and sandstorm".

[0059] In step S313 of some embodiments, after the third-level sub-weather fine classification network receives the first intermediate processing features output by the second-level main weather coarse classification network, it further refines the weather level according to the five-class classification results through corresponding branches. The third-level sub-weather fine classification network, used for weather level refinement, includes five branches: normal weather confirmation branch, rainy weather fine classification branch, snowy weather fine classification branch, foggy weather fine classification branch, and sandstorm weather confirmation branch.

[0060] In step S314 of some embodiments, a weather identification result can be obtained based on the binary classification result, the pentad classification result, and the sub-weather sub-classification result based on the pentad classification result. Optionally, the binary classification result includes daytime or nighttime. The pentad classification result includes normal, rainy, snowy, foggy, or sandstorm. When the pentad classification result is normal weather, the sub-weather sub-classification result includes a first confidence level for normal weather; when the pentad classification result is rainy, the sub-weather sub-classification result includes light rain, moderate rain, heavy rain, or torrential rain; when the pentad classification result is snowy, the sub-weather sub-classification result includes light snow, moderate snow, heavy snow, or severe snow; when the pentad classification result is foggy, the sub-weather sub-classification result includes light fog, dense fog, heavy fog, very dense fog, or extremely dense fog; when the pentad classification result is sandstorm, the sub-weather sub-classification result includes a second confidence level for sandstorm.

[0061] In step S315 of some embodiments, a warning prompt is generated accordingly based on the weather recognition result. For example, if the weather recognition result is: the time period is daytime (confidence 100%), the weather type is rainy (confidence 99%), and the weather severity is heavy rain (confidence 92%), a warning prompt can be generated: the weather severity is heavy rain, the rainfall in 10 minutes is 1.6 to 3.9 mm, the short-term precipitation is large, the visibility is low, the road surface is prone to water film formation, fog lights, low beam headlights and side marker lights need to be turned on, the vehicle speed is less than 60 km / h, the distance between vehicles is greater than or equal to 300 meters, and the vehicle should avoid staying in waterlogged sections.

[0062] In some embodiments, step S300 may include, but is not limited to, steps S321 to S326: Step S321: Using the second identification control component and the day-night classification module, the first data to be identified is classified by day and night, and the binary classification result is output. Step S322: When the binary classification result of the first data to be identified belongs to nighttime data, the first data to be identified is enhanced by nighttime image enhancement through the nighttime image adaptive enhancement module to obtain the second data to be identified. Step S323: Input the second data to be identified into the two-level main weather coarse classification network to perform main weather coarse classification operation, and output the second intermediate processing features and the five-class classification results; Step S324: Based on the five-class classification results, the second intermediate processing features are input into the three-level sub-weather fine classification network to perform sub-weather fine classification operations and obtain the sub-weather fine classification results. Step S325: Generate weather identification results based on the binary classification results, the pentathlon classification results, and the sub-weather classification results; Step S326: Generate an early warning notification based on the weather recognition results.

[0063] In some embodiments, step S321 is described with reference to the embodiment of step S311 described above, and will not be repeated here.

[0064] In step S322 of some embodiments, when the binary classification result output by the day-night classification module indicates that the first data to be identified belongs to nighttime data, the first data to be identified is input into the nighttime image adaptive enhancement module. To address issues such as uneven illumination, prominent noise, and blurred details in nighttime images, the nighttime image adaptive enhancement module adopts a step-by-step approach of "bilateral filtering for noise reduction - adaptive gamma correction - contrast-limited adaptive histogram equalization for local enhancement" to enhance the nighttime image. It is also compatible with both color and grayscale image inputs to ensure that the enhanced image retains key weather features.

[0065] In some embodiments, step S322 may include, but is not limited to, steps S3221 to S3225: Step S3221: Convert the data format of the first data to be identified and normalize it to a preset range to obtain the first intermediate processing data; Step S3222: When the first intermediate processing data belongs to a color image, the first intermediate processing data is converted into YCrCb space to obtain the second intermediate processing data, and the brightness channel of the second intermediate processing data is denoised by bilateral filtering to obtain a denoised image. Step S3223: When the first intermediate processing data is a grayscale image, the single channel of the first intermediate processing data is denoised by bilateral filtering to obtain a denoised image. Step S3224: Perform adaptive gamma correction and contrast-limited adaptive histogram equalization on the denoised image to obtain the enhanced image. Step S3225: Perform inverse format conversion and normalization on the enhanced image to obtain the second data to be identified.

[0066] In step S3221 of some embodiments, the input first data to be identified is converted into a data format. Optionally, the first data to be identified is converted into a NumPy array. The first data to be identified after data format conversion is then normalized to the range [0, 255] to obtain the first intermediate processing data. In step S3222 of some embodiments, when the first intermediate processing data is a color image, it needs to be further converted to BGR format to adapt to the OpenCV processing specification. Then, an adaptive denoising operation is performed: the first intermediate processing data in BGR format is first converted to YCrCb space to obtain the second intermediate processing data; denoising is performed only on the luminance channel (Y channel) of the second intermediate processing data using bilateral filtering (kernel size 9, color standard deviation 75, spatial standard deviation 75) to avoid color distortion during the denoising process, resulting in a denoised image.

[0067] In step S3223 of some embodiments, when the first intermediate processing data is a grayscale image, the first intermediate processing data is directly subjected to bilateral filtering (kernel size 9, color standard deviation 75, spatial standard deviation 75) for denoising processing to obtain a denoised image.

[0068] In step S3224 of some embodiments, after the denoising process is completed, an adaptive gamma correction operation is performed on the denoised image: the gamma value is dynamically adjusted by calculating the gray-scale mean of the denoised image, wherein a gamma value of 0.5 is used for dark areas to improve brightness, and a gamma value of 1.5 is used for bright areas to suppress overly bright areas. Then, a contrast-limited adaptive histogram equalization operation is used to improve the local contrast of the image, resulting in an enhanced image.

[0069] In step S3225 of some embodiments, the enhanced image undergoes inverse format conversion and normalization to output a second data to be identified that can be adapted to the subsequent classification network.

[0070] In step S323 of some embodiments, the second data to be identified is input into a secondary main weather coarse classification network, which outputs a second intermediate processing feature and a five-class classification result. For example, after the second data to be identified is input into the secondary main weather coarse classification network, a third intermediate processing feature is extracted based on the EfficientNet architecture, and then processed by a grouped cross-channel spatial adaptive attention module to output the second intermediate processing feature. Finally, the main weather classifier outputs a five-class classification result of "normal, rainy, snowy, foggy, and sandstorm".

[0071] In step S324 of some embodiments, after the third-level sub-weather fine classification network receives the second intermediate processing features output by the second-level main weather coarse classification network, it further refines the weather level according to the five-class classification results through corresponding branches. The third-level sub-weather fine classification network includes five branches: normal weather confirmation branch, rainy weather fine classification branch, snowy weather fine classification branch, foggy weather fine classification branch, and sandstorm weather confirmation branch.

[0072] In some embodiments, step S325 refers to the embodiment of step S314 described above, and will not be repeated here.

[0073] In some embodiments, step S326 is described with reference to the embodiment of step S315 described above, and will not be repeated here.

[0074] In some embodiments, EfficientNet is selected as the backbone network in the secondary main weather coarse classification network. This network relies on a composite scaling strategy that coordinates depth, width, and resolution scaling, achieving excellent image feature representation capabilities while maintaining computational efficiency. In this embodiment, the original classification head structure of EfficientNet is removed, retaining only its feature extraction part. This part outputs 1280 channels, which can fully extract rich semantic features related to weather in the image. Furthermore, in the secondary main weather coarse classification network, to address the issues of channel redundancy and weak spatial correlation in the output features of the backbone network, this embodiment also designs a grouped cross-channel spatial adaptive attention module. This module enhances the discrimination ability of key channels and spatial features through four stages: feature enhancement, feature grouping, cross-group attention fusion, and dual-path spatial attention enhancement.

[0075] In some optional embodiments, the target data to be identified is defined as either first data to be identified or second data to be identified, and the target features are defined as either first intermediate processing features or second intermediate processing features. Specifically, when the target data to be identified is the first data to be identified, the target features are the first intermediate processing features; when the target data to be identified is the second data to be identified, the target features are the second intermediate processing features. The grouped cross-channel spatial adaptive attention module includes a first residual block, a first intermediate processing block, a cross-group attention fusion block, a dual-path spatial attention enhancement block, a channel-spatial feature fusion block, a second intermediate processing block, and a second residual block. Optionally, a main weather coarse classification operation is performed on the target data to be identified to output the target features, including the following steps: T1. The EfficientNet feature extraction module performs feature extraction on the target data to be identified, obtaining the third intermediate processing feature. For example, the target data to be identified is input into the EfficientNet backbone network to extract rich semantic features related to weather, and the third intermediate processing feature with 1280 channels is output.

[0076] T2. Using the first residual block, the third intermediate processing feature is enhanced, compressed, and subjected to nonlinear transformation to obtain the fourth intermediate processing feature. For example, the residual block of the grouped cross-channel spatial adaptive attention module is used to enhance the 1280-channel backbone output feature, improving the representation performance of high-dimensional features and effectively avoiding feature degradation. Subsequently, a 1×1 convolutional dimensionality reduction layer compresses the number of feature channels to 128. Finally, batch normalization (BatchNorm) and the ReLU activation function are used to introduce a nonlinear transformation to output the fourth intermediate processing feature.

[0077] T3. Through the first intermediate processing block, the fourth intermediate processing feature is processed by channel grouping to obtain multiple groups of fifth intermediate processing features. For example, the 128-channel fourth intermediate processing feature is split into groups of 8 to enhance the independence of channel features, realize independent learning of different channel features, suppress mutual interference between channels, and improve channel specificity.

[0078] T4. The fifth intermediate processing feature is subjected to cross-group attention interaction through a cross-group attention fusion block to obtain the sixth intermediate processing feature. For example, utilizing the cross-group attention fusion block of the grouped cross-channel spatial adaptive attention module, firstly, global features of the groups are extracted through adaptive average pooling, then cross-group attention weights are generated through an MLP layer and a Softmax function, and finally, group feature fusion is achieved through matrix multiplication. After group feature fusion, the number of feature channels is adjusted through a 1×1 convolutional layer, and then residual addition is performed with the original group features (i.e., the fifth intermediate processing feature) to achieve residual fusion of cross-group features, effectively avoiding feature information loss, and obtaining the sixth intermediate processing feature. The cross-group attention fusion block achieves feature interaction and deep fusion between different groups.

[0079] T5. Through the dual-path spatial attention enhancement block, the global average feature and local peak feature of the sixth intermediate processing feature are extracted via the average pooling path and the max pooling path, respectively. For example, in the dual-path spatial attention enhancement block of the grouped cross-channel spatial adaptive attention module, a parallel design of average pooling and max pooling is adopted to capture the global average feature and local peak feature of the sixth intermediate processing feature, respectively, and the feature enhancement of key regions is achieved by generating spatial attention weights.

[0080] Optionally, for the average pooling path, firstly, adaptive average pooling in the height and width directions is performed on the adjusted grouped features (i.e., the sixth intermediate processing features) to obtain height and width feature maps respectively; the width feature map is transposed and concatenated with the height feature map, and attention weights in the height and width directions are generated by 1×1 convolution and splitting operations; the attention weights in the height and width directions are processed by the Sigmoid activation function and then multiplied element-wise with the adjusted grouped features; finally, the feature distribution is stabilized by the GroupNorm operation to improve feature consistency and output the global average feature.

[0081] Optionally, for the max pooling path, a network structure identical to the average pooling path is adopted, only replacing adaptive average pooling with adaptive max pooling to accurately capture local peak feature information. First, adaptive max pooling is performed on the adjusted grouped features in both the height and width directions to obtain height and width feature maps. The width feature map is transposed and concatenated with the height feature map, and then 1×1 convolution and splitting operations are performed to generate attention weights in the height and width directions. The attention weights in the height and width directions are processed by the Sigmoid activation function and then multiplied element-wise with the adjusted grouped features. Finally, group normalization (GroupNorm) is used to stabilize the feature distribution, improve feature consistency, and output local peak features.

[0082] T6. Through the channel-spatial feature fusion block, the global average features and local peak features are fused to obtain the channel-spatial joint attention weights. For example, the channel-spatial feature fusion block of the grouped cross-channel spatial adaptive attention module performs deep fusion on the spatial enhancement features (i.e., global average features and local peak features) of the dual-path output of average pooling and max pooling to generate the channel-spatial joint attention weights.

[0083] Optionally, one input feature (local peak feature) is first flattened into a two-dimensional feature tensor through a reshape operation; simultaneously, global peak features are extracted through adaptive max pooling, and after adjusting the dimensions through reshape and permute operations, the first channel attention weights are generated by the Softmax function. Similarly, the other feature (global average feature) is flattened into a two-dimensional feature tensor through a reshape operation; simultaneously, global average features are extracted through adaptive average pooling, generating the corresponding second channel attention weights. Subsequently, the second channel attention weights generated on the average pooling path and the two-dimensional feature tensor generated on the max pooling path are fused through matrix multiplication to obtain the first fusion result; simultaneously, the two-dimensional feature tensor generated on the average pooling path and the first channel attention weights generated on the max pooling path are fused through matrix multiplication to obtain the second fusion result. Finally, the two fusion results are added together, the spatial dimension is restored through a reshape operation, and the channel-space joint attention weights are generated through the Sigmoid activation function.

[0084] T7. Using the channel-space feature fusion block, perform element-wise multiplication of the channel-space joint attention weights with the sixth intermediate processing feature to obtain the seventh intermediate processing feature. For example, perform element-wise multiplication of the channel-space joint attention weights with the sixth intermediate processing feature, and then restore the original input dimension through a reshape operation to finally obtain the core output feature tensor of the module, i.e., the seventh intermediate processing feature.

[0085] T8. The seventh intermediate processing feature and the fourth intermediate processing feature are residually connected through the second intermediate processing block to obtain the eighth intermediate processing feature. Then, the eighth intermediate processing feature is dimension-enhanced through the second residual block to obtain the target feature. For example, to further refine the feature representation, a convolutional layer and a ReLU activation function are applied after the channel-spatial feature fusion block output to further optimize the seventh intermediate processing feature. Subsequently, the optimized seventh intermediate processing feature is residually connected with the dimension-reduced feature (i.e., the fourth intermediate processing feature), thus preserving the basic information in the previous features while effectively mitigating the overfitting problem that easily occurs in deep attention modules and improving the generalization ability of the features. Finally, through a dimension-enhancing residual block, the number of feature channels is increased from 128 to 256, outputting the target feature. This target feature serves as the input to the main weather classifier of the second-level main weather coarse classification network and the input feature of the third-level sub-weather fine classification network.

[0086] In some embodiments, the master weather classifier is responsible for mapping the 256-dimensional target features to predicted scores for five master weather categories, such as... Figure 4 As shown, the main weather classifier structure consists of an adaptive average pooling layer, a Flatten layer, two fully connected layers, a ReLU activation function, and a Dropout layer. After the target features are input into the main weather classifier, the adaptive average pooling layer compresses the 256×7×7 feature tensor to 256×1×1 to eliminate spatial dimensionality interference; the Flatten layer converts it into a one-dimensional vector; the first fully connected layer maps it to 128 dimensions and introduces non-linearity through the ReLU activation function; the Dropout layer suppresses overfitting with a 50% dropout probability; and the second fully connected layer outputs a five-dimensional main weather prediction score. Finally, the softmax function selects the category index with the highest prediction score to obtain a coarse classification result of five main weather categories, providing category guidance for subsequent three-level sub-weather intensity subdivision tasks.

[0087] In some embodiments, in the three-level sub-weather fine classification network, the 256-channel features output by the two-level main weather coarse classification network are first compressed to 128 channels using a convolutional projection layer to match the input requirements of the weather-aware dynamic attention module. Then, a sub-weather classifier consisting of an adaptive average pooling layer, a Flatten layer, two fully connected layers, and a ReLU activation function is used to finally output the intensity level of the corresponding sub-weather condition. The weather-aware dynamic attention module includes global and local branches for feature extraction and dynamic fusion processing.

[0088] In some embodiments, the target features include a first intermediate processing feature or a second intermediate processing feature. Based on the five-class classification result, the target features are input into the three-level sub-weather fine classification network for sub-weather fine classification operation to obtain the sub-weather fine classification result, including the following steps: When the five-class classification result indicates that the target feature belongs to normal weather data, the target feature is input into the normal weather confirmation branch to obtain the first confidence level that the target feature belongs to normal weather data. When the five-class classification result indicates that the target feature belongs to rainy weather data, the target feature is input into the rainy weather sub-classification branch, and feature extraction and dynamic fusion processing are performed through global and local dual branches to obtain the rainy weather sub-classification result. When the five-class classification result indicates that the target feature belongs to snowy weather data, the target feature is input into the snowy weather sub-classification branch, and feature extraction and dynamic fusion processing are performed through global and local dual branches to obtain the snowy weather sub-classification result. When the five-class classification result indicates that the target feature belongs to foggy weather data, the target feature is input into the foggy weather sub-classification branch, and feature extraction and dynamic fusion processing are performed through global and local dual branches to obtain the foggy weather sub-classification result. When the five-class classification result indicates that the target feature belongs to dust storm data, the target feature is input into the dust storm weather confirmation branch to obtain the second confidence level that the target feature belongs to dust storm data.

[0089] In some embodiments, the weather-aware dynamic attention module adapts to the discrimination requirements of different weather intensities through global and local dual-branch feature extraction and dynamic fusion. The global branch reuses the core logic of the grouped cross-channel spatial adaptive attention module to strengthen the correlation of global features; the local branch aims to capture fine-grained local details of weather and includes a four-way gated fusion block and a cross-spatial learning block. The input of the weather-aware dynamic attention module is 128-channel projection features, which are first split into 8 groups: the global branch process is consistent with the grouped cross-channel spatial adaptive attention module, outputting globally enhanced features; the local branch first extracts initial local features through 3×3 convolution and ReLU activation, and then filters and enhances effective local features at different scales through the four-way gated fusion block to adapt to the differences in weather intensity details. The four-way gated fusion block contains four parallel convolutional paths with consistent kernel sizes to maintain spatial dimension uniformity. Differentiated activation function configuration: the first, second, and fourth paths use Sigmoid activation to generate feature weights, the third path uses Tanh activation to enhance nonlinear expression, and finally multi-path fusion is achieved through element-wise multiplication and addition. The cross-spatial learning block aims to enhance the spatial correlation of local features to adapt to differences in the spatial distribution of weather intensity. This module first performs adaptive average pooling on the gated fusion features to aggregate global spatial information and obtain a compressed feature tensor. Then, it generates spatial attention weights through a series of operations: convolution + ReLU + convolution + Sigmoid, highlighting key spatial region features. After multiplying the attention weights with the original gated fusion features, convolution and reshape operations restore the original feature dimensions, ultimately reshaping them into 128-channel local enhancement features through convolution. Finally, global and local features are fused according to preset weights, and the output is adjusted through convolution.

[0090] This invention also provides a traffic scene refined weather recognition system based on dynamic attention, which can implement the above-mentioned traffic scene refined weather recognition method based on dynamic attention. The system includes: The visualization module is used to display the user interface, which includes an identification control area and an analysis feedback area; The data transmission module is used to trigger the transmission process by identifying the first identification control component in the identification control area, acquire the first data to be identified, and display the first data to be identified by the analysis feedback area; The data detection module is used to trigger the detection process by identifying the second identification control component in the identification control area. It uses a traffic scene refined weather identification model based on dynamic attention to perform three-level weather identification operations on the first data to be identified, generate weather identification results and warning prompts, and display the weather identification results and warning prompts through the analysis feedback area. The three-level weather identification operation includes day and night classification, main weather coarse classification, and sub-weather fine classification.

[0091] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0092] This invention also provides an electronic device, which includes a processor and a memory. The memory stores a computer program, and the processor executes the computer program to implement the above-described method. This electronic device can be any smart terminal, including a tablet computer, an in-vehicle computer, or similar device.

[0093] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0094] refer to Figure 7 , Figure 7 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 1001 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention. The memory 1002 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1002 and is called and executed by the processor 1001. Input / output interface 1003 is used to implement information input and output; The communication interface 1004 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1005 transmits information between various components of the device (e.g., processor 1001, memory 1002, input / output interface 1003, and communication interface 1004); The processor 1001, memory 1002, input / output interface 1003 and communication interface 1004 are connected to each other within the device via bus 1005.

[0095] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0096] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0097] This invention also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions to cause the computer device to perform the aforementioned method.

[0098] In summary, the refined weather recognition method and system for traffic scenes based on dynamic attention-driven approaches of this invention have the following advantages: 1. The present invention is based on a dynamic attention-driven traffic scene refined weather recognition model. It optimizes the input image quality through the "day and night classification - night enhancement" process to adapt to the differences in day and night lighting. It reduces the complexity of the fine classification task and improves the recognition accuracy through the hierarchical decision-making mechanism of "main weather coarse classification - sub-weather fine classification". The design of each module is closely related to the visual characteristics of weather phenomena, which enhances the interpretability of the model.

[0099] 2. The nighttime image adaptive enhancement module of this invention adopts a serial processing strategy of "bilateral filtering denoising - adaptive gamma correction - contrast-limited adaptive histogram equalization local enhancement", which effectively improves the quality of low-light nighttime images while balancing noise suppression and detail preservation.

[0100] 3. The grouped cross-channel spatial adaptive attention module of this invention reduces information redundancy and computational complexity through channel grouping strategy, achieves feature complementarity through cross-group attention interaction, and integrates average-max double pooling path to efficiently mine global smooth features and local salient spatial features.

[0101] 4. The weather perception dynamic attention module of this invention adopts a global-local dual-branch architecture, which can dynamically adjust feature weights according to weather type. Its local branch embeds a four-way convolution fine gating and cross-spatial feature enhancement mechanism, which can accurately focus on the discriminative features of specific weather.

[0102] 5. The highway weather recognition system developed in this invention realizes the visualization and implementation of a refined weather recognition model for traffic scenarios based on dynamic attention-driven approaches. It supports multi-scenario detection functions and provides an intuitive and convenient weather monitoring and early warning platform for traffic management, which has high engineering application value.

[0103] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and sub-operations described as part of a larger operation are executed independently.

[0104] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the described functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.

[0105] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0106] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0107] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory, read-only memory, erasable programmable read-only memory (EPROM), flash memory, fiber optic devices, and compact disc read-only memory (CDROM). Additionally, computer-readable media can even be paper or other suitable media on which the program can be printed. For example, the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0108] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0109] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0110] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

[0111] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.

Claims

1. A method for refined weather recognition in traffic scenes based on dynamic attention-driven approaches, characterized in that, Includes the following steps: The user interface includes an identification control area and an analysis feedback area. The transmission process is triggered by the first identification control component in the identification control area to acquire the first data to be identified, and the first data to be identified is displayed in the analysis feedback area. The detection process is triggered by the second identification control component in the identification control area. Using a traffic scene refined weather identification model based on dynamic attention, a three-level weather identification operation is performed on the first data to be identified to generate weather identification results and warning prompts. The weather identification results and warning prompts are then displayed in the analysis feedback area. The three-level weather identification operation includes day and night classification, main weather coarse classification, and sub-weather fine classification.

2. The method according to claim 1, characterized in that, The traffic scene refined weather recognition model based on dynamic attention includes a first-level day / night classification network, a second-level main weather coarse classification network, and a third-level sub-weather fine classification network. The first-level day / night classification network includes a day / night classification module and a nighttime image adaptive enhancement module. The second-level main weather coarse classification network includes an EfficientNet feature extraction module and a grouped cross-channel spatial adaptive attention module. The third-level sub-weather fine classification network includes a normal weather confirmation branch, a rainy weather fine classification branch, a snowy weather fine classification branch, a foggy weather fine classification branch, and a sandstorm weather confirmation branch. The rainy day sub-classification branch, the snowy day sub-classification branch, and the foggy day sub-classification branch all include a weather perception dynamic attention module; the weather perception dynamic attention module includes global and local dual branches.

3. The method according to claim 1, characterized in that, The step of triggering a transmission process and acquiring the first data to be identified through the first identification control component in the identification control area includes the following steps: By selecting a single image through the first transmission sub-component in the first recognition control component, the first data to be recognized is obtained; Alternatively, the first data to be identified can be obtained by selecting a batch of images through the second transmission sub-component in the first identification control component; Alternatively, the first data to be identified can be obtained by selecting a video file through the third transmission sub-component in the first identification control component; Alternatively, the first data to be identified can be obtained by selecting monitoring data through the fourth transmission sub-component in the first identification control component.

4. The method according to claim 3, characterized in that, The step of selecting monitoring data and obtaining the first data to be identified through the fourth transmission sub-component in the first identification control component includes the following steps: In response to the command to select monitoring data, read the input monitoring device address, username, and password; Based on the monitoring device address, the username, and the password, the target monitoring device is accessed, and the monitoring data is dynamically acquired through the target monitoring device to obtain the first data to be identified.

5. The method according to claim 2, characterized in that, The detection process is triggered by the second identification control component in the identification control area. A refined weather identification model based on dynamic attention-driven traffic scenes is used to perform a three-level weather identification operation on the first data to be identified, generating weather identification results and warning prompts. This includes the following steps: The second identification control component uses the day-night classification module to perform day-night classification on the first data to be identified and outputs a binary classification result. When the binary classification result of the first data to be identified belongs to daytime data, the first data to be identified is input into the secondary main weather coarse classification network for main weather coarse classification operation, and the first intermediate processing feature and the five-class classification result are output. Based on the five-class classification results, the first intermediate processing feature is input into the three-level sub-weather fine classification network to perform sub-weather fine classification operation, and the sub-weather fine classification results are obtained. The weather identification result is generated based on the binary classification result, the five-class classification result, and the sub-weather classification result. The warning message is generated based on the weather recognition results.

6. The method according to claim 2, characterized in that, The detection process is triggered by the second identification control component in the identification control area. A refined weather identification model based on dynamic attention-driven traffic scenes is used to perform a three-level weather identification operation on the first data to be identified, generating weather identification results and warning prompts. This includes the following steps: The second identification control component uses the day-night classification module to perform day-night classification on the first data to be identified and outputs a binary classification result. When the binary classification result of the first data to be identified belongs to nighttime data, the nighttime image adaptive enhancement module performs nighttime image enhancement operation on the first data to be identified to obtain the second data to be identified. The second data to be identified is input into the secondary main weather coarse classification network to perform main weather coarse classification operation, and the second intermediate processing feature and the five-class classification result are output. Based on the five-class classification results, the second intermediate processing feature is input into the three-level sub-weather fine classification network to perform sub-weather fine classification operation, and the sub-weather fine classification results are obtained. The weather identification result is generated based on the binary classification result, the five-class classification result, and the sub-weather classification result. The warning message is generated based on the weather recognition results.

7. The method according to claim 6, characterized in that, When the binary classification result of the first data to be identified belongs to nighttime data, the nighttime image adaptive enhancement module performs nighttime image enhancement on the first data to be identified to obtain the second data to be identified, including the following steps: The first data to be identified is converted in data format and normalized to a preset range to obtain the first intermediate processed data; When the first intermediate processing data is a color image, the first intermediate processing data is converted into YCrCb space to obtain the second intermediate processing data, and the brightness channel of the second intermediate processing data is denoised by bilateral filtering to obtain a denoised image. When the first intermediate processing data is a grayscale image, a single channel of the first intermediate processing data is denoised by bilateral filtering to obtain a denoised image. The denoised image is subjected to adaptive gamma correction and contrast-limited adaptive histogram equalization to obtain an enhanced image. The enhanced image is subjected to inverse format conversion and normalization to obtain the second data to be identified.

8. The method according to claim 5 or 6, characterized in that, The target data to be identified includes either first data to be identified or second data to be identified, and the target features include either first intermediate processing features or second intermediate processing features. The target data to be identified is input into the secondary main weather coarse classification network for main weather coarse classification, and the target features are output, including the following steps: The EfficientNet feature extraction module performs feature extraction on the target data to be identified to obtain the third intermediate processing feature. The third intermediate processing feature is enhanced, compressed, and subjected to nonlinear transformation through the first residual block to obtain the fourth intermediate processing feature. The fourth intermediate processing feature is processed by channel grouping through the first intermediate processing block to obtain multiple groups of fifth intermediate processing features; By performing cross-group attention interaction on the fifth intermediate processing feature through a cross-group attention fusion block, a sixth intermediate processing feature is obtained; The global average feature and local peak feature of the sixth intermediate processing feature are extracted through the dual-path spatial attention enhancement block, the average pooling path and the max pooling path, respectively. The global average feature and the local peak feature are fused using a channel-space feature fusion block to obtain the channel-space joint attention weight. The channel-space feature fusion block is used to perform element-wise multiplication of the channel-space joint attention weight with the sixth intermediate processing feature to obtain the seventh intermediate processing feature. The seventh intermediate processing feature and the fourth intermediate processing feature are residually connected through the second intermediate processing block to obtain the eighth intermediate processing feature; The target feature is obtained by performing dimensionality enhancement on the eighth intermediate processing feature through the second residual block; Wherein, when the target data to be identified is the first data to be identified, the target feature is the first intermediate processing feature; when the target data to be identified is the second data to be identified, the target feature is the second intermediate processing feature; the grouped cross-channel spatial adaptive attention module includes the first residual block, the first intermediate processing block, the cross-group attention fusion block, the dual-path spatial attention enhancement block, the channel-spatial feature fusion block, the second intermediate processing block, and the second residual block.

9. The method according to claim 5 or 6, characterized in that, The target features include either a first intermediate processing feature or a second intermediate processing feature. Based on the five-class classification results, the target features are input into the three-level sub-weather fine classification network for sub-weather fine classification operations to obtain the sub-weather fine classification results, including the following steps: When the five-class classification result indicates that the target feature belongs to normal weather data, the target feature is input into the normal weather confirmation branch to obtain the first confidence level that the target feature belongs to normal weather data; When the five-class classification result indicates that the target feature belongs to rainy day data, the target feature is input into the rainy day fine classification branch. Feature extraction and dynamic fusion processing are performed through the global and local dual branches to obtain the rainy day fine classification result. When the five-class classification result indicates that the target feature belongs to the snowy weather data, the target feature is input into the snowy weather sub-classification branch. Feature extraction and dynamic fusion processing are performed through the global and local dual branches to obtain the snowy weather sub-classification result. When the five-class classification result indicates that the target feature belongs to foggy weather data, the target feature is input into the foggy weather sub-classification branch. Feature extraction and dynamic fusion processing are performed through the global and local dual branches to obtain the foggy weather sub-classification result. When the five-class classification result indicates that the target feature belongs to the dust storm data, the target feature is input into the dust storm weather confirmation branch to obtain the second confidence level that the target feature belongs to the dust storm data.

10. A refined weather recognition system for traffic scenes based on dynamic attention-driven methods, characterized in that, include: A visualization module is used to display the user interface, which includes an identification control area and an analysis feedback area; The data transmission module is used to trigger a transmission process through the first identification control component in the identification control area, acquire the first data to be identified, and display the first data to be identified through the analysis feedback area. The data detection module is used to trigger the detection process through the second identification control component in the identification control area, and to perform a three-level weather identification operation on the first data to be identified using a traffic scene refined weather identification model based on dynamic attention, generate weather identification results and warning prompts, and display the weather identification results and warning prompts through the analysis feedback area. The three-level weather identification operation includes day and night classification, main weather coarse classification, and sub-weather fine classification.