A highway traffic condition monitoring system and method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-26
- Publication Date
- 2026-08-14
AI Technical Summary
人工巡逻耗费大量人力,且存在巡视间隙,难以及时捕捉瞬息万变的路况;固定式监测设备功能单一,往往只能监测特定物理量,对复杂多变的危险场景应对乏力,数据反馈延迟更是让管理措施滞后一步
[0042]本发明涉及一种高速公路路况监测系统与方法,与现有技术相比,本发明通过ESP32强大的运算处理能力和低功耗特性,结合图像识别模块超声波、压力以及温湿度等多种传感器,能对复杂路况场景进行精准分析,及时捕捉交通事故等异常情况,使路况监测更加全面细致。
Smart Images

Figure CN122575108A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of highway traffic condition monitoring technology, and in particular to a highway traffic condition monitoring system and method. Background Technology
[0002] Beneath the surface of high-speed traffic lurks a danger that cannot be ignored. Overgrown tree branches encroaching on lanes not only obstruct drivers' vision but also risk breaking and falling in strong winds and heavy rain, instantly becoming road hazards. Bent or deformed guardrails instantly fail as a sturdy barrier, potentially contributing to secondary accidents. Traffic accidents are a nightmare on highways; rear-end collisions and other accidents on highways can easily cause serious injuries and fatalities. Violent collisions and scattered debris can instantly block vital traffic arteries, and delays in rescue operations can endanger lives. These safety hazards are ever-present, constantly threatening the safe and smooth flow of traffic on highways.
[0003] Traditional monitoring methods are inadequate for highway safety management. Manual patrols are labor-intensive and have gaps between patrols, making it difficult to capture rapidly changing road conditions in a timely manner. Fixed monitoring equipment has limited functionality, often only monitoring specific physical quantities, and is ineffective in dealing with complex and ever-changing dangerous scenarios. Furthermore, data feedback delays further hinder management measures. Against this backdrop, there is an urgent need for a device that can be used for highway road condition monitoring to safeguard highway safety. Summary of the Invention
[0004] To address the aforementioned problems, the purpose of this invention is to provide a highway traffic condition monitoring system and method.
[0005] A highway traffic condition monitoring system, comprising:
[0006] Ultrasonic sensors are used to detect whether tree branches are growing into the guardrails of highways;
[0007] Pressure sensors are installed on highway guardrails to detect whether the guardrails are bent.
[0008] The image recognition module is used to detect whether a traffic accident has occurred on the target road section;
[0009] The ESP32 microcontroller is connected to a temperature and humidity sensor, an ultrasonic sensor, and a pressure sensor. It issues an alarm when tree branches grow into the highway guardrail, when the highway guardrail is bent, or when a traffic accident occurs on the target road section.
[0010] Preferably, it also includes: a traffic light module and an OLED screen; the ESP32 microcontroller communicates with the traffic light module and the OLED screen respectively via a LoRa remote communication module; when the road conditions are normal, the ESP32 microcontroller controls the traffic light module to light up the green light, and the OLED screen displays "Road conditions are normal"; when a tree branch grows into the highway guardrail, the ESP32 microcontroller controls the yellow light of the traffic light module to flash, and the OLED screen displays "Tree branch is too long"; when the highway guardrail is bent, the ESP32 microcontroller controls the yellow light of the traffic light module to flash, and the OLED screen displays "Guardrail is bent"; when a traffic accident occurs on the target road section, the ESP32 microcontroller controls the 4G alarm module to send a distress signal to the rescue personnel's mobile phone via a relay, and controls the red light of the traffic light module to flash, and the OLED screen displays "Traffic accident".
[0011] Preferably, it also includes: a temperature and humidity sensor, connected to an ESP32 microcontroller, for collecting temperature and humidity information and displaying it on an OLED screen.
[0012] The present invention also provides a method for monitoring highway traffic conditions, comprising:
[0013] Step 1: Collect images of different types of traffic accidents;
[0014] Step 2: Annotate images of different types of traffic accidents to form a training dataset;
[0015] Step 3: Perform data augmentation on the images in the training dataset to obtain the augmented dataset;
[0016] Step 4: Input the enhanced dataset into the YOLO network for training to obtain the traffic accident recognition model;
[0017] Step 5: Use the traffic accident identification model to monitor whether a traffic accident has occurred on the target road segment.
[0018] Preferably, step 3: performing data augmentation on the images in the training dataset to obtain the augmented dataset includes:
[0019] Step 3.1: Select images taken at night from the training dataset;
[0020] Step 3.2: Perform illumination enhancement on the nighttime images to obtain the illumination-enhanced images;
[0021] Step 3.3: Use a filter to smooth the image taken during the day to obtain a smoothed image, and calculate the edge image corresponding to the smoothed image;
[0022] Step 3.4: Use the edge image to enhance the image taken during the day to obtain an edge-enhanced image.
[0023] Preferably, in step 3.2, the illuminance component of the nighttime image is extracted, an adaptive gamma coefficient is calculated based on the illuminance component, and the adaptive gamma coefficient is used to perform gamma enhancement on the illuminance component to obtain an image with enhanced illumination; wherein, the formula for calculating the adaptive gamma coefficient is:
[0024]
[0025] in, Represents the adaptive gamma coefficients. Represents the original illuminance component. This represents the mean of the illuminance components.
[0026] Preferably, step 3.3: using a filter to smooth the image taken during the day to obtain a smoothed image, and calculating the edge image corresponding to the smoothed image, including:
[0027] Step 3.3.1: Use a Gaussian filter to convolve the image taken during the day to obtain a smoothed image;
[0028] Step 3.3.2: Calculate the gradient magnitude and gradient direction of the smoothed image, and select pixels whose gradient magnitude and gradient direction are within a set range as edge images; the calculation process for the gradient magnitude and gradient direction of the smoothed image is as follows:
[0029]
[0030] in, Indicates a Gaussian filter. Images taken during the day, This represents the smoothed image. Represents the Gaussian filter parameters. Represents the horizontal coordinates of a pixel. Represents the coordinates in the vertical direction. This represents the first-order discrete difference of the smoothed image in the horizontal direction. This represents the first-order discrete difference in the vertical direction of the smoothed image. This represents the gradient magnitude of the smoothed image. Indicates the gradient direction.
[0031] Preferably, step 3.4: using the edge image to enhance the image taken during the day to obtain an edge-enhanced image, including:
[0032] An enhancement coefficient is calculated based on the maximum value of pixels on the edge image. This enhancement coefficient is then used to enhance the image taken during the day to obtain an edge-enhanced image. The edge enhancement process is as follows:
[0033]
[0034] in, Indicates the enhancement coefficient. Represents the edge image. This represents the maximum value of a pixel on the edge of the image. This represents the image after edge enhancement. Images taken during the day.
[0035] Preferably, in step 4, the loss function of the YOLO network is:
[0036]
[0037]
[0038]
[0039]
[0040] in,( , The center point coordinates of the actual bounding box The actual bounding box width, The actual bounding box height, ( ( ) represents the coordinates of the center point of the predicted bounding box. Predict bounding box width, To predict the bounding box height, For true confidence level, To predict confidence levels, For real category labels, To predict class probabilities, To pinpoint the loss, For confidence loss, For classifying losses, This is the total loss function.
[0041] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0042] This invention relates to a highway traffic condition monitoring system and method. Compared with the prior art, this invention utilizes the powerful computing capabilities and low power consumption of the ESP32, combined with an image recognition module and multiple sensors such as ultrasonic, pressure, temperature, and humidity sensors, to accurately analyze complex road conditions and promptly capture abnormal situations such as traffic accidents, making traffic condition monitoring more comprehensive and detailed.
[0043] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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.
[0045] Figure 1 This is a schematic diagram of the structure of a highway traffic condition monitoring system provided by the present invention;
[0046] Figure 2 A circuit diagram of a highway traffic condition monitoring system provided by the present invention;
[0047] Figure 3 The flowchart of the highway traffic condition monitoring method provided by the present invention. Detailed Implementation
[0048] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0049] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0050] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0051] In the daily operation of highways, dangerous situations such as excessively long tree branches encroaching on the road, bent and deformed guardrails, and traffic accidents frequently occur, posing a serious threat to road safety and smooth traffic.
[0052] When tree branches grow uncontrollably towards the inside of the road, their leaves often encroach on the driver's field of vision, obscuring crucial road condition information. While driving, a driver with impaired visibility struggles to detect sudden situations ahead, significantly reducing reaction time and drastically increasing the risk of accidents. Especially in extreme weather conditions such as strong winds and heavy rain, fragile branches are easily broken and fall onto the road like sharp blades, posing a direct threat to the lives of vehicles and passengers traveling at high speeds.
[0053] Bending and deforming guardrails are mostly residual damage from vehicle collisions. This not only ruins the visual aesthetics of the road, but more importantly, it weakens the original protective effectiveness of the guardrails. Vehicles that have lost reliable protection are in a dangerous situation when passing through this section of road, significantly increasing the probability of secondary accidents.
[0054] Traffic accidents, especially rear-end collisions, are common disasters on highways[2]. They often originate from multiple factors such as loss of speed control, improper distance maintenance, driver fatigue, or delayed response to emergencies. At the moment of a rear-end collision, the vehicle suffers a violent impact, which not only causes serious damage to the vehicle body and heavy economic losses, but may also trigger a chain reaction, causing large-scale traffic paralysis. Rescue vehicles are stuck on the way, precious rescue time is ruthlessly consumed, and the safety of drivers and passengers hangs by a thread.
[0055] Once these dangerous situations erupt, they spread rapidly like dominoes, with the affected area expanding exponentially, posing immeasurable challenges to the operation and management of highways. They must be given high priority and actively addressed.
[0056] Please see Figure 1-3 To solve the above problems, the present invention provides a highway traffic condition monitoring system, comprising:
[0057] Ultrasonic sensors are used to detect whether tree branches are growing into the guardrails of highways;
[0058] Pressure sensors are installed on highway guardrails to detect whether the guardrails are bent.
[0059] The image recognition module is used to detect whether a traffic accident has occurred on the target road section;
[0060] The ESP32 microcontroller is connected to a temperature and humidity sensor, an ultrasonic sensor, and a pressure sensor. It issues an alarm when tree branches grow into the highway guardrail, when the highway guardrail is bent, or when a traffic accident occurs on the target road section.
[0061] The ESP32 microcontroller communicates with the traffic light module and the OLED screen via a LoRa remote communication module. When the road conditions are normal, the ESP32 microcontroller controls the traffic light module to turn on the green light, and the OLED screen displays "Road conditions are normal". When a tree branch grows into the highway guardrail, the ESP32 microcontroller controls the traffic light module to flash the yellow light, and the OLED screen displays "Tree branch is too long". When the highway guardrail is bent, the ESP32 microcontroller controls the traffic light module to flash the yellow light, and the OLED screen displays "Guardrail is bent". When a traffic accident occurs on the target road section, the ESP32 microcontroller controls the traffic light module to flash the red light, and the OLED screen displays "Traffic accident".
[0062] The highway traffic condition monitoring system based on ESP32 and image recognition in this invention is equipped with a variety of sensors and communication modules, including temperature and humidity monitoring, excessively long tree branches monitoring, guardrail bending monitoring, traffic accident detection, and remote monitoring and alarm functions.
[0063] Temperature and humidity monitoring can measure the temperature and humidity around the highway in real time and display them on OLED screens and remote monitoring terminals. Management departments can understand the road environment and prevent traffic accidents. For monitoring excessively long tree branches, ultrasonic sensors can accurately detect whether branches extend into the guardrail. Guardrail bending monitoring relies on pressure sensors to detect whether the guardrail is bent or deformed in real time. Guardrail bending is generally caused by accidents such as vehicle collisions, which not only affects aesthetics but also reduces protective performance and increases the risk of secondary accidents. Traffic accident detection relies on image recognition modules for real-time monitoring. Once a rear-end collision or other traffic accident is detected, the system immediately sends a distress signal to rescue personnel's mobile phones via a relay-controlled 4G alarm module. The LED traffic light module on the remote monitoring terminal flashes red rapidly as an alert, and the OLED screen displays "Traffic Accident," enabling rapid response and handling of the accident, shortening rescue time, reducing the impact of the accident on traffic, and protecting the safety of personnel at the scene.
[0064] Remote monitoring and alarm functions are achieved through LoRa and 4G modules, enabling timely notification of relevant personnel in case of abnormal situations, improving the efficiency of the monitoring system, and allowing managers to grasp road conditions in real time and make rapid decisions. In summary, the various functions of this device work together to form a comprehensive highway traffic condition monitoring solution. Through real-time monitoring and timely alarms, it effectively prevents and reduces traffic accidents, ensures smooth and safe highway traffic, has significant application value, and promising development prospects, bringing significant convenience and benefits to highway operation and management.
[0065] This invention leverages the powerful computing capabilities and low power consumption of the ESP32 microcontroller, combined with an image recognition module for precise analysis of complex road conditions, enabling timely detection of abnormal situations such as traffic accidents. Multiple sensors, including ultrasonic, pressure, and temperature / humidity sensors, work together to comprehensively monitor environmental factors and road infrastructure conditions, resulting in more thorough and detailed road condition monitoring.
[0066] The present invention also provides a method for monitoring highway traffic conditions, comprising:
[0067] Step 1: Collect images of different types of traffic accidents;
[0068] Step 2: Annotate images of different types of traffic accidents to form a training dataset;
[0069] Step 3: Perform data augmentation on the images in the training dataset to obtain the augmented dataset;
[0070] Step 3 includes:
[0071] Step 3.1: Select images taken at night from the training dataset;
[0072] Step 3.2: Perform illumination enhancement on the nighttime images to obtain the illumination-enhanced images;
[0073] In step 3.2, the illuminance component of the nighttime image is extracted, and an adaptive gamma coefficient is calculated based on the illuminance component. This adaptive gamma coefficient is then used to perform gamma enhancement on the illuminance component to obtain the enhanced image. The formula for calculating the adaptive gamma coefficient is as follows:
[0074]
[0075] in, Represents the adaptive gamma coefficients. Represents the original illuminance component. This represents the mean of the illuminance components.
[0076] This invention only enhances the "illuminance component" with gamma, only changes the "intensity of light", and does not directly affect the reflection / texture information. It can significantly improve the brightness of dark areas in night scenes, making scenes on highways clearly visible.
[0077] Step 3.3: Use a filter to smooth the image taken during the day to obtain a smoothed image, and calculate the edge image corresponding to the smoothed image;
[0078] Step 3.3 includes:
[0079] Step 3.3.1: Use a Gaussian filter to convolve the image taken during the day to obtain a smoothed image;
[0080] Step 3.3.2: Calculate the gradient magnitude and gradient direction of the smoothed image, and select pixels whose gradient magnitude and gradient direction are within a set range as edge images; the calculation process for the gradient magnitude and gradient direction of the smoothed image is as follows:
[0081]
[0082] in, Indicates a Gaussian filter. Images taken during the day, This represents the smoothed image. Represents the Gaussian filter parameters. Represents the horizontal coordinates of a pixel. Represents the coordinates in the vertical direction. This represents the first-order discrete difference of the smoothed image in the horizontal direction. This represents the first-order discrete difference in the vertical direction of the smoothed image. This represents the gradient magnitude of the smoothed image. Indicates the gradient direction.
[0083] Step 3.4: Use the edge image to enhance the image taken during the day to obtain an edge-enhanced image.
[0084] In step 3.4, an enhancement coefficient is calculated based on the maximum value of pixels on the edge image. This enhancement coefficient is then used to enhance the image taken during the day to obtain an edge-enhanced image. The edge enhancement process is as follows:
[0085]
[0086] in, Indicates the enhancement coefficient. Represents the edge image. This represents the maximum value of a pixel on the edge of the image. This represents the image after edge enhancement. Images taken during the day.
[0087] This invention uses the maximum edge response as a benchmark to control the overall enhancement range of the image, preventing strong edges from being stretched too brightly and producing obvious halos or jagged edges in high-contrast daytime scenes.
[0088] Step 4: Input the enhanced dataset into the YOLO network for training to obtain the traffic accident recognition model;
[0089] YOLO (You Only Look Once) is a target detection algorithm based on convolutional neural networks (CNN). Its core advantage lies in its ability to identify multiple targets in an image simultaneously and accurately locate their positions.
[0090] Data is the foundation for model training. A dataset containing traffic accident images and corresponding annotation information needs to be constructed. The specific steps are as follows:
[0091] Data collection: Image sources are divided into two categories: one is public datasets (such as Cityscapes, KITTI), and the other is traffic accident-related images collected independently by the project team. This ensures that the data covers different scenarios (such as sunny days, rainy days, daytime, and nighttime) and different accident types (such as vehicle collisions and vehicle rollovers), thereby improving the data's versatility.
[0092] Data annotation: Use professional annotation tools (such as LabelImg) to generate annotation files for each image. The annotation file name is consistent with the corresponding image file name (both are text files). The annotation content uses rectangles to determine the location of traffic accident areas in the image. Each line of the annotation file represents a target object, containing 5 types of core information, and the coordinates and dimensions are proportional values relative to the image width and height: Category ID (integer, such as "1" for "accident scene", "2" for "damaged vehicle").
[0093] To improve the robustness of the model (reduce overfitting and adapt to complex scenes), the enhanced dataset images are processed in various ways. Common methods include rotation (0°-360° random angle), scaling (enlarging or shrinking proportionally), flipping (flipping horizontally or vertically), and color adjustment (fine-tuning brightness, contrast, and saturation), which expands the amount of data while enriching the data features.
[0094] This model uses the YOLOv4 network architecture, whose structural design balances feature extraction capability and detection efficiency. The functions of each layer are as follows:
[0095] Input layer: Receives images with a fixed size of 608×608 pixels to ensure that the input data format is uniform, which facilitates feature processing in subsequent layers.
[0096] Convolutional layers: As the core of feature extraction, multiple convolutional layers are stacked to gradually extract features from low to high levels of the image (such as edges, textures, and object contours).
[0097] Fully connected layer: After flattening the features output by the convolutional layer, the fully connected layer maps the features to the prediction space, preparing for the final detection output.
[0098] Output layer: Each predicted bounding box contains three types of key information, and each grid cell predicts multiple boxes to cover different object probabilities. The output format formula is as follows:
[0099]
[0100] in, Represents the target category. Represents the coordinates of the center point of the prediction box. Represents the width and height of the prediction box. This represents the confidence level that the predicted box belongs to category i (i.e., the reliability of the predicted box containing the target).
[0101] Dataset partitioning: The processed dataset is divided into a training set (usually accounting for 70%-80%, used for model parameter learning) and a validation set (usually accounting for 20%-30%, used to evaluate model performance during training and prevent overfitting). When partitioning, it is necessary to ensure that the distribution of scenarios and accident types in the two datasets is consistent.
[0102] Loss function definition: The YOLO model uses a multi-part loss function that guides parameter updates by measuring the difference between the predicted results and the true labels. Specifically, it includes:
[0103] Localization loss: Calculates the positional and dimensional errors between the predicted bounding box and the true bounding box, using the mean squared error (MSE). The formula is:
[0104]
[0105] in, , , , The coordinates of the center point, width, and height of the actual bounding box; , , This is the value corresponding to the predicted bounding box; the summation range is all samples containing the target.
[0106] Confidence loss: measures the accuracy of whether the predicted bounding box contains the target, also using mean squared error, and the formula is:
[0107]
[0108] in, The true confidence level is 1 (inclusive of the target, exclusive of the target) or 0 (exclusive of the target). To predict the confidence level, the summation range is all predicted boxes.
[0109] Classification loss: Measures the difference between the predicted class and the actual class, using cross-entropy loss, the formula is:
[0110]
[0111] in, The true category label (one-hot encoded, such as "10" representing category 1). To predict the class probability, the summation range is all samples containing the target.
[0112] Total Loss: To balance the impact of the three types of losses, the total loss is the weighted sum of the three, as shown in the formula:
[0113]
[0114] in, , , These are the weighting coefficients.
[0115] Optimizer selection: Use stochastic gradient descent (SGD) or Adam optimizer to update network parameters. SGD is more likely to converge to the global optimum in long-term training, while Adam converges faster. The choice can be made based on the size of the dataset and the training efficiency requirements.
[0116] Learning rate adjustment: During training, a learning rate decay strategy (such as step decay or cosine annealing decay) is adopted. The initial learning rate is set to a large value to accelerate the early convergence. As the training rounds increase, the learning rate is gradually reduced (e.g., decayed to 1 / 10 of the original value every 10 rounds) to avoid parameter oscillation in the later stages.
[0117] Training monitoring and evaluation: After a certain number of training rounds (e.g., 5 rounds), the model's mAP (mean Average Precision) is calculated on the validation set. Training ends when the mAP is within the set range.
[0118] Step 5: Use the traffic accident identification model to monitor whether a traffic accident has occurred on the target road segment.
[0119] This invention collects and precisely annotates images of different types of traffic accidents, and, in conjunction with data augmentation in step 3, enriches the quantity and diversity of various accident samples. This enables the trained traffic accident recognition model to learn multiple accident forms and scene features, thereby effectively improving the recognition accuracy and recall rate of highway traffic accidents.
[0120] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A highway traffic condition monitoring system, characterized in that, include: Ultrasonic sensors are used to detect whether tree branches are growing into the guardrails of highways; Pressure sensors are installed on highway guardrails to detect whether the guardrails are bent. The image recognition module is used to detect whether a traffic accident has occurred on the target road section; The ESP32 microcontroller is connected to a temperature and humidity sensor, an ultrasonic sensor, and a pressure sensor. It issues an alarm when tree branches grow into the highway guardrail, when the highway guardrail is bent, or when a traffic accident occurs on the target road section.
2. The highway traffic condition monitoring system according to claim 1, characterized in that, Also includes: Traffic light module and OLED screen; the ESP32 microcontroller communicates with both the traffic light module and the OLED screen via a LoRa remote communication module; when road conditions are normal, the ESP32 microcontroller controls the traffic light module to turn on the green light, and the OLED screen displays "Road conditions normal"; when a tree branch grows into the highway guardrail, the ESP32 microcontroller controls the traffic light module to flash the yellow light, and the OLED screen displays "Tree branch too long"; when the highway guardrail bends, the ESP32 microcontroller controls the traffic light module to flash the yellow light, and the OLED screen displays "Guardrail bent"; when a traffic accident occurs on the target road section, the ESP32 microcontroller controls the 4G alarm module via a relay to send a distress signal to the rescue personnel's mobile phone, and controls the traffic light module to flash the red light, and the OLED screen displays "Traffic accident".
3. The highway traffic condition monitoring system according to claim 2, characterized in that, Also includes: A temperature and humidity sensor, connected to an ESP32 microcontroller, is used to collect temperature and humidity information and display it on an OLED screen.
4. A method for monitoring highway traffic conditions, characterized in that, The highway traffic condition monitoring system according to any one of claims 1-3 includes: Step 1: Collect images of different types of traffic accidents; Step 2: Annotate images of different types of traffic accidents to form a training dataset; Step 3: Perform data augmentation on the images in the training dataset to obtain the augmented dataset; Step 4: Input the enhanced dataset into the YOLO network for training to obtain the traffic accident recognition model; Step 5: Use the traffic accident identification model to monitor whether a traffic accident has occurred on the target road segment.
5. The highway traffic condition monitoring method according to claim 4, characterized in that, Step 3: Perform data augmentation on the images in the training dataset to obtain the augmented dataset, including: Step 3.1: Select images taken at night from the training dataset; Step 3.2: Perform illumination enhancement on the nighttime images to obtain the illumination-enhanced images; Step 3.3: Use a filter to smooth the image taken during the day to obtain a smoothed image, and calculate the edge image corresponding to the smoothed image; Step 3.4: Use the edge image to enhance the image taken during the day to obtain an edge-enhanced image.
6. The method for monitoring highway traffic conditions according to claim 5, characterized in that, In step 3.2, the illuminance component of the nighttime image is extracted, and an adaptive gamma coefficient is calculated based on the illuminance component. This adaptive gamma coefficient is then used to perform gamma enhancement on the illuminance component to obtain the enhanced image. The formula for calculating the adaptive gamma coefficient is as follows: in, Represents the adaptive gamma coefficients. Represents the original illuminance component. This represents the mean of the illuminance components.
7. The method for monitoring highway traffic conditions according to claim 6, characterized in that, Step 3.3: Smooth the image taken during the day using a filter to obtain a smoothed image, and calculate the edge image corresponding to the smoothed image, including: Step 3.3.1: Use a Gaussian filter to convolve the image taken during the day to obtain a smoothed image; Step 3.3.2: Calculate the gradient magnitude and gradient direction of the smoothed image, and select pixels whose gradient magnitude and gradient direction are within a set range as edge images; the calculation process for the gradient magnitude and gradient direction of the smoothed image is as follows: in, Indicates a Gaussian filter. Images taken during the day, This represents the smoothed image. Represents the Gaussian filter parameters. Represents the horizontal coordinates of a pixel. Represents the coordinates in the vertical direction. This represents the first-order discrete difference of the smoothed image in the horizontal direction. This represents the first-order discrete difference in the vertical direction of the smoothed image. This represents the gradient magnitude of the smoothed image. Indicates the gradient direction.
8. A method for monitoring highway traffic conditions according to claim 7, characterized in that, Step 3.4: Enhance the image taken during the day using the edge image to obtain an edge-enhanced image, including: An enhancement coefficient is calculated based on the maximum value of pixels on the edge image. This enhancement coefficient is then used to enhance the image taken during the day to obtain an edge-enhanced image. The edge enhancement process is as follows: in, Indicates the enhancement coefficient. Represents the edge image. This represents the maximum value of a pixel on the edge of the image. This represents the image after edge enhancement. Images taken during the day.
9. A method for monitoring highway traffic conditions according to claim 8, characterized in that, In step 4, the loss function of the YOLO network is: in,( , The center point coordinates of the actual bounding box The actual bounding box width, The actual bounding box height, ( ( ) represents the coordinates of the center point of the predicted bounding box. Predict bounding box width, To predict the bounding box height, For true confidence level, To predict confidence levels, For real category labels, To predict class probabilities, To pinpoint the loss, For confidence loss, For classifying losses, The first weighting coefficient, This is the second weighting coefficient. This is the third weighting coefficient. This is the total loss function.