A vehicle-mounted real-time monitoring and early warning system for brightness of expressway tunnels
By using a vehicle-mounted tunnel brightness real-time monitoring and early warning system, a seven-dimensional spatiotemporal feature vector is generated through actual vehicle driving experiments and image preprocessing. A tunnel brightness recognition model is established and a dangerous brightness threshold is generated, which solves the problems of real-time monitoring and early warning accuracy of tunnel brightness, reduces tunnel safety protection costs, and improves driving safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
- Filing Date
- 2026-04-01
- Publication Date
- 2026-07-21
AI Technical Summary
Existing methods for monitoring tunnel brightness cannot achieve real-time dynamic data acquisition, resulting in high deployment thresholds and high costs for tunnel safety protection. Furthermore, the early warning mechanism lacks continuous quantitative assessment of the dynamic environment, failing to meet the real-time intervention requirements for traffic safety.
A vehicle-mounted real-time monitoring and early warning system for highway tunnel brightness is adopted, including a data acquisition module, an image preprocessing module, a brightness recognition and monitoring module, and a threshold generation and early warning module. The system uses a real vehicle driving experiment to obtain tunnel brightness test data, generates a seven-dimensional spatiotemporal feature vector through image preprocessing, establishes a tunnel brightness recognition model, and uses an improved clustering algorithm to generate dangerous brightness thresholds for early warning.
It enables accurate brightness monitoring on ordinary vehicles without modification, reducing the deployment threshold and cost of tunnel safety protection, improving the accuracy and environmental adaptability of early warning, and reducing driving safety risks caused by blind spots.
Smart Images

Figure CN121963496B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of automotive driving technology, and in particular relates to a vehicle-mounted real-time monitoring and early warning system for brightness in highway tunnels. Background Technology
[0002] Tunnel driving safety is one of the core challenges in traffic management, and the dynamic changes in ambient light play a crucial role. At tunnel entrances and exits, drastic fluctuations in light intensity can significantly affect drivers' visual adaptation, leading to temporary visual impairment and increasing the risk of rear-end collisions or lane departures. Therefore, real-time monitoring and early warning of ambient light during tunnel entry and exit have become key to improving tunnel traffic safety.
[0003] Existing brightness monitoring methods face significant real-time bottlenecks in driving scenarios. Traditional methods rely on fixed, dedicated brightness detection instruments, which need to be pre-deployed on tunnel walls or roadsides and cannot dynamically collect data as vehicles move. During driving, the vehicle's position constantly changes, and fixed sensors can only provide localized, static data, failing to cover the brightness variation trends throughout the entire driving path. Furthermore, deploying and maintaining these dedicated devices is costly and difficult to integrate widely into ordinary vehicles, resulting in a persistent lack of real-time access to brightness indicators in driving environments.
[0004] During driving, especially in high-risk sections such as tunnels, drivers need immediate warnings of potential dangers, such as blind spots or reduced visibility caused by sudden changes in brightness. Existing warning mechanisms are mostly based on post-event data analysis or static threshold alarms, lacking continuous quantitative assessment of dynamic environments. This lag limits the timeliness of warnings and cannot meet the needs of real-time intervention for driving safety. Summary of the Invention
[0005] To address the aforementioned shortcomings in existing technologies, this invention provides a vehicle-mounted real-time brightness monitoring and early warning system for highway tunnels. This system solves the problems of high deployment thresholds and high costs in tunnel safety protection due to the need for professional brightness detection instruments to obtain accurate brightness detection capabilities when vehicles enter and exit tunnels, as well as the lack of dynamic environmental continuous quantitative assessment in existing early warning mechanisms.
[0006] To achieve the above objectives, the technical solution adopted by this invention is: a vehicle-mounted real-time monitoring and early warning system for highway tunnel brightness, comprising: The data acquisition module is used to acquire tunnel brightness test data through real vehicle driving experiments; The image preprocessing module is used to acquire the tunnel RGB image of the vehicle based on the tunnel brightness test data, and to preprocess the tunnel RGB image to obtain a seven-dimensional spatiotemporal feature vector. The brightness recognition and monitoring module is used to establish a video-based tunnel brightness recognition model based on tunnel brightness test data and a seven-dimensional spatiotemporal feature vector, and to extract the tunnel brightness value through the tunnel brightness recognition model. The threshold generation and early warning module is used to classify brightness indicators based on tunnel brightness values using an improved clustering algorithm, obtain dangerous brightness thresholds for tunnels, and issue early warnings based on these thresholds. The vehicle-mounted integrated module is used to connect the tunnel brightness recognition model and the tunnel dangerous brightness threshold to the vehicle for real-time monitoring and early warning of highway tunnel brightness.
[0007] Further: the image preprocessing module includes: The image acquisition unit is used to acquire RGB images of vehicles traveling through the tunnel based on tunnel brightness test data. The color conversion unit is used to convert the RGB image of the tunnel vehicle into the HSV image of the tunnel vehicle, and to extract the brightness channel of the HSV image of the tunnel vehicle to obtain the grayscale image of the tunnel vehicle. The threshold calculation unit is used to dynamically calculate the optimal segmentation threshold of the tunnel traffic grayscale image based on the Otsu algorithm. The binarization processing unit is used to binarize the grayscale image of the tunnel traffic according to the optimal segmentation threshold to obtain a black and white image of the tunnel traffic. The morphological processing unit is used to obtain a binary image of the tunnel traffic from the black-and-white image of the tunnel traffic through median filtering, erosion operation and dilation operation; The seven-dimensional feature calculation unit is used to calculate the seven-dimensional spatiotemporal feature vector based on the tunnel traffic binary map.
[0008] The further beneficial effects mentioned above are as follows: by converting the RGB image of the vehicle recording to the HSV space and extracting the luminance channel, the interference of color information on illumination information is removed. Binarization processing ensures the accuracy and robustness of threshold selection under different tunnel illumination conditions. At the same time, morphological processing such as median filtering, erosion operation and dilation operation can eliminate noise such as road surface reflection and markings, so that the final generated seven-dimensional spatiotemporal feature vector can more comprehensively and stably represent the complex illumination information and dynamic changes inside and outside the tunnel.
[0009] Furthermore: the seven-dimensional spatiotemporal feature vector includes: Global white pixel ratio is used to reflect the overall brightness level of the preprocessed black-and-white image of tunnel traffic. The top white pixel ratio is used to quantize the sky reflection area in the preprocessed black-and-white image of the tunnel traffic; The proportion of white pixels at the bottom is used to quantize the ground reflective areas in the preprocessed black-and-white image of tunnel traffic. The centroid of the white pixel's vertical coordinate is used to describe the vertical distribution of the white area in the preprocessed black-and-white image of tunnel traffic. The percentage of the largest connected region is used to identify sky blocks in the preprocessed black-and-white image of tunnel traffic. Top brightness change rate, used to capture the dynamic changes in brightness of the pre-processed black-and-white image of tunnel traffic; The standard deviation of white pixel distribution is used to distinguish between natural light and artificial light sources in the preprocessed black-and-white image of tunnel traffic.
[0010] The further beneficial effects mentioned above are: the seven-dimensional spatiotemporal feature vector expands a single image brightness value into a structured feature rich in spatiotemporal context, which enhances the representation and discrimination of complex lighting scenes at the tunnel entrance, interior and exit, and facilitates accurate and adaptive brightness recognition and early warning in the future.
[0011] Furthermore: the expression for the global white pixel ratio is as follows:
[0012] in, The global white pixel ratio, This represents the number of white pixels in the binary image of the tunnel traffic. The width of the binary image of the tunnel traffic. The height of the tunnel traffic binary diagram; The expression for the top white pixel ratio is as follows:
[0013] in, The ratio of the top white pixels, This represents the number of white pixels in the top 30% area of the binary image of the tunnel traffic. The expression for the bottom white pixel ratio is as follows:
[0014] in, The ratio of the bottom white pixels. This represents the number of white pixels in the bottom 30% area of the binary image of the tunnel traffic. The expression for the centroid of the white pixel's ordinate is as follows:
[0015] in, The centroid of the white pixel's vertical coordinate. For the first The ordinate of each white pixel. For pixel index; The expression for the percentage of the largest connected region is as follows:
[0016] in, The percentage of the largest connected region. To obtain the maximum area value among all connected regions, For the first The area of each connected region; The expression for the top brightness change rate is as follows:
[0017] in, The rate of change of brightness at the top. for The ratio of the top white pixels at any given moment. for The ratio of the top white pixels at any given moment. and All are time-indexed; The expression for the standard deviation of the white pixel distribution is as follows:
[0018]
[0019] in, The standard deviation of the white pixel distribution. For the first The x-coordinate of each white pixel. This is the average of the horizontal coordinates of all white pixels.
[0020] The further beneficial effects mentioned above are: the seven-dimensional time-series feature vector is calculated through mathematical expressions, and the consistency and reproducibility of feature extraction are ensured by setting clear calculation rules.
[0021] Further: the brightness recognition and monitoring module includes: The data alignment unit is used to align the tunnel brightness test data and the seven-dimensional spatiotemporal feature vector with timestamps to obtain data samples. The model building unit is used to establish a real-time brightness detection model based on a multilayer perceptron. The model training unit is used to train the real-time brightness detection model based on data samples to obtain the tunnel brightness recognition model. The brightness value extraction unit is used to process the tunnel brightness test data using a tunnel brightness recognition model to obtain the tunnel brightness value.
[0022] The further beneficial effects mentioned above are as follows: by aligning the row timestamps, tunnel brightness test data and image features can be integrated; by adopting a multilayer perceptron model, high-precision determination of tunnel brightness values can be achieved while ensuring real-time performance; stability and generalization ability in the vehicle environment can be ensured; and continuous detection and identification of the lighting environment inside and outside the tunnel can be achieved, providing a reliable data foundation for dynamic safety early warning.
[0023] Furthermore, the expression for the tunnel brightness recognition model is as follows:
[0024]
[0025]
[0026] in, The tunnel brightness prediction value is output by the tunnel brightness recognition model. This is the output layer weight matrix. For the output of the time fusion layer, For the bias of the output layer, The size of the time window. For time indexing, for The output of the feature extraction layer at time step 1. The output of the feature extraction layer, For activation function, This is the weight matrix of the fully connected layer. It is a seven-dimensional spatiotemporal feature vector. This is the bias of the feature extraction layer.
[0027] The further beneficial effects mentioned above are: the feature extraction layer captures nonlinear relationships, the temporal fusion layer uses continuous frame information to smooth noise and enhance temporal consistency, and the final output layer achieves accurate regression, which can complete the high-precision acquisition from image features to physical brightness values with low latency under the limited resources of the vehicle system.
[0028] Furthermore: the training of the real-time brightness detection model specifically includes: Based on the data samples, obtain the actual value of tunnel brightness and the predicted value of tunnel brightness output by the real-time brightness detection model; The loss function of the real-time brightness detection model is calculated based on the actual and predicted values of tunnel brightness. Based on the loss function of the real-time brightness detection model, the weight parameters of the real-time brightness detection model are updated through the backpropagation algorithm, and the final weight parameters of the real-time brightness detection model are obtained by combining the gradient calculation acceleration algorithm and the freezing mechanism. The final weight parameters are used as the model parameters for the real-time brightness detection model to complete the training of the real-time brightness detection model and obtain the tunnel brightness recognition model.
[0029] The further beneficial effects mentioned above are: the gradient calculation acceleration algorithm improves the training efficiency of the model under complex features and ensures rapid convergence; the freezing mechanism enhances the generalization ability and stability of the model in the variable tunnel environment; and the final trained tunnel brightness recognition model has high accuracy, strong robustness and engineering practicality.
[0030] Furthermore: the threshold generation and early warning module includes: The standardization unit is used to standardize the tunnel brightness value to obtain a standardized tunnel brightness value. Clustering units are used to calculate the distance between a sample and the cluster center based on a clustering algorithm according to the standardized tunnel brightness value, assign the sample to the nearest cluster, update the cluster center, and obtain the dangerous clusters; The threshold calculation unit is used to calculate the tunnel hazard brightness threshold based on the hazard clusters. The tunnel hazard brightness threshold includes a global brightness threshold, a top brightness threshold, and a brightness change threshold. The early warning execution unit is used to issue early warnings for different states based on the global brightness threshold, the top brightness threshold, and the brightness change threshold.
[0031] The further beneficial effects mentioned above are: standardization can eliminate the influence of dimensions, which facilitates subsequent cluster analysis; the global brightness threshold, top brightness threshold and brightness change threshold calculated by the hazard cluster solve the defects of traditional methods that artificially set thresholds, enabling the early warning to adapt to the tunnel environment under different time periods and weather conditions, thus improving the accuracy and environmental adaptability of the early warning.
[0032] Furthermore, the expression for the dangerous cluster is as follows:
[0033]
[0034]
[0035]
[0036]
[0037] in, For indexes of dangerous clusters, The global white pixel ratio, The sample set corresponding to the index of the dangerous cluster. To identify the category with the lowest proportion of white pixels, For the updated number The center of each cluster, To be assigned to the The set of all samples in a cluster For the first The number of samples in each cluster To find the distance smallest value, For the sample with cluster The square of the Euclidean distance between the centers For the first The standardized feature vector of each sample. For the first The coordinates of the center point of each cluster For standardized tunnel brightness values, For the first The first sample Each tunnel brightness value, For all samples in the first The average value of each indicator For all samples in the first The standard deviation of each indicator.
[0038] The further beneficial effects mentioned above are: by calculating and identifying dangerous clusters, data representing dangerous states can be extracted from complex brightness data, providing a basic mathematical basis for safety thresholds and improving the reliability and practicality of the early warning system.
[0039] Furthermore: the warnings for the different states specifically include:
[0040]
[0041]
[0042]
[0043] in, Warnings for different states For time indexing, This is a dangerous situation. In a warning state, For a safe state, for The global white pixel ratio at any given time. for The ratio of the top white pixels at any given moment. The global brightness threshold for dangerous conditions. The top brightness threshold for a dangerous state. for The change in the proportion of the top white pixels at any given moment. The threshold for brightness change in warning status. To calculate the 0.05 quantile of the dataset, To calculate the 0.95 quantile of the dataset, For the first The proportion of global white pixels in each sample. For the first The proportion of the top white pixels of each sample. For the first The proportion of the top white pixels of each sample. The sample set corresponding to the index of the dangerous cluster. To be assigned to the The set of all samples in a cluster.
[0044] The further beneficial effects mentioned above are as follows: the tunnel hazard brightness threshold calculated based on hazard clusters can correspond to various environments such as dim lighting inside the tunnel and sudden changes at the tunnel entrance, avoiding false alarms and missed alarms caused by a single or fixed threshold, improving the accuracy and environmental adaptability of early warning, and enhancing the reliability of active safety protection for tunnel traffic.
[0045] The beneficial effects of this invention are: This invention uses a dashcam to capture changes in ambient light in real time. When the brightness at the tunnel entrance or exit exceeds a safety threshold, an audible and visual alarm is immediately triggered, allowing the driver to take timely safety measures such as slowing down during the visual adaptation period, thereby reducing the risk of collisions caused by blurred vision.
[0046] This invention utilizes existing vehicle equipment, such as a dashcam, to achieve professional-grade safety monitoring. By analyzing the dashcam video stream using a brightness prediction model, it eliminates the reliance on specialized brightness detection instruments found in traditional technologies. This allows ordinary vehicles to obtain accurate brightness monitoring capabilities without modification, lowering the deployment threshold and cost of tunnel safety protection. Attached Figure Description
[0047] Figure 1 This is a schematic diagram of a vehicle-mounted real-time brightness monitoring and early warning system for highway tunnels. Figure 2 This is an example diagram of a real-vehicle driving test for tunnel brightness monitoring; Figure 3 HSV images of vehicles traveling through tunnels; Figure 4 This is a grayscale image of traffic traveling through the tunnel. Figure 5 A black-and-white image of vehicles traveling through the tunnel; Figure 6 This is a binary diagram of traffic flow in the tunnel. Figure 7For training loss curves; Figure 8 A scatter plot of the predicted values; Figure 9 Feature importance graph; Figure 10 For error histogram; Figure 11 For predicting timeline charts; Figure 12 For predicting residual analysis plots; Figure 13 For error analysis statistics; Figure 14 A PCA visualization of the clustering results; Figure 15 This is a global white pixel distribution map for each cluster; Figure 16 A pie chart showing the distribution of early warning status; Figure 17 This is a time distribution chart of early warning status; Figure 18 This is a global white pixel ratio threshold analysis chart; Figure 19 This is a threshold analysis chart of the proportion of white pixels at the top; Figure 20 A threshold analysis chart of brightness variation values; Figure 21 For threshold heatmaps; Figure 22 This is a statistical chart of the early warning status; Figure 23 This is a global white pixel ratio distribution map for each state; Figure 24 This is a time distribution chart of early warning status; Figure 25 This is a distribution map of the warning status in the PCA space; Figure 26 This is a graph analyzing the importance of features in early warning systems. Detailed Implementation
[0048] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0049] Example 1 like Figure 1 The diagram shown is a schematic representation of a vehicle-mounted real-time brightness monitoring and early warning system for highway tunnels, including: The data acquisition module is used to acquire tunnel brightness test data through real vehicle driving experiments; The image preprocessing module is used to acquire the tunnel RGB image of the vehicle based on the tunnel brightness test data, and to preprocess the tunnel RGB image to obtain a seven-dimensional spatiotemporal feature vector. The brightness recognition and monitoring module is used to establish a video-based tunnel brightness recognition model based on tunnel brightness test data and a seven-dimensional spatiotemporal feature vector, and to extract the tunnel brightness value through the tunnel brightness recognition model. The threshold generation and early warning module is used to classify brightness indicators based on tunnel brightness values using an improved clustering algorithm, obtain dangerous brightness thresholds for tunnels, and issue early warnings based on these thresholds. The vehicle-mounted integrated module is used to connect the tunnel brightness recognition model and the tunnel dangerous brightness threshold to the vehicle for real-time monitoring and early warning of highway tunnel brightness.
[0050] In one embodiment of the present invention, the data acquisition module is used to acquire tunnel brightness test data through a real-vehicle driving experiment. An experimental team consisting of a driver, test vehicle, equipment operator, and data engineer can be assembled. A 1080P resolution, 25fps dashcam is installed at the center rearview mirror of the windshield. A brightness sensor with a range of 0-100000 lux and an accuracy of ±5% is installed directly below it, ensuring the lens and sensor's light-receiving surface are parallel. Millisecond-level time synchronization is achieved through a GPS timing module. The experimental vehicle drives through long, medium, and short tunnels under normal driving conditions, maintaining normal driving status, and synchronously acquiring video streams and brightness data throughout the process. After the experiment, all equipment data is downloaded, and timestamps are used to align video frames and brightness sampling points. After removing invalid data, valid video data in 1080P / 25fps format and the corresponding brightness dataset with a sampling rate of 100Hz are obtained, thus yielding the tunnel brightness test data, which is stored as a matrix in time series for subsequent use. RGB images of vehicles traveling in tunnels can be obtained from valid video data. The color space is RGB, with Red, Green, and Blue as the three basic colors. Various colors are formed by superposition. In computer vision, an RGB image of a vehicle is composed of a 1920×1080 matrix, where each element is the value of the three RGB channels, with a value range of (0, 255). However, the RGB color space is easily affected by light intensity and does not easily reflect the essence of color. When used for brightness detection when vehicles enter or exit tunnels, it is difficult to reflect the true brightness, causing false alarms in brightness warnings. Therefore, this invention converts it into an HSV image and performs feature extraction to obtain a seven-dimensional time-space feature vector.
[0051] In one embodiment of the present invention, the image preprocessing module includes: The image acquisition unit is used to acquire RGB images of vehicles traveling through the tunnel based on tunnel brightness test data. The color conversion unit is used to convert the RGB image of the tunnel vehicle into the HSV image of the tunnel vehicle, and to extract the brightness channel of the HSV image of the tunnel vehicle to obtain the grayscale image of the tunnel vehicle. In a specific embodiment of the present invention, the color space of the tunnel driving HSV image consists of three channels: hue (H), saturation (S), and value (V). Hue refers to the color attribute it represents when describing a pure color, measured by angle, and ranges from 0° to 360°, where red is 0°, green is 120°, and blue is 240°. Saturation refers to the purity of the color, ranging from 0% to 100%; a higher saturation value indicates a deeper color. Value refers to the brightness of the color, ranging from 0% to 100%; a higher value indicates a brighter color. Compared to the RGB color space, the HSV color space can make the hue, saturation, and value components independent, eliminating the influence of color intensity on color information. Therefore, in this invention, the HSV image can accurately reflect the dynamic brightness changes of vehicles entering and exiting the tunnel. Figure 2 The image shown is an example of a real-vehicle driving test for tunnel brightness monitoring. It is an RGB image, which is converted to... Figure 3 The HSV image of the tunnel driving vehicle shown is converted from an RGB image to an HSV image using the following expression:
[0052]
[0053]
[0054] in, Hue indicates the type of color in the image; V represents saturation, indicating the purity of image colors; V represents brightness, indicating the purity of colors. This represents the value of the R channel in an RGB image. This represents the value of the G channel in an RGB image. This represents the value of the B channel in an RGB image. The maximum value among R, G, and B; It is the minimum value among R, G, and B.
[0055] After obtaining the HSV image of the tunnel vehicle, although the interference of color information on brightness information is eliminated, the problem of inaccurate brightness prediction due to color space conversion and noise interference still exists. Therefore, this invention extracts the lightness channel, i.e., the V channel, of the HSV color space as the main source of brightness. Using an adaptive threshold segmentation algorithm such as the Otsu algorithm, the segmentation threshold is dynamically calculated, and the image is binarized to distinguish between bright and dark areas, resulting in... Figure 4 The image shows a grayscale image of the tunnel under traffic. This is used to determine the proportion of bright pixels in the image, thus improving the accuracy of subsequent brightness prediction. The expression for extracting the brightness channel is as follows:
[0056] in, coordinates The brightness channel grayscale image at that location; For HSV images in coordinates The brightness value of the pixel.
[0057] The threshold calculation unit is used to dynamically calculate the optimal segmentation threshold of the tunnel traffic grayscale image using the Otsu algorithm; the expression for the optimal segmentation threshold is as follows:
[0058] in, The optimal image segmentation threshold obtained by the Otsu algorithm. To find the expression within the parentheses that maximizes its value. A function of value This represents the proportion of pixels with brightness ≤ T out of the total number of pixels in the image. This represents the proportion of pixels with brightness greater than T out of the total number of pixels in the image. This represents the average brightness of pixels in darker areas. This represents the average brightness of the pixels in the highlighted area.
[0059] The binarization unit is used to binarize the tunnel traffic grayscale image according to the optimal segmentation threshold, to obtain, as shown below. Figure 5 The image shown is a black and white image of traffic traveling through the tunnel; the expression for binarization is as follows:
[0060] in, Coordinates The pixel binary at that location, This indicates that the pixel is a high-brightness pixel; This indicates that the pixel is a low-brightness pixel.
[0061] S205. Based on the black and white image of the tunnel traffic, a binary image of the tunnel traffic is obtained through median filtering, erosion operation and dilation operation. After obtaining the black-and-white image of the tunnel traffic, although it can roughly represent the brightness changes, there is some noise interference, such as white markings on the ground and white parts of signs. Noise will affect the accuracy of highlight area recognition and reduce the accuracy of brightness prediction. Therefore, it is necessary to remove noise from the black-and-white image of the tunnel traffic to reduce the impact of noise on recognition accuracy. Morphological processing of the image is performed through erosion and dilation operations to further remove noise in small areas and fill holes in the image, thereby achieving overall optimization of the image structure. The expressions for median filtering, erosion, and dilation operations are as follows:
[0062]
[0063]
[0064] in, After median filtering Output value at; Center pixel; Median selection operation The pixel sequence in the neighborhood of the center pixel; The image shows the vehicle after the etching process is complete. The source image is the input; This is a dilated image of the vehicle.
[0065] This invention removes fine noise from black-and-white images of tunnel vehicles using median filtering while preserving important information such as image contours and edges, thereby improving the accuracy of brightness feature extraction. While the median-filtered black-and-white image of tunnel vehicles eliminates most of the fine noise, some larger noise points remain unprocessed. Based on the requirement for accurate identification of bright areas, this invention employs image morphology erosion and dilation for further processing. Through erosion, the median-filtered black-and-white image of tunnel vehicles is convolved to find the minimum value within the kernel region, and this minimum value is assigned to the pixel at the center of the kernel. This eliminates bulges in the median-filtered image, resulting in an eroded black-and-white image of tunnel vehicles. Through dilation, the maximum value within the kernel region is calculated, and this maximum value is assigned to the pixel at the center of the kernel. This fills in the holes in the median-filtered image and connects the blank hole regions, finally obtaining... Figure 6 The image shows a binary diagram of traffic flow through the tunnel.
[0066] A seven-dimensional feature calculation unit is used to calculate a seven-dimensional spatiotemporal feature vector based on the binary image of the tunnel traffic. After obtaining the binary image of the tunnel traffic, its bright areas are almost identical to the corresponding bright areas in the RGB image of the tunnel traffic. Therefore, this invention uses the proportion and distribution of bright pixels in the binary image of the tunnel traffic as input features for brightness prediction, and defines the spatial partitioning rules of the binary image of the tunnel traffic: let the height of the image be H pixels, the width be W pixels, the top area be the area of the upper 30% height of the image, and the bottom area be the area of the lower 30% height of the image; and extract the seven-dimensional spatiotemporal feature vector accordingly. The seven-dimensional spatiotemporal feature vector is then input into a pre-trained brightness prediction model to obtain the brightness prediction value.
[0067] In a specific embodiment of the present invention, the seven-dimensional spatiotemporal feature vector includes: The global white pixel ratio reflects the overall brightness level of the preprocessed black-and-white image of tunnel traffic. The expression for the global white pixel ratio is as follows:
[0068] in, The global white pixel ratio, This represents the number of white pixels in the binary image of the tunnel traffic. The width of the binary image of the tunnel traffic. The height of the tunnel traffic binary diagram; The top white pixel ratio is used to quantize the sky reflection area in the preprocessed black-and-white image of the tunnel traffic. The expression for the top white pixel ratio is as follows:
[0069] in, The ratio of the top white pixels, This represents the number of white pixels in the top 30% area of the binary image of the tunnel traffic. The bottom white pixel ratio is used to quantize the ground reflective area in the preprocessed black-and-white image of tunnel traffic. The expression for the bottom white pixel ratio is as follows:
[0070] in, The ratio of the bottom white pixels. This represents the number of white pixels in the bottom 30% area of the binary image of the tunnel traffic. The centroid of the white pixel's ordinate is used to describe the vertical distribution of white areas in the preprocessed black-and-white image of tunnel traffic. The expression for the centroid of the white pixel's ordinate is as follows:
[0071] in, The centroid of the white pixel's vertical coordinate. For the first The ordinate of each white pixel. For pixel index; The maximum connected region percentage is used to identify sky blocks in the preprocessed black-and-white image of tunnel traffic. The expression for the maximum connected region percentage is as follows:
[0072] in, The percentage of the largest connected region. To obtain the maximum area value among all connected regions, For the first The area of each connected region; The top brightness change rate is used to capture the dynamic brightness changes of the preprocessed black-and-white image of tunnel traffic. The expression for the top brightness change rate is as follows:
[0073] in, The rate of change of brightness at the top. for The ratio of the top white pixels at any given moment. for The ratio of the top white pixels at any given moment. and All are time-indexed; The standard deviation of the white pixel distribution is used to distinguish between natural light and artificial light sources in the preprocessed black-and-white image of tunnel traffic. The expression for the standard deviation of the white pixel distribution is as follows:
[0074]
[0075] in, The standard deviation of the white pixel distribution. For the first The x-coordinate of each white pixel. This is the average of the horizontal coordinates of all white pixels.
[0076] The seven-dimensional spatiotemporal feature vector can comprehensively and dynamically display the complex lighting transition scene inside and outside the tunnel, providing reliable input features for the real-time brightness detection model, improving the accuracy of real-time brightness detection, and reducing the driving safety risks caused by sudden changes in light when entering and exiting the tunnel.
[0077] In one embodiment of the present invention, a brightness recognition and monitoring module is used to establish a video-based tunnel brightness recognition model based on tunnel brightness test data and a seven-dimensional spatiotemporal feature vector, and to extract tunnel brightness values through the tunnel brightness recognition model; the brightness recognition and monitoring module includes: The data alignment unit is used to align the tunnel brightness test data and the seven-dimensional spatiotemporal feature vector with timestamps to obtain data samples. The model building unit is used to establish a real-time brightness detection model based on a multilayer perceptron. The model training unit is used to train the real-time brightness detection model based on data samples to obtain the tunnel brightness recognition model. The brightness value extraction unit is used to process the tunnel brightness test data using a tunnel brightness recognition model to obtain the tunnel brightness value.
[0078] In a specific embodiment of the present invention, a tunnel driving video sequence with a duration of 1 minute is acquired, and video frames are extracted at 10 frames per sampling point, resulting in a total of 180 sampling points. The video frames corresponding to each sampling point are subjected to image binarization processing, and a seven-dimensional spatiotemporal feature vector is extracted from each binarized image to construct a data sample set for model training.
[0079] In a specific embodiment of the present invention, a real-time brightness detection model is established based on a multilayer perceptron. The multilayer perceptron design is simple. In this invention, by fusing seven-dimensional spatiotemporal feature vectors, high-precision brightness detection can be achieved with low computational cost, improving adaptability to real-time changes in lighting conditions inside and outside the tunnel, and enhancing the accuracy of the final warning. The real-time brightness detection model includes a feature extraction layer, a temporal fusion layer, and an output layer, specifically including: The expression for the feature extraction layer is as follows: ; , , ,
[0080] in, The output of the feature extraction layer, For activation function, This is the weight matrix of the fully connected layer. It is a seven-dimensional spatiotemporal feature vector. The bias of the feature extraction layer; The expression for the time fusion layer is as follows: ; , , ; in, For the output of the time fusion layer, The size of the time window. For time indexing, for The output of the feature extraction layer at time step 1. express and It is a 16-dimensional real vector; The time window is fixed at 13 frames. The expression for the output layer is as follows:
[0081] , ,
[0082] in, This is the predicted brightness value. This is the output layer weight matrix; For output layer bias
[0083] In a specific embodiment of the present invention, the model training unit is used to train the real-time brightness detection model based on data samples to obtain a tunnel brightness recognition model; wherein, training the real-time brightness detection model specifically includes: The data samples were divided into training and testing sets in a 7:3 ratio, and the established real-time brightness detection model was trained. Based on the data sample, obtain the actual value of tunnel brightness. Tunnel brightness prediction value output by the real-time brightness detection model ; Based on the actual value of tunnel brightness and tunnel brightness prediction value The loss function of the real-time brightness detection model is calculated, and its expression is as follows:
[0084] in, Let be the loss function of the real-time brightness detection model. This is the predicted brightness value; This is the actual brightness value; Based on the loss function of the real-time brightness detection model The weight parameters of the real-time brightness detection model are updated by backpropagation algorithm, and the final weight parameters of the real-time brightness detection model are obtained by combining gradient calculation acceleration algorithm and freezing mechanism. First, the weight parameters of the loss function on the brightness prediction model are calculated using the backpropagation algorithm. The gradient of is expressed as follows:
[0085] in, For the loss function with respect to the weight parameters gradient, For the loss function Find the weight parameters The partial derivative; The weights are updated using gradient descent, and the expression is as follows:
[0086] in, for The weight parameters of the brightness prediction model at each time step. for Weight parameters of the brightness prediction model at any given time; The learning rate is a hyperparameter used to adjust the step size; the weight parameters of the brightness prediction model are updated using the backpropagation algorithm until the convergence condition is met. ,in, The preset convergence threshold, for The loss function at time step 1. for The loss function at each time step; updating the weight parameters of the brightness prediction model through backpropagation ensures that the weight parameters can converge stably to the global optimum, thus improving the accuracy of the brightness prediction model.
[0087] Meanwhile, in the application of traditional deep learning models for tunnel brightness detection, the problems of low training efficiency, easy overfitting, and difficulty in converging to the optimal solution are due to the complexity of the input feature vectors. This invention adds a hybrid training framework based on acceleration algorithm and freezing mechanism to the backpropagation algorithm, which further improves the training speed and weight generalization ability of the brightness prediction model and can maintain the stability of high-precision prediction in complex driving environments. Among them, gradient calculation acceleration algorithms include: The forward propagation is calculated as follows:
[0088] in, The linear output of the convolutional layer. For vectorization operations; Convolutional layer weights in the weight parameters of the brightness prediction model The gradient calculation uses the im2col gradient calculation acceleration algorithm, and the expression is as follows:
[0089] in, To obtain the partial derivative of the loss function with respect to the weights of the convolutional layer, For rearranging the input data; The im2col function; This is the matrix transpose. This is the error propagated from upstream; Weights of fully connected layers in the weight parameters of the brightness prediction model The gradient calculation is simplified, and the expression is as follows:
[0090] in, To obtain the partial derivative of the loss function with respect to the weights of the fully connected layer, To obtain the partial derivative of the brightness prediction value with respect to the loss function; The derivative of the activation function; The input vector for the fully connected layer; The freezing mechanism is as follows: determine the loss function of the validation set. If the weights are less than the preset loss function threshold, the final weight parameters of the brightness prediction model are obtained; otherwise, the weight parameters of the brightness prediction model are updated through the backpropagation algorithm. The expressions for the final weight parameters of the brightness prediction model are as follows:
[0091] in, These are the final weight parameters for the brightness prediction model. To minimize the parameter finder; For model prediction functions; The actual label value; Final weight parameters The real-time brightness detection model was trained using the model parameters to obtain the tunnel brightness recognition model. The model was then validated using a test set to test its performance.
[0092] In a specific embodiment of the present invention, the model exhibits excellent convergence and stability during training, achieving prediction accuracy at an engineering-practical level, with reasonable error control and strong feature interpretability. The training loss curve is shown below. Figure 7 As shown, the model reached a stable state after approximately 2000 training rounds, with both training and validation losses decreasing to 50.79, indicating that the model did not overfit and the training effect was good; the scatter distribution of the predicted values is as follows. Figure 8 As shown, the prediction accuracy is extremely high, with an R² of 0.9017, an MSE of 46.70, and a MAE of 5.49. The scatter plots of the predicted and true values are closely distributed near the ideal diagonal, demonstrating the model's excellent fitting ability and generalization performance. Feature importance analysis is as follows: Figure 9As shown, the feature contribution distribution is reasonable. The centroid of the white pixel's vertical coordinate has the greatest impact on brightness prediction (weight 22.7%), followed by the proportion of the largest connected region (weight 16.2%), while the proportion of top white pixels has the least impact (weight 8.8%). The ranking of feature importance has clear physical significance. The prediction error analysis is as follows: Figure 10 As shown, the error distribution basically conforms to a normal distribution, with a mean of -0.0546 close to 0, a moderate standard deviation of 6.8336, and a median of 0.6334 slightly larger than the mean, indicating a slight right skew in the error distribution, but overall concentrated within a reasonable range; the prediction time comparison curve is shown below. Figure 11 As shown, the time-series prediction trend matches well, and the curves of the actual and predicted values are basically consistent. Although there are deviations at individual sample points, the model can accurately capture the brightness change pattern overall. The prediction residual analysis is as follows: Figure 12 As shown, the residuals show no obvious pattern, with residual points randomly distributed near the zero line. The mean of -0.0546 is close to 0, and the standard deviation of 6.8336 indicates that the error fluctuation range is reasonable. Error analysis statistics are as follows: Figure 13 As shown, the model has excellent overall performance, with R²=0.9017, MSE=46.70, MAE=5.50, and 84.6% of the sample errors are within 10, indicating that the model is accurate in most cases.
[0093] In one embodiment of the present invention, a threshold generation and early warning module is used to classify brightness indicators based on tunnel brightness values using an improved clustering algorithm to obtain a dangerous brightness threshold for the tunnel, and to issue an early warning based on the dangerous brightness threshold; the threshold generation and early warning module includes: The standardization unit is used to standardize the tunnel brightness value to obtain a standardized tunnel brightness value. Clustering units are used to calculate the distance between samples and cluster centers based on standardized tunnel brightness values using a clustering algorithm, assign samples to the nearest clusters, update cluster centers, and thus obtain hazardous clusters. The specific steps are as follows: The original brightness index is standardized to eliminate the influence of dimensions. The expression is as follows:
[0094] in For standardized tunnel brightness values, For the first The first sample Each tunnel brightness value, For all samples in the first The average value of each indicator For all samples in the first Standard deviation of each indicator; The squared Euclidean distance between each sample and the cluster center is calculated as follows:
[0095] in, For the sample with cluster The square of the Euclidean distance between the centers For the first The standardized feature vector of each sample; For the first The coordinates of the center point of each cluster; The sample is assigned to the nearest cluster, as shown in the following expression:
[0096] in, For the sample The index of the cluster to which it was assigned. To find the distance smallest value; Based on the newly assigned samples, the cluster centers are recalculated as follows:
[0097] in, For the updated number The center of each cluster, To be assigned to the The set of all samples in a cluster; For the first The number of samples in each cluster; Identify cluster indexes representing dangerous states The expression is as follows:
[0098] in, For the index of clusters identified as being in a dangerous state, To identify the category with the lowest proportion of white pixels, Index of clusters in dangerous state The corresponding sample set; The threshold calculation unit is used to calculate the tunnel hazard brightness threshold based on the hazard clusters. The tunnel hazard brightness threshold includes a global brightness threshold, a top brightness threshold, and a brightness change threshold. The early warning execution unit is used to issue early warnings for different states based on the global brightness threshold, the top brightness threshold, and the brightness change threshold. The specific warnings for different states include:
[0099]
[0100]
[0101]
[0102] in, Warnings for different states For time indexing, This is a dangerous situation. In a warning state, For a safe state, for The global white pixel ratio at any given time. for The ratio of the top white pixels at any given moment. The global brightness threshold for dangerous conditions. The top brightness threshold for a dangerous state. for The change in the proportion of the top white pixels at any given moment. The threshold for brightness change in warning status. To calculate the 0.05 quantile of the dataset, To calculate the 0.95 quantile of the dataset, For the first The proportion of global white pixels in each sample. For the first The proportion of the top white pixels of each sample. For the first The proportion of the top white pixels of each sample. The sample set corresponding to the index of the dangerous cluster. To be assigned to the The set of all samples in a cluster.
[0103] In a specific embodiment of the present invention, the system automatically determines the dangerous brightness threshold of the tunnel through intelligent clustering analysis, enabling accurate classification and timely early warning of the tunnel's operating status. Clustering results_PCA visualization is shown below. Figure 14 As shown, the clustering effect is good, with the three clusters clearly separated in the PCA dimensionality reduction space. The center positions of the dangerous clusters are accurately marked, providing a reliable clustering basis for subsequent threshold calculations. The global white pixel distribution of each cluster is as follows: Figure 15 As shown, the dangerous clusters were accurately identified. The proportion of global white pixels in cluster 2 was significantly lower than that of the other two clusters, and a large number of samples were below the danger threshold of 0.191, verifying the correctness and effectiveness of the clustering analysis. The distribution of warning states is as follows: Figure 16As shown, the early warning distribution is reasonable, with 91.7% of the states being safe, 5.0% being warning, and 3.3% being dangerous. This distribution conforms to the actual safety patterns of tunnel operation, and the system's early warning strategy is scientific. The time distribution of early warning states is as follows: Figure 17 As shown, the early warning time distribution is clear, with the safe state dominating in the time series, while the dangerous and warning states appear sporadically, indicating a reasonable fluctuation pattern in tunnel brightness changes; global brightness threshold analysis is as follows... Figure 18 As shown, the threshold setting is reasonable, and the dangerous state mainly occurs in the sample index range of 130-150. At this time, the global white pixel ratio is significantly lower than the danger threshold of 0.191, and the early warning mechanism responds promptly. The top brightness threshold analysis is as follows: Figure 19 As shown, the top feature is effective, but the proportion of white pixels at the top fluctuates significantly. Dangerous conditions occur when the pixel count falls below the 0.144 threshold, highlighting the importance of brightness monitoring at the tunnel top. The brightness change threshold analysis is as follows: Figure 20 As shown, the change monitoring is sensitive. When the brightness change exceeded the warning threshold of 0.779 multiple times, the system successfully detected the sudden changes in tunnel brightness, and the early warning mechanism functioned well. The heatmap of the average values of each state characteristic is shown below. Figure 21 As shown, the features are clearly distinguishable. The mean values of the features in the safe state are generally higher than those in the warning and danger states. In particular, the standard deviation of the feature in the safe state reaches 1081.42, demonstrating good feature distinguishing ability. The statistics for the warning state are as follows: Figure 22 As shown, the statistics are intuitive and clear: 165 samples for safe status, 9 samples for warning status, and 6 samples for dangerous status. The bar chart visually displays the sample size distribution for warning status. Figure 23 As shown, this is a global white pixel ratio distribution map for each state. The state distinctions are significant, with the proportion of white pixels in the safe state being significantly higher than that in the warning and danger states. Furthermore, the danger state data is concentrated in the 0.1-0.15 range, below the danger threshold of 0.191, verifying the accuracy of the warning judgment. The time distribution of the warning states is shown below. Figure 24 As shown, the system operates stably and reliably, with a safe state dominating. Warning and dangerous states only appear sporadically at specific times, demonstrating the rationality of the early warning mechanism design and the high reliability of the system. The distribution of early warning states in the PCA space is as follows: Figure 25 As shown, different warning states have good distinguishability in the feature space. Safe state points are concentrated, while warning and danger state points are scattered in specific areas, verifying the effectiveness of feature extraction and cluster analysis. The importance analysis of features in warnings is as follows: Figure 26 As shown, the feature weights are set reasonably, clearly presenting the contribution of each feature to the early warning judgment. The global white ratio and the top white ratio have the highest weights, while the weights of other features are set appropriately, which is in line with the physical laws and engineering practice experience of tunnel brightness monitoring.
[0104] In one embodiment of the present invention, an in-vehicle integrated module is used to connect the tunnel brightness recognition model and the tunnel dangerous brightness threshold to the vehicle for real-time monitoring and early warning of highway tunnel brightness. It can be connected to a dashcam for brightness detection, solving the problem of high cost and high barriers to entry caused by the need for additional professional brightness detection instruments and image acquisition equipment when vehicles enter and exit tunnels. This eliminates the reliance on professional brightness detection instruments for brightness detection during vehicle movement, building all-weather driving safety protection based on the existing general-purpose dashcam. It can respond in real-time to changes in the brightness of the driving environment, reducing potential driving risks caused by sudden brightness changes when vehicles enter and exit tunnels. Simultaneously, by acquiring driving images through the vehicle's dashcam, deployment costs are reduced, and continuous 24 / 7 video capture ensures the real-time and continuous nature of the data, providing scientifically reliable continuous driving environment data for proactive safety warnings in tunnels, and achieving continuous quantitative assessment of the driving environment.
[0105] The beneficial effects of this invention are: This invention uses a dashcam to capture changes in ambient light in real time. When the brightness at the tunnel entrance or exit exceeds a safety threshold, an audible and visual alarm is immediately triggered, allowing the driver to take timely safety measures such as slowing down during the visual adaptation period, thereby reducing the risk of collisions caused by blurred vision.
[0106] This invention utilizes existing vehicle equipment, such as a dashcam, to achieve professional-grade safety monitoring. By analyzing the dashcam video stream using a brightness prediction model, it eliminates the reliance on specialized brightness detection instruments found in traditional technologies. This allows ordinary vehicles to obtain accurate brightness monitoring capabilities without modification, lowering the deployment threshold and cost of tunnel safety protection.
Claims
1. A vehicle-mounted real-time monitoring and early warning system for brightness in highway tunnels, characterized in that, include: The data acquisition module is used to acquire tunnel brightness test data through real vehicle driving experiments; The image preprocessing module is used to acquire the tunnel RGB image of the vehicle based on the tunnel brightness test data, and to preprocess the tunnel RGB image to obtain a seven-dimensional spatiotemporal feature vector. The brightness recognition and monitoring module is used to establish a video-based tunnel brightness recognition model based on tunnel brightness test data and a seven-dimensional spatiotemporal feature vector, and to extract the tunnel brightness value through the tunnel brightness recognition model. The threshold generation and early warning module is used to classify brightness indicators based on tunnel brightness values using an improved clustering algorithm, obtain dangerous brightness thresholds for tunnels, and issue early warnings based on these thresholds. The vehicle-mounted integrated module is used to connect the tunnel brightness recognition model and the tunnel dangerous brightness threshold to the vehicle for real-time monitoring and early warning of highway tunnel brightness. The seven-dimensional spatiotemporal feature vector includes: Global white pixel ratio is used to reflect the overall brightness level of the preprocessed black-and-white image of tunnel traffic. The top white pixel ratio is used to quantize the sky reflection area in the preprocessed black-and-white image of the tunnel traffic; The proportion of white pixels at the bottom is used to quantize the ground reflective areas in the preprocessed black-and-white image of tunnel traffic. The centroid of the white pixel's vertical coordinate is used to describe the vertical distribution of the white area in the preprocessed black-and-white image of tunnel traffic. The percentage of the largest connected region is used to identify sky blocks in the preprocessed black-and-white image of tunnel traffic. Top brightness change rate, used to capture the dynamic changes in brightness of the pre-processed black-and-white image of tunnel traffic; The standard deviation of white pixel distribution is used to distinguish between natural light and artificial light source in the pre-processed black and white image of tunnel traffic. The brightness recognition and monitoring module includes: The data alignment unit is used to align the tunnel brightness test data and the seven-dimensional spatiotemporal feature vector with timestamps to obtain data samples. The model building unit is used to establish a real-time brightness detection model based on a multilayer perceptron. The model training unit is used to train the real-time brightness detection model based on data samples to obtain the tunnel brightness recognition model. The brightness value extraction unit is used to process the tunnel brightness test data using the tunnel brightness recognition model to obtain the tunnel brightness value. The expression for the tunnel brightness recognition model is as follows: in, The tunnel brightness prediction value is output by the tunnel brightness recognition model. This is the output layer weight matrix. For the output of the time fusion layer, For the bias of the output layer, The size of the time window. For time indexing, for The output of the feature extraction layer at time step 1. The output of the feature extraction layer, For activation function, This is the weight matrix of the fully connected layer. It is a seven-dimensional spatiotemporal feature vector. The bias of the feature extraction layer; The training of the real-time brightness detection model specifically includes: Based on the data samples, obtain the actual value of tunnel brightness and the predicted value of tunnel brightness output by the real-time brightness detection model; The loss function of the real-time brightness detection model is calculated based on the actual and predicted values of tunnel brightness. Based on the loss function of the real-time brightness detection model, the weight parameters of the real-time brightness detection model are updated through the backpropagation algorithm, and the final weight parameters of the real-time brightness detection model are obtained by combining the gradient calculation acceleration algorithm and the freezing mechanism. The final weight parameters are used as the model parameters for the real-time brightness detection model to complete the training of the real-time brightness detection model and obtain the tunnel brightness recognition model.
2. The vehicle-mounted real-time monitoring and early warning system for highway tunnel brightness according to claim 1, characterized in that, The image preprocessing module includes: The image acquisition unit is used to acquire RGB images of vehicles traveling through the tunnel based on tunnel brightness test data. The color conversion unit is used to convert the RGB image of the tunnel vehicle into the HSV image of the tunnel vehicle, and to extract the brightness channel of the HSV image of the tunnel vehicle to obtain the grayscale image of the tunnel vehicle. The threshold calculation unit is used to dynamically calculate the optimal segmentation threshold of the tunnel traffic grayscale image based on the Otsu algorithm. The binarization processing unit is used to binarize the grayscale image of the tunnel traffic according to the optimal segmentation threshold to obtain a black and white image of the tunnel traffic. The morphological processing unit is used to obtain a binary image of the tunnel traffic from the black-and-white image of the tunnel traffic through median filtering, erosion operation and dilation operation; The seven-dimensional feature calculation unit is used to calculate the seven-dimensional spatiotemporal feature vector based on the tunnel traffic binary map.
3. The vehicle-mounted real-time monitoring and early warning system for highway tunnel brightness according to claim 1, characterized in that, The expression for the global white pixel ratio is as follows: in, The global white pixel ratio, This represents the number of white pixels in the binary image of the tunnel traffic. The width of the binary image of the tunnel traffic. The height of the tunnel traffic binary diagram; The expression for the top white pixel ratio is as follows: in, The ratio of the top white pixels, This represents the number of white pixels in the top 30% area of the binary image of the tunnel traffic. The expression for the bottom white pixel ratio is as follows: in, The ratio of the bottom white pixels. This represents the number of white pixels in the bottom 30% area of the binary image of the tunnel traffic. The expression for the centroid of the white pixel's ordinate is as follows: in, The centroid of the white pixel's vertical coordinate. For the first The ordinate of each white pixel. For pixel index; The expression for the percentage of the largest connected region is as follows: in, The percentage of the largest connected region. To obtain the maximum area value among all connected regions, For the first The area of each connected region; The expression for the top brightness change rate is as follows: in, The rate of change of brightness at the top. for The ratio of the top white pixels at any given moment. for The ratio of the top white pixels at any given moment. and All are time-indexed; The expression for the standard deviation of the white pixel distribution is as follows: in, The standard deviation of the white pixel distribution. For the first The horizontal coordinate of each white pixel. This is the average of the horizontal coordinates of all white pixels.
4. The vehicle-mounted real-time monitoring and early warning system for highway tunnel brightness according to claim 1, characterized in that, The threshold generation and early warning module includes: The standardization unit is used to standardize the tunnel brightness value to obtain a standardized tunnel brightness value. Clustering units are used to calculate the distance between a sample and the cluster center based on a clustering algorithm according to the standardized tunnel brightness value, assign the sample to the nearest cluster, update the cluster center, and obtain the dangerous clusters; The threshold calculation unit is used to calculate the tunnel hazard brightness threshold based on the hazard clusters. The tunnel hazard brightness threshold includes a global brightness threshold, a top brightness threshold, and a brightness change threshold. The early warning execution unit is used to issue early warnings for different states based on the global brightness threshold, the top brightness threshold, and the brightness change threshold.
5. The vehicle-mounted real-time monitoring and early warning system for highway tunnel brightness according to claim 4, characterized in that, The expression for the dangerous cluster is as follows: in, For indexes of dangerous clusters, The global white pixel ratio, The sample set corresponding to the index of the dangerous cluster. To identify the category with the lowest proportion of white pixels, For the updated number The center of each cluster, To be assigned to the The set of all samples in a cluster For the first The number of samples in each cluster To find the distance smallest value, For the sample with cluster The square of the Euclidean distance between the centers For the first The standardized feature vector of each sample. For the first The coordinates of the center point of each cluster For standardized tunnel brightness values, For the first The first sample Each tunnel brightness value, For all samples in the first The average value of each indicator For all samples in the first The standard deviation of each indicator.
6. The vehicle-mounted real-time monitoring and early warning system for highway tunnel brightness according to claim 4, characterized in that, The different warning states specifically include: in, Warnings for different states, For time indexing, This is a dangerous situation. In a warning state, For safety reasons, for The global white pixel ratio at any given time. for The ratio of the top white pixels at any given moment. The global brightness threshold for dangerous conditions. The top brightness threshold for a dangerous state. for The change in the proportion of the top white pixels at any given moment. The threshold for brightness change in warning status. To calculate the 0.05 quantile of the dataset, To calculate the 0.95 quantile of the dataset, For the first The proportion of global white pixels in each sample. For the first The proportion of the top white pixels of each sample. For the first The proportion of the top white pixels of each sample. The sample set corresponding to the index of the dangerous cluster. To be assigned to the The set of all samples in a cluster.