A vehicle center sampling and graph neural network feature fusion-based car light adaptive control method and a control system using the same
By using a method that combines vehicle-centric sampling with graph neural network feature fusion, the problems of insufficient motion perception, single decision-making, and insufficient environmental perception in adaptive headlight control technology in low-speed scenarios are solved, thereby achieving greater accuracy and adaptability in headlight control and improving nighttime driving safety and comfort.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ELECTRICITY FACILITIES GUANGRI GUANGZHOU CO LTD
- Filing Date
- 2026-04-08
- Publication Date
- 2026-07-14
AI Technical Summary
Existing adaptive headlight control technology suffers from problems such as insufficient motion perception accuracy in low-speed scenarios, a single dimension of headlight control decision-making, lack of contextual awareness, and a disconnect between depth perception and headlight control.
By employing a method that combines vehicle center sampling with graph neural network feature fusion, and through target detection, RAFT optical flow calculation, graph neural network feature extraction, and monocular depth estimation, combined with multilayer perceptron mapping, dynamic adjustment of vehicle headlight control parameters is achieved, including adaptive adjustment of horizontal illumination angle, vertical illumination angle, high beam brightness, low beam brightness, and high beam cutoff line position.
It improves the accuracy of motion perception in low-speed scenarios, reduces the risk of rear-end collisions, reduces the false trigger rate of headlight control, adapts to dynamic changes in complex traffic environments, achieves precise lighting adjustment, and improves the safety and comfort of nighttime driving.
Smart Images

Figure CN122392011A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent vehicle lighting control technology, and in particular to an adaptive vehicle lighting control method based on vehicle center sampling and graph neural network feature fusion, and a control system using the same. Background Technology
[0002] With the rapid development of intelligent driving technology, adaptive headlight systems and adaptive high beam systems have become key technologies for improving nighttime driving safety. However, existing technologies have significant shortcomings in the following aspects:
[0003] In congested traffic scenarios (vehicle speed < 5 km / h), the relative displacement of the vehicle in front is extremely small. Traditional motion estimation methods based on optical flow lack sufficient pixel-level motion information, making it difficult to accurately capture low-speed relative motion. This leads to delays in headlight mode switching and poses a risk of rear-end collisions. Existing methods typically set a fixed speed threshold (e.g., 5 km / h), and directly disable the adaptive function below this threshold, creating blind spots in low-speed scenarios.
[0004] Traditional solutions primarily rely on taillight brightness thresholds or simple geometric features to determine headlight switching, failing to adequately consider changes in the posture of the vehicle ahead (such as steering or braking), ambient light interference (reflections from oncoming headlights and streetlights), and the semantic relationships between headlight geometric features. This single-dimensional decision-making mechanism leads to a high false trigger rate, and frequent switching between high and low beams not only affects the driving experience but may also cause glare to vehicles ahead and oncoming traffic.
[0005] Existing systems often focus on feature extraction from the target vehicle itself, neglecting contextual awareness of the surrounding environment. In complex scenarios such as curves, slopes, and multi-vehicle interactions, they cannot dynamically adjust the headlight illumination area based on road curvature, the movement of neighboring vehicles, and pedestrian distribution, resulting in insufficient or excessive lighting coverage.
[0006] Although some advanced systems have introduced depth estimation modules, there is a lack of linkage mechanism between depth information and lighting control parameters, which fails to achieve adaptive illumination distance adjustment based on vehicle distance. This can easily cause glare when following other vehicles at close range, and insufficient lighting when following other vehicles at long distances. Summary of the Invention
[0007] The main problems that this invention needs to solve are insufficient motion perception accuracy in low-speed scenes, a single dimension of vehicle headlight control decision-making, lack of contextual environment perception, and a disconnect between depth perception and headlight control.
[0008] To address the aforementioned technical problems, one aspect of this application provides a vehicle headlight adaptive control method based on vehicle center sampling and graph neural network feature fusion, comprising the following steps:
[0009] S1: Obtaining the bounding box of the vehicle in front: The bounding box information of the vehicle in front in the current frame image is obtained using an object detection network;
[0010] S2: Adaptive Expanding Cropping: Using the bounding box center obtained in the previous step as a reference, crop the current frame and the previous frame image according to the adaptive expansion factor;
[0011] S3: Temporally aligned sampling: Using the same spatial coordinates as the current frame for the previous frame image, a temporally aligned ROI region is obtained;
[0012] S4: RAFT optical flow calculation: Input the time-aligned ROI region into the RAFT optical flow estimation network to calculate the dense optical flow map;
[0013] S5: ROIAlign Dimensionality Reduction: The dense optical flow map is reduced in dimension by ROIAlign to obtain the dimension-reduced optical flow map;
[0014] S6: Graph Neural Network Feature Extraction: Divide the dimensionality-reduced optical flow map into spatial blocks as graph nodes, construct a weighted adjacency matrix based on spatial proximity and motion similarity, aggregate node features through a multi-layer graph convolutional network, and output context-aware features; extract the geometric features of the headlights of the vehicle in front, and concatenate them with the context-aware features to form a joint feature vector;
[0015] The weighted adjacency matrix constructed based on spatial proximity and motion similarity includes:
[0016] Calculate the spatial distance between nodes ;
[0017] Calculate the movement distance between nodes ;
[0018] edge weight ,in For spatial bandwidth, For motion bandwidth;
[0019] S7: Monocular Depth Estimation and Vehicle Distance Calculation: The current vehicle distance, vehicle speed, and road pitch angle predicted by the monocular depth estimation network are fused with the joint feature vector and mapped by a multilayer perceptron to obtain the vehicle headlight control parameters;
[0020] S8: Adaptive headlight control: Dynamically adjusts the horizontal and vertical beam angles, high beam brightness, low beam brightness, high beam cutoff position, and fog light fill beam width based on headlight control parameters.
[0021] According to an embodiment of this application, step S1 specifically includes the following steps:
[0022] S11: Obtain the bounding box information of the vehicle in front in the current frame image through the object detection network: The object detection network is a YOLOv8n network architecture, fine-tuned using the BDD100K night driving dataset based on the COCO pre-trained weights. The detection head outputs a set of bounding boxes of the vehicle in front, B. t ={B t1 B t2 ,...,B tn},
[0023] The i-th bounding box is denoted as B. t i =(x t i ,y t i ,w t i ,h t i ,c t i ), (x t i ,y t i ) represents the center pixel coordinates of the bounding box, w t i h t i These represent the bounding box width and height, respectively, c t i ∈[0,1] represents the confidence score;
[0024] S12: Select the bounding box with the highest confidence level as the primary target B. t =(x t ,y t ,w t ,h t When c tmax When the value is less than 0.7, it is determined that there is no valid target, and the system maintains the default lighting mode.
[0025] According to an embodiment of this application, step S2 specifically includes the following steps: using the center of the bounding box (x t ,y t Based on the baseline, the coordinates of the clipping region are calculated using an adjustable expansion factor α. The value of the adaptive expansion factor α is determined according to the vehicle speed v. ego Dynamic adjustment, the calculation formula is:
[0026]
[0027] The coordinates of the cropping region rectangle are calculated as follows:
[0028] ,
[0029] Among them, Wimg H img These represent the image width and height, respectively.
[0030] According to an embodiment of this application, in step S3, the cropped region is uniformly scaled and adjusted to a resolution of 256×256 pixels using a bilinear interpolation algorithm to ensure that the ROIs of the two frames are strictly aligned at the pixel level.
[0031] According to embodiments of this application, the RAFT optical flow estimation network includes the following components:
[0032] Feature encoder: Uses 6 residual blocks to extract multi-scale features, outputting a feature map of 256×256×256;
[0033] 4D related volume construction: Calculate the visual similarity between all pixel pairs to construct the 4D related volume. ;
[0034] The iterative update operator employs gated cyclic units to optimize the optical flow estimation, with 12 iterations. Each update retrieves relevant volumes based on the current optical flow estimation and calculates the update increment.
[0035] The RAFT network outputs an optical flow graph. The first channel u represents the horizontal pixel displacement, and the second channel v represents the vertical pixel displacement, with the unit being pixels per frame.
[0036] According to an embodiment of this application, step S6 specifically includes the following steps:
[0037] S61: Graph Node Construction: The reduced optical flow graph F is divided into N non-overlapping spatial blocks, with default configurations p=4 and q=4, resulting in a total of N=p×q=16 graph nodes; the i-th node vi corresponds to the coordinate region row in the optical flow graph. i =⌊i / q⌋,col i =imodq,x start =coli×8,x end =(col i +1)×8,y start =row i ×8, y end =(row i +1)×8; Node feature vector x i ∈R 6 The following was obtained by calculating the optical flow vector within this region:
[0038] ,
[0039] in,
[0040]
[0041] Statistic The same calculation applies;
[0042] S62: Adjacency Matrix Construction: Construct a weighted adjacency matrix A∈R based on spatial proximity and motion similarity. N ×N Node v i With v j The edge weight A between them ij Calculated as:
[0043]
[0044] Spatial distance distance of movement Spatial bandwidth σ s =2.0, motion bandwidth σ m =0.5;
[0045] S63: Graph Convolutional Feature Aggregation: A 3-layer graph convolutional network is used for node feature aggregation, and a normalized adjacency matrix is defined.
[0046] ;
[0047] The convolution operation for the l-th layer graph is:
[0048]
[0049] Where H (0) =X∈R N×6 Let W be the initial node feature matrix. (l) ∈R dl×dl+1 The learnable weight matrix has dimensions configured as [6, 128], [128, 128], and [128, 128], with σ(⋅) as the ReLU activation function. Each layer is followed by LayerNorm normalization and Dropout, with a Dropout ratio of 0.1. The output is the feature matrix H of the third layer nodes. (3) ∈R 16×128 Graph-level features are obtained through global average pooling: ;
[0050] S64: Geometric Feature Extraction of Vehicle Lights: Extracting the geometric feature vector g∈R of the front taillight region using image processing algorithms. 8 Specifically, it includes:
[0051] (1) Taillight region segmentation: In the ROI image Rt, the taillight mask M is extracted based on the HSV color thresholds H∈[0,10]∪[160,180], S>0.6, and V>0.3. tail ;
[0052] (2) Contour detection: Canny edge detection and contour tracking are used to obtain the taillight contour Ctail, and the aspect ratio of the bounding rectangle of the contour is calculated. ;
[0053] (3) LED particle detection: for mask M tail Perform distance transformation and local maximum detection to identify LED light-emitting particles and calculate the average spacing:
[0054] ,
[0055] Where, p i Let these be the coordinates of the center of the i-th LED particle;
[0056] (4) Brake light status recognition: Based on brightness change detection and frequency domain analysis, determine the brake light activation state s brake ∈{0,1}, the frequency range for frequency domain analysis is 3-5Hz;
[0057] (5) Area ratio calculation: Calculate the ratio of the taillight area to the ROI area:
[0058] ;
[0059] (6) Construction of geometric eigenvectors: g=[r aspect ,d LED ,s brake ,r area ,μ hue ,σ hue ,μ sat ,μ val ]T, where μ hue σ hue For mask M tail Mean and standard deviation of inner hue, μ sat μ val For mask M tail Mean values of internal saturation and brightness;
[0060] S65: Feature Fusion: The GNN output features h GNN Concatenated with the geometric feature g, forming a joint feature vector z=[h GNN ;g]∈R 136 .
[0061] According to an embodiment of this application, step S7 specifically includes the following steps:
[0062] S71: Deep Network Forward Inference: Transform the original image I tThe input consists of a deep network with an encoder-decoder architecture. The encoder uses a Swing Transformer Tiny network as its backbone to extract multi-scale features f1, f2, f3, and f4, with resolutions of 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the original image, respectively. The decoder employs progressive upsampling and skip connections, combined with NeWCRFs for dense prediction refinement, outputting a depth map D∈R with the same resolution as the input image. H×W ;
[0063] S72: Vehicle Distance Calculation: Include the boundary box of the preceding vehicle B t Project onto the depth map and extract the set of depth values D = {D(x,y)|(x,y)∈B} of all pixels within the bounding box. t Median filtering is used to suppress outliers, and the average vehicle distance d = median(D) is calculated.
[0064] S73: Uncertainty Quantification: Synchronously output a depth uncertainty map Σ∈RH×W, representing the model's confidence in depth prediction; the formula for calculating vehicle distance uncertainty is:
[0065] ,
[0066] When σ d When the distance is greater than 3m, the estimated distance is marked as low confidence and its weight in subsequent control decisions is reduced.
[0067] According to embodiments of this application, the adaptive headlight control method further includes an emergency braking warning step, an anti-glare feedback control step, and a cornering advance lighting step. The emergency braking warning step includes: monitoring the inter-frame variation rate of the vertical component of the optical flow in the taillight area. ,when When the brake lights change from inactive to active, it is determined to be an emergency braking event; this triggers a high-frequency flashing warning from the vehicle's taillights, forcibly switches to low beam mode and deflects the light away from the vehicle in front, while simultaneously sending a pre-preparation signal to the automatic emergency braking system; the anti-glare feedback control steps include: detecting the intensity of reflected light in the rearview mirror area of adjacent vehicles using a forward-facing camera. ;when And current vehicle distance At this time, a closed-loop PID control law is used to adjust the low beam brightness, allowing only a decrease in brightness and prohibiting an increase in brightness via PID control. The curve preview lighting steps include: estimating road curvature using the fusion of steering wheel angle and lane detection methods, obtaining the fused curvature through Kalman filtering; calculating the preview distance based on preview time and vehicle speed, and obtaining the preview lighting angle. Where κ=1.5 is the aiming coefficient; aim the main headlights toward the inside of the curve, activate the fog lights on the outside of the curve to supplement the light, and dynamically adjust the position of the ADB high beam cutoff line to avoid illuminating the oncoming lane.
[0068] Another aspect of this application employs a vehicle headlight adaptive control method based on vehicle center sampling and graph neural network feature fusion, as described above, comprising a perception layer, a processing layer, and an execution layer.
[0069] The perception layer includes vehicle cameras, gyroscopes, photosensors, and the CAN bus;
[0070] The processing layer includes: an object detection module for detecting the bounding box of the preceding vehicle; a vehicle center sampling module for adaptive expansion and cropping based on the bounding box center; a RAFT optical flow estimation module for calculating the dense optical flow map of the ROI region; a GNN feature extraction module for constructing the graph structure and aggregating contextual features; a depth estimation module for predicting the current vehicle distance and uncertainty; a headlight control decision module for fusing multi-source features and outputting control parameters; and a headlight execution module, including an LED driver, LED matrix, stepper motor, and taillight controller, for executing headlight angle and brightness adjustment.
[0071] The execution layer includes LED drivers, LED matrices, stepper motors, and taillight controllers.
[0072] According to an embodiment of this application, the vehicle lighting control decision module further includes: an emergency braking warning submodule, used to trigger a warning response based on optical flow mutation and brake light status detection; an anti-glare feedback submodule, used to adjust the low beam brightness in a closed loop based on reflected light intensity monitoring; and a curve advance lighting submodule, used to adjust the illumination angle based on road curvature estimation.
[0073] The advantages of the present invention over the prior art are:
[0074] This invention addresses four core technical problems existing in current adaptive headlight control technology. Through innovative designs involving vehicle-center sampling, graph neural network feature fusion, and multi-module collaborative control, it achieves breakthroughs in each area, resulting in the following significant benefits: effectively improving nighttime driving safety, comfort, and control accuracy, as detailed below:
[0075] I. Address the issue of insufficient motion perception accuracy in low-speed scenarios to reduce rear-end collision safety hazards.
[0076] To address the issues of motion-brightness ambiguity, high detection errors, and long mode switching delays in congested following scenarios (relative speed of the vehicle in front is less than 5 km / h), traditional optical flow methods suffer from small pixel displacements, resulting in motion-brightness ambiguity. This invention employs a collaborative scheme of "adaptive expansion and pruning + temporal alignment sampling + RAFT optical flow calculation + ROIAlign dimensionality reduction" to significantly improve motion perception accuracy in low-speed scenarios. Adaptive expansion and pruning dynamically adjusts the expansion factor based on the vehicle's speed to ensure sufficient capture of details in the area of the vehicle in front at low speeds. Temporal alignment sampling ensures strict pixel-level alignment between two frames of ROIs, avoiding feature loss due to excessively small displacements. The RAFT optical flow network, optimized through 12 GRU iterations, can accurately detect minute displacements of less than 1 pixel / frame. Combined with ROIAlign dimensionality reduction to filter noise, the relative speed detection error is ultimately controlled within 15%, and the headlight mode switching delay is reduced to less than 300ms. This effectively avoids rear-end collision safety hazards in low-speed following scenarios and improves the timeliness of headlight control response in low-speed scenarios.
[0077] Second, address the issue of a single decision-making dimension in vehicle lighting control, reduce false triggering rate, and improve driving experience.
[0078] To address the problems of existing solutions relying solely on single features for binary classification decisions, lacking multi-feature semantic associations, and exhibiting high false trigger rates, this invention innovatively introduces Graph Neural Network (GNN) feature fusion technology to construct a joint feature vector of "optical flow motion features + taillight geometric features," enriching the dimensions of control decisions. GNN achieves accurate extraction of the preceding vehicle's posture and motion trends through joint modeling of spatial proximity and motion similarity, while taillight geometric features capture detailed information such as taillight shape, LED distribution, and brake light status. The fusion of these two features establishes semantic associations between multiple features, replacing the traditional decision-making mode based on a single threshold or simple geometric features. Practice shows that this solution can reduce the false trigger rate of vehicle headlight control from 12.3% to below 5%, avoiding the degradation of the driving experience caused by frequent false switching, while also reducing the risk of glare due to false triggers, thus balancing driving comfort and safety.
[0079] III. Addressing the lack of contextual awareness and adapting to dynamic changes in complex traffic environments.
[0080] To address the problems of traditional methods that treat the preceding vehicle as an isolated target, ignore contextual information, and fail to adapt to complex scenarios, this invention constructs a multi-dimensional context-aware system to achieve adaptive lighting control across all scenarios. On one hand, it captures the motion correlation between the preceding vehicle and the surrounding area through GNN feature fusion, identifying the motion state of neighboring vehicles. On the other hand, it adds a road curvature estimation module, fusing steering wheel angle and lane line detection information to achieve pre-aiming lighting on curves. Simultaneously, it combines an anti-glare feedback control module to detect reflected light from neighboring vehicle rearview mirrors and an emergency braking warning module to capture the braking state of the preceding vehicle, comprehensively integrating contextual information such as the preceding vehicle, neighboring vehicles, and road curvature. This design effectively solves the problems of insufficient or excessive lighting coverage in curves, slopes, and multi-vehicle interaction scenarios, enabling vehicle headlight control to dynamically adapt to changes in complex traffic environments and improving the rationality of lighting across all scenarios.
[0081] Fourth, address the disconnect between depth perception and lighting control to achieve precise lighting adjustment in conjunction with vehicle distance.
[0082] To address the issues of existing independent operation of depth estimation and lighting control, lack of joint optimization of vehicle distance information, and problems such as glare or insufficient lighting, this invention deeply integrates the monocular depth estimation module with the vehicle lighting control module, establishing a linkage optimization mechanism for vehicle distance and lighting parameters. Monocular depth estimation employs a Swing Transformer Tiny backbone network combined with NeWCRFsrefine to accurately output the distance to the vehicle ahead and quantify the uncertainty. The vehicle distance information is directly input into the MLP mapping module, participating in the joint calculation of horizontal / vertical illumination angles, high and low beam brightness, and high beam cutoff position. Simultaneously, a vehicle distance-brightness linkage constraint is added to ensure reasonable low beam brightness (avoiding glare, Threshold Increment ≤ 30%) when following a vehicle at a close distance of 30m, and sufficient lighting intensity (road surface illuminance ≥ 2 lux) at a distance of 100m. This achieves adaptive illumination distance and brightness adjustment based on vehicle distance, completely resolving the disconnect between depth perception and lighting control, and balancing anti-glare and lighting effects. Attached Figure Description
[0083] Figure 1 This is an example of the overall architecture diagram of a control system employing a vehicle headlight adaptive control method based on vehicle center sampling and graph neural network feature fusion, as an example of the present invention.
[0084] Figure 2 The flowchart for extracting vehicle headlight geometric features, as an example of the present invention, is a detailed flowchart for extracting vehicle headlight geometric features;
[0085] Figure 3 This is a hierarchical diagram of the system software architecture and data flow as an example of the present invention. Detailed Implementation
[0086] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0087] Please see Figures 1 to 3 As shown, this invention discloses an adaptive headlight control method based on vehicle center sampling and graph neural network feature fusion, and a control system using the same, belonging to the field of intelligent driving assistance technology. The method includes: using the detected front vehicle bounding box as the center, cropping the current frame and the previous frame image according to an adaptive expansion factor to construct a Region of Interest (ROI) with the vehicle as the reference frame; using a RAFT network to calculate a dense optical flow graph of the ROI region, and inputting it into a GNN after dimensionality reduction via ROIAlign; dividing the optical flow graph into spatial blocks as graph nodes, constructing a weighted adjacency matrix based on spatial proximity and motion similarity, and aggregating contextual awareness features of the front vehicle and surrounding environment through a three-layer GCN; combining the GNN output features, headlight geometric features, and vehicle distance predicted by a monocular depth estimation network, dynamically adjusting the headlight horizontal / vertical illumination angle, high beam brightness, low beam brightness, ADB cutoff line position, and fog light supplementary lighting area via MLP mapping. This invention also includes emergency braking warning, anti-glare PID feedback, and cornering pre-aiming lighting submodules. This invention, through multi-module collaborative design and technological innovation, comprehensively addresses the four core pain points of existing adaptive vehicle lighting control technology, achieving precise low-speed motion perception, multi-dimensional control decision-making, comprehensive environmental perception, and integrated deep control. It significantly improves the safety, comfort, and intelligence of nighttime driving, and has good engineering application value and promotion prospects.
[0088] One aspect of this application discloses a vehicle lighting adaptive control method based on the fusion of vehicle center sampling and graph neural network features, comprising the following steps:
[0089] S1: Obtaining the bounding box of the vehicle in front: The bounding box information of the vehicle in front in the current frame image is obtained using an object detection network;
[0090] Specifically, step S1 includes the following steps:
[0091] S11: Obtain the bounding box information of the vehicle in front in the current frame image through the object detection network: The object detection network is a YOLOv8n network architecture, fine-tuned using the BDD100K night driving dataset based on the COCO pre-trained weights. The detection head outputs a set of bounding boxes of the vehicle in front, B. t ={B t1 B t2 ,...,B tn}, where the i-th bounding box is denoted as B t i =(x t i ,y t i ,wt i ,h t i ,c t i ), (x t i ,y t i ) represents the center pixel coordinates of the bounding box, w t i h t i These represent the bounding box width and height, respectively, c t i ∈[0,1] represents the confidence score;
[0092] S12: Select the bounding box with the highest confidence level as the primary target B. t =(x t ,y t ,w t ,h t When c tmax When the value is less than 0.7, it is determined that there is no valid target, and the system maintains the default lighting mode.
[0093] S2: Adaptive Expanding Cropping: Using the bounding box center obtained in the previous step as a reference, crop the current frame and the previous frame image according to the adaptive expansion factor;
[0094] Specifically, step S2 includes the following steps: using the center of the bounding box (x t ,y t Based on the baseline, the coordinates of the clipping region are calculated using an adjustable expansion factor α. The value of the adaptive expansion factor α is determined according to the vehicle speed v. ego Dynamic adjustment, the calculation formula is:
[0095]
[0096] The coordinates of the cropping region rectangle are calculated as follows:
[0097]
[0098]
[0099] Among them W img H img These represent the image width and height, respectively.
[0100] S3: Temporally aligned sampling: Using the same spatial coordinates as the current frame for the previous frame image, a temporally aligned ROI region is obtained;
[0101] Specifically, in step S3, the cropped region is uniformly scaled and adjusted to a resolution of 256×256 pixels using a bilinear interpolation algorithm to ensure that the ROIs of the two frames are strictly aligned at the pixel level.
[0102] S4: RAFT optical flow calculation: Input the time-aligned ROI region into the RAFT optical flow estimation network to calculate the dense optical flow map;
[0103] Specifically, the RAFT optical flow estimation network includes the following components:
[0104] Feature encoder: Uses 6 residual blocks to extract multi-scale features, outputting a feature map of 256×256×256;
[0105] 4D Relevant Volume Construction: Calculate the visual similarity between all pixel pairs to construct the 4D relevant volume C∈R. 256 ×256×256×256 ;
[0106] Looping update operator: Gated loop unit is used to iteratively optimize optical flow estimation. The number of iterations is 12. Each update is based on the current optical flow estimation to retrieve relevant volumes and calculate the update increment.
[0107] The RAFT network output optical flow graph The first channel u represents the horizontal pixel displacement, and the second channel v represents the vertical pixel displacement, with the unit being pixels per frame.
[0108] S5: ROIAlign dimensionality reduction: The dense optical flow map is reduced in dimensionality by ROIAlign to obtain the dimensionality-reduced optical flow map;
[0109] Specifically, the ROIAlign operation is used to downsample the optical flow map to a resolution of 32×32. This involves uniformly dividing the 256×256 optical flow map into 32×32 bins, each bin being 8×8 pixels in size. Bilinear interpolation is used to sample the center point and four neighboring points of each bin, and the mean value is calculated as the output value for that bin, resulting in the reduced-dimensional optical flow map F′∈R. 32×32×2 .
[0110] S6: Graph Neural Network Feature Extraction: Divide the dimensionality-reduced optical flow map into spatial blocks as graph nodes, construct a weighted adjacency matrix based on spatial proximity and motion similarity, aggregate node features through a multi-layer graph convolutional network, and output context-aware features; extract the geometric features of the headlights of the vehicle in front, and concatenate them with the context-aware features to form a joint feature vector;
[0111] The weighted adjacency matrix constructed based on spatial proximity and motion similarity includes:
[0112] Calculate the spatial distance between nodes ;
[0113] Calculate the movement distance between nodes ;
[0114] edge weight ,in For spatial bandwidth, This represents the motion bandwidth.
[0115] Specifically, extracting the geometric features of the front vehicle's headlights includes: extracting the taillight mask based on HSV color space threshold segmentation, calculating the taillight aspect ratio, average spacing of LED particles, brake light activation status, taillight area ratio, and color statistical features to form an 8-dimensional geometric feature vector.
[0116] Specifically, such as Figure 2 As shown, step S6 specifically includes the following steps:
[0117] S61: Graph Node Construction: The reduced optical flow graph is divided into non-overlapping spatial blocks, with default configurations p=4 and q=4, resulting in the construction of N=p×q=16 graph nodes; the i-th node v i Corresponding coordinate region in the optical flow diagram: row i =(i / q), col i =imodq,x start =col i ×8, x end =(col i +1)×8,y start =row i ×8, y end =(row i +1)×8; Node feature vector x i ∈R 6 The following was obtained by calculating the optical flow vector within this region:
[0118] ,
[0119] in,
[0120]
[0121] Statistic The same calculation applies;
[0122] S62: Adjacency Matrix Construction: Construct a weighted adjacency matrix A∈R based on spatial proximity and motion similarity. N ×N Node v i With v j The edge weight A between them ij Calculated as:
[0123]
[0124] Spatial distance distance of movement Spatial bandwidth σ s =2.0, motion bandwidth σ m =0.5;
[0125] S63: Graph Convolutional Feature Aggregation: A 3-layer graph convolutional network is used for node feature aggregation, defining a normalized adjacency matrix.
[0126]
[0127] The convolution operation of the l-th layer graph is as follows:
[0128] ,
[0129] Where H (0) =X∈R N×6 Let W be the initial node feature matrix. (l) ∈R dl×dl+1 The learnable weight matrix has dimensions configured as [6, 128], [128, 128], and [128, 128], with σ(⋅) as the ReLU activation function. Each layer is followed by LayerNorm normalization and Dropout, with a Dropout ratio of 0.1. The output is the feature matrix H of the third layer nodes. (3) ∈R 16×128 Graph-level features are obtained through global average pooling: .
[0130] S64: Geometric Feature Extraction of Vehicle Lights: Extracting the geometric feature vector g∈R of the front taillight region using image processing algorithms. 8 Specifically, it includes:
[0131] (1) Taillight region segmentation: In the ROI image R t In the process, the taillight mask M is extracted based on the HSV color thresholds H∈[0,10]∪[160,180], S>0.6, and V>0.3. tail ;
[0132] (2) Contour detection: Canny edge detection and contour tracking are used to obtain the taillight contour C. tail Calculate the aspect ratio r of the bounding rectangle of the outline. aspect =w bbox / h bbox ;
[0133] (3) LED particle detection: for mask M tail Perform distance transformation and local maximum detection to identify LED light-emitting particles and calculate the average spacing: Where pi is the center coordinate of the i-th LED particle;
[0134] (4) Brake light status recognition: Based on brightness change detection and frequency domain analysis, determine the brake light activation state s brake ∈{0,1}, the frequency range for frequency domain analysis is 3-5Hz;
[0135] (5) Calculation of area ratio: Calculate the ratio of the taillight area to the ROI area. ;
[0136] (6) Construction of geometric eigenvectors: g=[r aspect ,d LED ,s brake ,r area ,μ hue ,σ hue ,μ sat ,μ val ]T, where μ hue σ hue For mask M tail Mean and standard deviation of inner hue, μ sat μ val For mask M tail Mean values of internal saturation and brightness;
[0137] S65: Feature Fusion: The GNN output features h GNN Concatenated with the geometric feature g, forming a joint feature vector z=[h GNN ;g]∈R 136 .
[0138] S7: Monocular Depth Estimation and Vehicle Distance Calculation: The current vehicle distance, vehicle speed, and road pitch angle predicted by the monocular depth estimation network are fused with the joint feature vector and mapped by a multilayer perceptron to obtain the vehicle headlight control parameters;
[0139] Specifically, step S7 includes the following steps:
[0140] S71: Deep Network Forward Inference: The original image It is input into a deep network with an encoder-decoder architecture. The encoder uses the Swing Transformer Tiny as the backbone network to extract multi-scale features f1, f2, f3, and f4, with resolutions of 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the original image, respectively. The decoder uses progressive upsampling and skip connections, combined with NeWCRFs for dense prediction refinement, and outputs a depth map D∈R with the same resolution as the input image. H×W ;
[0141] S72: Vehicle Distance Calculation: Include the boundary box of the preceding vehicle B tProject onto the depth map and extract the set of depth values D = {D(x,y)|(x,y)∈B} of all pixels within the bounding box. t Median filtering is used to suppress outliers, and the average vehicle distance d = median(D) is calculated.
[0142] S73: Uncertainty Quantization: Synchronous Output of Deep Uncertainty Map Σ∈R H×W The reliability of the model for depth prediction is represented by ; the vehicle distance uncertainty is calculated as . When σ d When the distance is greater than 3m, the estimated distance is marked as low confidence and its weight in subsequent control decisions is reduced.
[0143] S8: Adaptive headlight control: Dynamically adjusts the horizontal and vertical beam angles, high beam brightness, low beam brightness, high beam cutoff position, and fog light fill beam width based on headlight control parameters.
[0144] Specifically, step S8 includes the following steps:
[0145] S81: Control parameter definition. Define the headlight control parameter vector = The physical meaning and range of values for each parameter are as follows:
[0146] parameter symbol unit Range of values Physical meaning Horizontal illumination angle <![CDATA[θ h ]]> Spend [−15,15] The horizontal deflection angle of the headlights relative to the vehicle's longitudinal axis is positive for right deflection and negative for left deflection. Vertical illumination angle θv Spend [−5,5] The pitch angle of the headlights relative to the horizontal plane is positive for upward tilt and negative for downward tilt. High beam brightness percentage <![CDATA[L high ]]> % [0,100] The PWM duty cycle of the high beam headlight assembly is 0% for off and 100% for full power. Near beam brightness percentage <![CDATA[L low ]]> % [20,100] The low beam headlight assembly maintains a minimum PWM duty cycle of 20% to ensure basic lighting. High beam cutoff line position <![CDATA[x cutoff ]]> Normalized coordinates [0,1] In the ADB function, the horizontal position of the high beam cutoff line in the dark area is 0 for the leftmost side and 1 for the rightmost side. Fog light fill light width <![CDATA[w fog ]]> Normalized width [0,1] The angle width coefficient of the fog light activation area: 0 for off, 1 for maximum angle of 30°.
[0147] S82: Multilayer Perceptron Mapping: Constructing a multilayer perceptron (MLP) establishes a mapping relationship from input features to control parameters, where the input vector x... MLP =[z;d;v ego ϕ pitch ]∈R 139 The specific meanings and acquisition methods of each component are as follows: z is the output 128-dimensional reduced optical flow feature vector, obtained by PCA dimensionality reduction processing of the image captured by the forward-looking camera; d is the distance between the vehicle and the vehicle in front, detected in real time by millimeter-wave radar, in meters; v ego This is the vehicle's speed, obtained from the onboard OBD interface, in km / h. This is the road pitch angle compensation amount measured by the gyroscope, in degrees. It is used to eliminate the influence of road slope on the headlight illumination angle. It is collected in real time by the gyroscope and then filtered before being input.
[0148] The MLP network structure is as follows:
[0149] h1=ReLU(W1x MLP +b1), W1∈R 256×139 ;
[0150] h2 = ReLU(W2h1 + b2), W2 ∈ R 128×256 ;
[0151] c raw =W3h2+b3, W3∈R 6×128 .
[0152] S83: Control Parameter Constraints and Smoothing: Performs physical constraints and timing smoothing on the raw output craw of the MLP, specifically including:
[0153] 1) Hard constraint clipping:
[0154] For each control parameter C raw,i (i=1,2,...,6), set upper and lower threshold values C according to the vehicle headlight hardware performance and safety specifications. i,min and C i,max The clip function is used for cropping, and the cropping formula is c. i =clip(c raw , i ,c i ,min,c i,max ); among which, near-beam brightness L low The upper and lower limits are 0%-100%, and the high beam brightness L high The upper and lower limits are 0%-100%, and the horizontal illumination angle θ h The upper and lower limits are -10° to 10°, and the vertical illumination angle θ v The upper and lower limits are -5° to 5°, and the fog light fill light width is w. fog The upper and lower limits are 0-1.0, and the cutoff line position of the high beam dark area is x. cutoff The upper and lower limits are 0-100px.
[0155] c raw i, c i,min c i,max The lower and upper limits of the value range for each parameter;
[0156] 2) Timing smoothing filter:
[0157] To prevent light flickering caused by sudden changes in control parameters, a first-order low-pass filter is used to smooth the clipped control parameters. The filter formula is as follows:
[0158] ,
[0159] The smoothing coefficient γ = 0.7 is used to prevent sudden changes in control parameters from causing light flickering.
[0160] 3) Vehicle distance-brightness linkage constraint:
[0161] To avoid dazzling the vehicle in front due to excessive low beam brightness, the low beam brightness (L) is adjusted based on the distance between this vehicle and the vehicle in front. low Apply linkage constraints, with the constraint formula being L. low≤ min(100, 30 / d × 100)%; In specific implementation, when the vehicle distance d < 30m, the low beam brightness decreases as the vehicle distance decreases, with a maximum not exceeding 100%; when the vehicle distance d ≥ 30m, the low beam brightness can reach 100%, ensuring the low beam lighting effect while avoiding glare to the driver of the vehicle in front.
[0162] In this embodiment, a vehicle headlight adaptive control method based on vehicle center sampling and graph neural network feature fusion further includes an emergency braking warning step, an anti-glare feedback control step, and a curve pre-aiming lighting step.
[0163] Specifically, the emergency braking warning steps include: monitoring the inter-frame variation rate of the vertical component of the optical flow in the taillight area. ,when When the brake light status changes from inactive to active, it is determined to be an emergency braking; the high-frequency flashing of the taillights is triggered, the vehicle is forced to switch to low beam low brightness mode and the beam angle is turned away from the vehicle in front, while a pre-preparation signal is sent to the automatic emergency braking system.
[0164] Specifically, the anti-glare feedback control steps include: detecting the intensity of reflected light in the area of the rearview mirror of a neighboring vehicle using a forward-facing camera. ;when And current vehicle distance At this time, a closed-loop PID control law is used to adjust the low beam brightness, allowing only a decrease in brightness and prohibiting an increase in brightness via PID control. .
[0165] Specifically, the curve preview lighting steps include: estimating road curvature using the steering wheel angle method and the lane line detection method, and obtaining the fused curvature through Kalman filtering; calculating the preview distance based on the preview time and the vehicle speed to obtain the preview lighting angle. Where κ=1.5 is the aiming coefficient; aim the main headlights toward the inside of the curve, activate the fog lights on the outside of the curve to supplement the light, and dynamically adjust the position of the ADB high beam cutoff line to avoid illuminating the oncoming lane.
[0166] Specifically, the emergency braking warning method based on optical flow abrupt changes includes the following steps:
[0167] Step 1: Implementation of optical flow monitoring in the taillight area:
[0168] 1) Taillight region localization: The resolution of the dimensionality reduction optical flow map F is 32×32. The taillight mask Mtail (resolution 1920×1080) in the original image is obtained by image scaling and mapping. The corresponding region in the 32×32 optical flow map is a rectangular region Btail containing the taillight of the preceding vehicle. Its coordinates are determined by scaling the boundary coordinates of the mask Mtail.
[0169] 2) Optical flow statistical feature extraction: Extraction region B tail Given the vertical optical flow component v(x,y) within the region (y-axis direction, upward is positive), calculate the average value u of the vertical optical flow component within this region. vtail , calculation formula ;
[0170] Among them, |B tail |For region B tail The number of pixels within the frame, v(x,y) is the vertical optical flow component at the (x,y) coordinate in the optical flow map, in pixels / frame; this average value is used to characterize the overall vertical motion trend of the taillight area of the front vehicle.
[0171] Step 2: Implementation of Braking Sudden Change Detection
[0172] 1) Calculation of inter-frame change rate: Calculate the absolute value of the average vertical optical flow of the taillight region at the current time t and the previous time t-1, and use it as the inter-frame change rate Δv(t). The calculation formula is as follows: ;
[0173] Where, μ vtail (t) represents the average vertical optical flow at the current time t. The average vertical optical flow is the value of the previous time step t-1, and the unit is pixels per frame.
[0174] 2) Emergency braking determination: Set an emergency braking determination threshold T brake =0.5 pixels / frame, this threshold corresponds to an actual vehicle deceleration of approximately 3 m / s². 2 This conforms to the typical deceleration range for emergency braking; simultaneously, the braking status signal s of the preceding vehicle is introduced. brake (t) (obtained by millimeter-wave radar or image recognition, s) brake (t)=1 indicates that the vehicle in front is braking, s brake (t)=0 indicates that the vehicle in front has not braked); the logic for determining emergency braking is:
[0175]
[0176] That is, when the rate of change of vertical optical flow between frames exceeds the threshold and the vehicle in front switches from non-braking state to braking state, it is determined to be emergency braking and a warning response is triggered.
[0177] Step 3: Implementation of Early Warning Response
[0178] The specific implementation process is as follows:
[0179] 1) Vehicle headlight adjustment: The vehicle controller sends a command to the headlight controller via the CAN bus to immediately switch the vehicle headlights to low beam mode (if currently in high beam mode), and simultaneously adjusts the low beam brightness to L. lowThe glare should be forcibly reduced to 40% to prevent strong light from affecting the driver's vision; the horizontal beam angle should be adjusted to θ. h The steering wheel deflects 3° away from the vehicle in front, further reducing glare and adjusting the response time to ≤100ms.
[0180] 2) High-frequency taillight flashing: The vehicle controller sends a command to the taillight controller via the CAN bus to trigger the high-frequency taillight flashing mode. The flashing frequency is 3Hz, the duty cycle is 70% (i.e., the light is on for 70% of the time and off for 30%), and the flashing duration is 2 seconds. This flashing mode can quickly remind vehicles behind to pay attention to the emergency braking status of this vehicle and reduce the risk of rear-end collision.
[0181] 3) AEB pre-preparation: The on-board controller sends a pre-preparation signal to the Automatic Emergency Braking (AEB) system. After receiving the signal, the AEB system immediately enters a standby state, shortening the braking response time (from the usual 50ms to 30ms). If a collision risk is subsequently detected, the braking can be triggered quickly, further improving driving safety.
[0182] Specifically, the steps of the anti-glare feedback control method based on reflected light monitoring are as follows:
[0183] Step 1: Implementation of Reflection Detection for Neighboring Vehicle Rearview Mirrors
[0184] The vehicle controller analyzes and detects the intensity of reflected light in the area of the rearview mirror of adjacent vehicles by using images captured by the forward-facing camera, providing a basis for glare determination. The specific implementation process is as follows:
[0185] 1) Location of adjacent vehicle rearview mirror: First, the edge contour of the adjacent vehicle's side window area is detected using an image edge detection algorithm (Canny algorithm). Combined with the geometric constraints of the side window (rectangular outline, aspect ratio 2:1-3:1), the side window area is determined. Then, within the side window area, the approximate position of the rearview mirror is determined based on its typical position (front of the side window, near the door) and geometric features (circular or rectangular, size approximately 1 / 5-1 / 4 of the side window).
[0186] 2) Mirror Highlight Detection: A mirror highlight detection algorithm is used to detect mirror highlight spots (circular or elliptical areas with significantly higher brightness than the surrounding area and clear edges) within the located rearview mirror area; the brightness value I of the highlight spot is calculated. spot (Unit: cd / m) 2 ) and area A spot (unit: pixel) 2 The brightness value is obtained by converting the image grayscale value (the conversion factor between grayscale value and brightness value is 0.8);
[0187] 3. Estimation of reflected light intensity: Based on the brightness and area of the specular highlight, estimate the reflected light intensity I of the rearview mirror.ref The calculation formula is Where k is the specular reflection coefficient, which is calibrated through multiple experiments to adapt to common automotive rearview mirror materials (glass mirror, chrome-plated mirror).
[0188] Step S2: Dazzle detection implementation:
[0189] The vehicle controller determines whether there is a risk of glare based on the intensity of reflected light and the distance between the vehicle and adjacent vehicles. The specific implementation process is as follows:
[0190] Set a glare threshold (this threshold is calibrated based on human eye glare tolerance experiments; when the intensity of reflected light exceeds this threshold, it will cause significant glare to the driver of the adjacent vehicle); set a safe following distance d. safe = 50m (when the distance between vehicles is less than this value, the impact of reflected light on adjacent vehicles is more significant); the glare determination condition is: I ref > I th ∧d <d saf When both of the above conditions are met simultaneously, it is determined that there is a risk of glare, and the closed-loop PID brightness adjustment is triggered; otherwise, the adjustment is not triggered, and the current low beam brightness is maintained.
[0191] Step S603: Implementation of closed-loop PID brightness adjustment
[0192] The vehicle controller constructs a closed-loop PID control system based on low beam brightness and reflected light intensity. By adjusting the low beam brightness, the risk of glare is eliminated. The specific implementation process is as follows:
[0193] 1) Error calculation: Calculate the current reflected light intensity I ref The difference between Iref(t) and the glare threshold Tth is used as the error e(t) of the PID control, calculated as e(t) = Iref(t) - Ith. When there is a risk of glare, e(t) > 0, and the low beam brightness needs to be reduced to decrease the intensity of reflected light.
[0194] 2) PID control law calculation: The positional PID control algorithm is adopted, and the control law formula is:
[0195] ;
[0196] The parameters are set as follows: proportional coefficient K p = 0.5% / (cd / m 2 ), used for rapid response to changes in error; integral coefficient K i = 0.1% / (cd / m 2 ⋅s), used to eliminate steady-state error; differential coefficient K d = 0.2%⋅s / (cd / m 2This is used to suppress overshoot and prevent excessively frequent brightness adjustments; the control period Δt = 33ms (30Hz), consistent with the sensor sampling period;
[0197] 3) Brightness Adjustment Calculation: To ensure safety, only reducing the low beam brightness is permitted; increasing brightness via PID control is prohibited. Therefore, the PID output u(t) is clipped to obtain the brightness adjustment ΔLlow. The clipping formula is as follows: The brightness adjustment range is -20% to 0%, with each adjustment reducing the brightness by no more than 20% to avoid sudden drops in brightness affecting the driver's visibility. The vehicle controller sends the brightness adjustment amount to the headlight controller, which adjusts the low beam brightness in real time until the reflected light intensity reaches I. ref ≤I th The closed-loop control has ended.
[0198] Specifically, the implementation process of the curve pre-aiming lighting method based on curvature estimation is as follows:
[0199] Step S701: Road curvature estimation implementation:
[0200] 1.) Steering wheel angle method for estimating curvature: The vehicle controller obtains the steering wheel angle δ (unit: rad, clockwise is positive, counterclockwise is negative) via the CAN bus, and combines it with the vehicle's speed v. ego (Unit: m / s) Calculate the road curvature C δ The calculation formula is:
[0201]
[0202] This method can quickly obtain curvature estimates and has a fast response speed, but it is greatly affected by steering system errors.
[0203] 2) Lane line detection method for curvature estimation: The onboard controller uses the road image acquired by the forward-looking camera to detect lane lines using Hough transform, and fits the quadratic curve of the lane line y = ax 2 + bx + c (x is the horizontal coordinate, y is the vertical coordinate); Calculate the road curvature C according to the quadratic curve curvature formula. lane The calculation formula is:
[0204] ;
[0205] Here, x is taken as the horizontal coordinate 50m ahead of the vehicle to ensure that the curvature estimation fits the current driving road; this method has high estimation accuracy, but is greatly affected by lighting and lane line clarity;
[0206] 3) Kalman Filter Fusion Estimation: The two curvature estimates mentioned above are fused using a Kalman filter. The fusion formula is as follows:
[0207] ,
[0208] Wherein, the fusion coefficient K f =0.6 (through experimental calibration, taking into account the advantages of both methods and reducing the error of a single method); based on the curvature C after fusion fused Calculate the radius of curvature R curve = 1 / |C fused (Unit: m); Curve direction is from C fused The sign is determined, C fused >0 indicates a left turn, C fused <0 indicates a right turn.
[0209] Step 2: Pre-aiming angle calculation implementation:
[0210] 1) Pre-aiming distance calculation: Set the pre-aiming time T preview =30ms (set based on vehicle speed and system response delay to ensure timely aiming), based on the vehicle's speed v ego (Unit: m / s) Calculate the aiming distance d preview The calculation formula is dpreview = v ego T preview The aiming distance is the distance the vehicle travels within 30ms, used to determine the target area for aiming illumination.
[0211] 2) Calculation of geometric preview angle: Based on the radius of curvature Rcurve and the preview distance dpreview, calculate the geometric preview angle θgeo. The formula is as follows:
[0212] ;
[0213] This angle is the theoretical aiming angle, used to characterize the angle at which the lights need to be deflected to illuminate the inside of the curve.
[0214] 3. Determination of Actual Pre-aiming Angle: Considering system delays (lighting adjustment delay, sensor sampling delay) and the driver's visual perception requirements, a pre-aiming coefficient K=1.5 is introduced (through experimental calibration to ensure the pre-aiming angle closely matches the actual driving scenario); the actual pre-aiming angle θ curve The formula for calculating θ is curve =k.θ ego .sign(C fused ); where sign(C fused The curvature sign function ensures that the aiming angle direction is consistent with the curve direction; at the same time, the aiming angle is constrained to an effective range. To avoid excessive angles that could cause abnormal lighting.
[0215] Step 3: Implementation of zoned lighting control:
[0216] 1) Main headlight pre-aiming rotation: The vehicle controller sends a command to the headlight controller via the bus to adjust the horizontal illumination angle θ of the main headlights (low beam / high beam). h Overlaying the aiming angle θ curve , i.e. θ′ h =θ h +θ curve This allows the main headlights to be aimed at the inside of the curve in advance, illuminating the road ahead of the curve and helping the driver to spot obstacles in the curve ahead of time;
[0217] 2) Fog light fill light activation: When the pre-aiming angle is |θ curve |>1 ∘ When the curve has a large curvature, activate the fog lights on the outer side of the curve for supplemental lighting; the formula for calculating the supplemental lighting width wfog is wfog=min(1.0,|θ curve | / 5 。 That is, the fill light width increases with the increase of the pre-aiming angle, with a maximum fill light width of 1.0 (fully activated) and a minimum fill light width of 0.2 (when the pre-aiming angle is 1°), ensuring that the fill light range can cover the blind spot outside the curve.
[0218] 3) Dynamic adjustment of high beam cutoff line: When the vehicle is in high beam mode (ADB function is enabled), the vehicle controller adjusts the high beam cutoff line in the dark area. cutoff Position it, shift it to the outside of the curve, the shift amount is related to the aiming angle θ curve Proportional (offset = 0.5 × |θ) curve |px); avoid shining high beams into oncoming lanes to prevent glare for oncoming drivers, while ensuring the high beam illumination effect on the inside of the curve.
[0219] Another aspect of this application, such as Figure 1 , Figure 3 As shown, a control system employing the above-mentioned vehicle-center sampling and graph neural network feature fusion adaptive control method for vehicle lights is disclosed, including a perception layer, a processing layer and an execution layer;
[0220] The perception layer includes vehicle cameras, gyroscopes, photosensors, and the CAN bus;
[0221] The processing layer includes:
[0222] The target detection module is used to detect the bounding box of the vehicle in front.
[0223] The vehicle center sampling module is used to perform adaptive expansion and clipping based on the center of the bounding box;
[0224] The RAFT optical flow estimation module is used to calculate the dense optical flow map of the ROI region;
[0225] The GNN feature extraction module is used to construct the graph structure and aggregate contextual features;
[0226] The depth estimation module is used to predict the current vehicle distance and uncertainties;
[0227] The vehicle lighting control decision module is used to fuse multi-source features and output control parameters;
[0228] The vehicle lighting control module includes an LED driver, an LED matrix, a stepper motor, and a taillight controller, which are used to control the angle and brightness of the vehicle lights.
[0229] The execution layer includes LED drivers, LED matrices, stepper motors, and taillight controllers.
[0230] Specifically, the vehicle lighting control decision module also includes: an emergency braking warning submodule, used to trigger a warning response based on optical flow mutation and brake light status detection; an anti-glare feedback submodule, used to adjust the low beam brightness in a closed loop based on reflected light intensity monitoring; and a curve advance lighting submodule, used to adjust the illumination angle based on road curvature estimation.
[0231] Example 1: Standard Traffic Jam Following Scenario
[0232] This embodiment describes the system workflow in a standard following scenario with a vehicle speed of 0-30 km / h under congested road conditions.
[0233] After the vehicle starts, the system powers on and initializes, and each module loads the pre-trained model weights and establishes communication connections. The forward-facing camera continuously captures images of the road ahead at a frame rate of 30fps, with a resolution of 1920×1080 pixels. When the vehicle enters a congested area and the speed drops to 15km / h, the system activates the adaptive headlight control function.
[0234] The object detection module uses a YOLOv8n network for forward inference of the current frame image. This network is pre-trained on the COCO dataset and fine-tuned using the BDD100K nighttime driving dataset, with a learning rate of 1. e-4 The batch size is 16, and the training lasts for 50 epochs. The network outputs a set of bounding boxes for the preceding vehicle, and selects the bounding box with the highest confidence as the primary target. Assume that the coordinates of the detected bounding box for the preceding vehicle are B = (960, 540, 180, 140), where (960, 540) are the pixel coordinates near the center point of the image, 180 and 140 are the width and height of the bounding box, respectively, and the confidence level is c = 0.92.
[0235] The vehicle center sampling module receives the bounding box information and calculates the adaptive expansion factor based on the current vehicle speed v = 15 km / h. Using the formula α(vego) = 1.5 + 0.3 × (60 - v) / 60, α = 1.725 is calculated. The clipping region is then calculated using this expansion factor: x min =max(0,960-1.725×90)=805, y min =max(0,540-1.725×70)=419, x max =min(1920,960+1.725×90)=1115,y max =min(1080,540+1.725×70)=661. After cropping the current frame image, the size is changed to 256×256 pixels using bilinear interpolation to obtain the ROI region Rt. For the previous frame image I... t-1 Using identical coordinates for clipping ensures timing alignment, resulting in R. t-1 .
[0236] The RAFT optical flow estimation module receives temporal image pairs (Rt, Rt-1), extracts multi-scale features through a feature encoder, constructs a 4D related volume, and performs 12 iterations of optimization using a cyclic update operator. This module is trained sequentially on the FlyingChairs, FlyingThings, KITTI, and HD1K datasets, employing a step-decay learning rate strategy. The inference process takes approximately 18ms, and the output optical flow map F∈R... 256*256*2 This includes two channels: horizontal displacement u and vertical displacement v. Using the ROIAlign operation, the optical flow map is uniformly divided into 32×32 bins, each bin being 8×8 pixels in size. After bilinear interpolation sampling, a dimension-reduced optical flow map F,∈R is output. (32×32×2) .
[0237] The GNN feature extraction module divides the dimensionality-reduced optical flow map into 4×4=16 spatial blocks, with each block serving as a graph node. For node v5 (corresponding to the region in the 2nd row and 2nd column), the optical flow statistical features within this 8×8 pixel block are extracted: the mean horizontal displacement μ. u =0.15 pixels / frame, standard deviation σ u =0.08, maximum value max|u|=0.32; mean vertical displacement μ v = -0.05 pixels / frame, standard deviation σ v =0.06, maximum value max|v|=0.18. Construct a 6-dimensional node feature vector x5=[0.15,0.08,-0.05,0.06,0.32,0.18]T. Construct a weighted adjacency matrix based on spatial proximity and motion similarity, with spatial bandwidth σ. s =2.0, motion bandwidth σm =0.5. The edge weights of node v5 with its neighboring nodes v1, v4, v6, and v9 are 0.85, 0.90, 0.88, and 0.87, respectively, and the edge weights with its diagonal nodes v0 and v2 are 0.35 and 0.38, respectively, reflecting the modulating effect of motion consistency on adjacency relationships.
[0238] A three-layer GCN is used for feature aggregation, with each layer containing graph convolution, LayerNorm normalization, ReLU activation, and Dropout (ratio 0.1). The first layer maps the 6-dimensional input features to 128 dimensions, while the second and third layers maintain 128 dimensions. Graph convolution operations employ a spectral domain approach, using a normalized adjacency matrix D. (-1 / 2) AD (-1 / 2) After three layers of aggregation, global average pooling is performed on the output features of the 16 nodes to obtain a 128-dimensional graph-level feature h. GNN .
[0239] Simultaneously extract the geometric features of the vehicle lights. Convert the ROI image to the HSV color space, set color thresholds of hue H∈[0,10]∪[160,180], saturation S>0.6, and brightness V>0.3, and extract the taillight mask. Obtain the circumscribed rectangle of the taillight using Canny edge detection and contour tracking, and calculate the aspect ratio r. aspect =1.82. Distance transformation and local maximum detection were used to identify LED light-emitting particles. A total of 12 particles were detected, and the average spacing d was calculated. LED =14.5mm. The current brake light state (s) is determined through brightness abrupt change detection and frequency domain analysis. brake =0 (not activated). Calculate the taillight area ratio r. area =0.115, and hue mean μ hue =5.2, variance σ hue =2.1, mean saturation μ sat =0.78, mean lightness μ val =0.65. The concatenation forms an 8-dimensional geometric feature vector g=[1.82,14.5,0,0.115,5.2,2.1,0.78,0.65] T .
[0240] The depth estimation module uses the D-NeoNet network, with the original image I... t As input, a dense depth map is output through a Swing Transformer encoder and a NeWCRFs decoder. The bounding box of the preceding vehicle is projected onto the depth map, and the depth values of all pixels within the box are extracted. After median filtering to suppress outliers, the average vehicle distance d = 28.5m is calculated, with an uncertainty σ. d =1.2m.
[0241] GNN features hGNN Geometric features g, vehicle distance d, and vehicle speed v ego =15km / h and pitch angle compensation φ pitch =0.3° (measured by the gyroscope and low-pass filtered) are spliced together to form a 139-dimensional input vector x. mlp Through a three-layer MLP network: the first layer W1∈R 256*139 Mapped to 256 dimensions, the second layer W2∈R (128*256) Mapped to 128 dimensions, the third layer W3∈R (6*128) Output 6-dimensional control parameters. The original output is clipped due to physical constraints: horizontal angle θ. h =2.3° (rightward deviation, due to the car in front slightly deviating to the left), vertical angle θ v =-0.5° (compensation for road slope), high beam brightness L high =0% (Switch to low beam), Low beam brightness L low =65%, High Beam Cutoff Line Position x cutoff =0.5 (default value), fog light width w fog =0 (off). Since the vehicle distance d = 28.5m < 30m, the vehicle distance-brightness linkage constraint is triggered, L low Limited to 60%, θ h An additional 3° leftward deviation is applied to avoid glare. Finally, after timing smoothing filtering (γ=0.7), the control parameters are output to the headlight ECU.
[0242] The vehicle lighting ECU receives control parameters via the CAN bus and drives the TI TPS92661 LED driver chip at a 1kHz PWM frequency to adjust the brightness distribution of the 64-pixel LED matrix. The stepper motor adjusts the brightness distribution according to θ. h and θ v The headlight angle is adjusted with a positioning accuracy of 0.05° and a response time of 50ms. The system executes the above process in a 33ms cycle to achieve real-time adaptive lighting control.
[0243] Example 2: Emergency Braking Warning Scenario
[0244] This embodiment describes the workflow of the emergency braking warning submodule when the vehicle in front suddenly brakes.
[0245] During standard following, the system continuously monitors the optical flow characteristics of the taillight region. Assume that at time t-1, the mean vertical optical flow μ in the taillight region... v tail (t-1) = -0.08 pixels / frame (the negative sign indicates moving away from the trend), brake light status s brake (t-1)=0. At time t, the vehicle in front suddenly brakes, causing a sharp change in relative speed. RAFT optical flow estimation shows that the mean vertical optical flow in the taillight region abruptly changes to μ. vtail (t) = -2.45 pixels / frame, inter-frame change rate Δv(t) = |-2.45 - (-0.08)| = 2.37 pixels / frame. Simultaneously, image brightness abrupt change detection shows that the brightness value of the taillight area increases by 35% within 100ms, and frequency domain analysis shows that the 4.2Hz frequency component accounts for 75% of the energy, determining the brake light status s. brake (t)=1, and satisfies the 0→1 jump condition.
[0246] The emergency braking warning submodule is triggered, executing the following response sequence: First, a high-frequency flashing command is sent to the taillight controller via the CAN bus, triggering the vehicle's taillights to flash at a frequency of 3Hz and a 70% duty cycle for 2 seconds to warn following vehicles. Second, the headlight control decision module forcibly switches to low beam mode. high Immediately set to 0, L low The value rapidly decreases from its current value to 40% (bypassing the smoothing filter), θ h Turn 3° away from the vehicle in front (let's say to the left) to avoid dazzling the driver of the vehicle in front who is braking. Finally, send a pre-preparation signal to the Automatic Emergency Braking (AEB) system to shorten the braking response time by approximately 150ms.
[0247] Within 3 seconds of emergency braking, the system enters a high-sensitivity monitoring mode, with the optical flow rate of change threshold τ. brake Temporarily reduce the frame rate to 0.3 pixels / frame to capture minute motion changes of the vehicle in front. If it is determined that the vehicle in front has resumed movement (μ... v tail It rebounded to above -0.2 and s brake =0), the system gradually restores the standard lighting mode, L low It will smoothly recover to normal values at a rate of 5% per cycle.
[0248] Example 3: Anti-glare feedback control scenario
[0249] This embodiment describes the closed-loop adjustment process of the anti-glare feedback submodule when following a vehicle at close range.
[0250] Assuming the current vehicle distance d = 25m and the low beam brightness L = 60%, the system monitors the reflected light intensity in the adjacent vehicle's rearview mirror area using a forward-facing camera. The image processing algorithm detects a speckle of light on the mirror surface in the adjacent vehicle's side window area (located using geometric constraints) and calculates its brightness I. spot =8500cd / m 2 Area A spot =12 pixels, reflected light intensity estimation I ref =0.8×8500×12 / 100=81.6cd / m 2 (After normalization). Because I ref <120cd / m 2The glare threshold is set to maintain the current brightness.
[0251] Assume the vehicle in front decelerates, reducing the following distance to d=22m, and there is a slight downhill slope on the road, causing the headlights of the vehicle in front to shift upwards relatively. At this time, the intensity of the reflected light from the rearview mirror of the adjacent vehicle increases to I. ref =145cd / m 2 If the glare exceeds the glare threshold and d < 50m, anti-glare feedback control is triggered. The PID controller calculates the error e(t) = 145 - 120 = 25cd / m. 2 Proportional term K p e = 0.5 × 25 = 12.5%, integral term K i ·Σe(k)Δt=0.1×25×0.033≈0.08% (initial accumulation), differential term K d ·Δe / Δt=0.2×(25-0) / 0.033≈151.5% (Due to the initial trigger, the rate of change is large, and actual amplitude limiting is required). The control output u(t) after amplitude limiting is -15% (only a decrease is allowed), i.e., ΔL low =-15%. The current near beam brightness has decreased from 60% to 45%.
[0252] In the next cycle (after 33ms), the intensity of the reflected light is detected again, assuming it has decreased to I. ref =118cd / m 2 Error e(t) = -2cd / m 2 The PID output turns slightly positive, but is constrained to 0 (increasing brightness via PID is prohibited). The system maintains L... low =45%, until the intensity of reflected light naturally decreases due to increased vehicle distance or changes in road slope. When I ref <100cd / m 2 After five cycles (165ms), the brightness is allowed to slowly recover at a rate of 2% per cycle.
[0253] Example 4: Curve Pre-aiming Lighting Scenarios
[0254] This embodiment describes the pre-aiming lighting control process when a vehicle enters a curve.
[0255] Vehicles with v ego The vehicle is traveling at 45 km / h, with the right turn signal activated and the steering wheel angle δ = 18°. The system obtains δ and v via the CAN bus. ego Based on vehicle parameters (steering ratio i=16, wheelbase L) wheelbase =2.8m, insufficient turning coefficient K us =0.002s 2 / m 2 Calculate the curvature of the steering wheel angle method: C δ=18 / (16×2.8×(1+0.002×452 / 9.8 / 2.8))≈0.0040m −1 .
[0256] Meanwhile, the lane line detection module fits the right lane line as a quadratic curve y=0.0003x. 2 +0.02x+1.5 (vehicle coordinate system), calculate the lane curvature C. lane =2×0.0003 / (1+(2×0.0003×10+0.02)2) (3 / 2) ≈0.00058m -1 (At x=10m). Because the turn signal indicates a right turn, and C... δ With C lane With consistent signs, Kalman filtering is used for fusion: C fused =0.6×0.0040+0.4×0.00058≈0.0026m −1 radius of curvature R curve =1 / 0.0026≈385m, classified as a right turn (C) fused >0).
[0257] Calculate the aiming illumination angle: aiming distance d preview =45 / 3.6×0.033≈0.412m, geometric aiming angle θ geo =arctan(0.412 / 385)≈0.061°, pre-aiming coefficient κ=1.5, final pre-aiming angle θ curve =1.5×0.061°≈0.092°, and remains 0.092° after being constrained to the effective range.
[0258] Curve pre-aiming submodule output control strategy: Main headlight horizontal angle θ h Add θ to the original base. curve (0.092° to the right), fog light fill light width w fog =min(1.0,0.092 / 5)≈0.018 (the actual activation threshold is set to 0.1, so it is not activated for now), ADB high beam cutoff line position x cutoff =0.5-0.3×1=0.2 (deviate to the left on the outside of the curve to avoid illuminating the oncoming lane).
[0259] Assuming that after entering the curve, the steering wheel angle increases to δ=35°, the recalculated C is... fused ≈0.0078m, R curve ≈128m, θ curve ≈0.28°, at this time w fog =0.056 is still below the threshold. When δ=60°, C fused ≈0.0135m -1R curve ≈74m, θ curve ≈0.48°, w fog =0.096 is close to the threshold. When δ=75°, θ curve ≈0.62°, w fog =0.124>0.1, activate the right fog light, the fill light angle is about 3.7° (30°×0.124), covering the blind spot on the right side of the curve.
[0260] When exiting the curve, straighten the steering wheel angle, C fused Decrease when |θ curve If | < 0.05° and persists for 10 cycles (330ms), it is determined to be straight-line travel, θ curve Smoothly reset to zero, fog lights off, ADB cutoff line returns to center position x cutoff =0.5.
[0261] In summary, the technical solution of this application has the following beneficial effects:
[0262] I. Address the issue of insufficient motion perception accuracy in low-speed scenarios to reduce rear-end collision safety hazards.
[0263] To address the issues of motion-brightness ambiguity, high detection errors, and long mode switching delays in congested following scenarios (relative speed of the vehicle in front is less than 5 km / h), traditional optical flow methods suffer from small pixel displacements, resulting in motion-brightness ambiguity. This invention employs a collaborative scheme of "adaptive expansion and pruning + temporal alignment sampling + RAFT optical flow calculation + ROIAlign dimensionality reduction" to significantly improve motion perception accuracy in low-speed scenarios. Adaptive expansion and pruning dynamically adjusts the expansion factor based on the vehicle's speed to ensure sufficient capture of details in the area of the vehicle in front at low speeds. Temporal alignment sampling ensures strict pixel-level alignment between two frames of ROIs, avoiding feature loss due to excessively small displacements. The RAFT optical flow network, optimized through 12 GRU iterations, can accurately detect minute displacements of less than 1 pixel / frame. Combined with ROIAlign dimensionality reduction to filter noise, the relative speed detection error is ultimately controlled within 15%, and the headlight mode switching delay is reduced to less than 300ms. This effectively avoids rear-end collision safety hazards in low-speed following scenarios and improves the timeliness of headlight control response in low-speed scenarios.
[0264] Second, address the issue of a single decision-making dimension in vehicle lighting control, reduce false triggering rate, and improve driving experience.
[0265] To address the problems of existing solutions relying solely on single features for binary classification decisions, lacking multi-feature semantic associations, and exhibiting high false trigger rates, this invention innovatively introduces Graph Neural Network (GNN) feature fusion technology to construct a joint feature vector of "optical flow motion features + taillight geometric features," enriching the dimensions of control decisions. GNN achieves accurate extraction of the preceding vehicle's posture and motion trends through joint modeling of spatial proximity and motion similarity, while taillight geometric features capture detailed information such as taillight shape, LED distribution, and brake light status. The fusion of these two features establishes semantic associations between multiple features, replacing the traditional decision-making mode based on a single threshold or simple geometric features. Practice shows that this solution can reduce the false trigger rate of vehicle headlight control from 12.3% to below 5%, avoiding the degradation of the driving experience caused by frequent false switching, while also reducing the risk of glare due to false triggers, thus balancing driving comfort and safety.
[0266] III. Addressing the lack of contextual awareness and adapting to dynamic changes in complex traffic environments.
[0267] To address the problems of traditional methods that treat the preceding vehicle as an isolated target, ignore contextual information, and fail to adapt to complex scenarios, this invention constructs a multi-dimensional context-aware system to achieve adaptive lighting control across all scenarios. On one hand, it captures the motion correlation between the preceding vehicle and the surrounding area through GNN feature fusion, identifying the motion state of neighboring vehicles. On the other hand, it adds a road curvature estimation module, fusing steering wheel angle and lane line detection information to achieve pre-aiming lighting on curves. Simultaneously, it combines an anti-glare feedback control module to detect reflected light from neighboring vehicle rearview mirrors and an emergency braking warning module to capture the braking state of the preceding vehicle, comprehensively integrating contextual information such as the preceding vehicle, neighboring vehicles, and road curvature. This design effectively solves the problems of insufficient or excessive lighting coverage in curves, slopes, and multi-vehicle interaction scenarios, enabling vehicle headlight control to dynamically adapt to changes in complex traffic environments and improving the rationality of lighting across all scenarios.
[0268] Fourth, address the disconnect between depth perception and lighting control to achieve precise lighting adjustment in conjunction with vehicle distance.
[0269] To address the issues of existing independent operation of depth estimation and lighting control, lack of joint optimization of vehicle distance information, and problems such as glare or insufficient lighting, this invention deeply integrates the monocular depth estimation module with the vehicle lighting control module, establishing a linkage optimization mechanism for vehicle distance and lighting parameters. Monocular depth estimation employs a Swing Transformer Tiny backbone network combined with NeWCRFsrefine to accurately output the distance to the vehicle ahead and quantify the uncertainty. The vehicle distance information is directly input into the MLP mapping module, participating in the joint calculation of horizontal / vertical illumination angles, high and low beam brightness, and high beam cutoff position. Simultaneously, a vehicle distance-brightness linkage constraint is added to ensure reasonable low beam brightness (avoiding glare, Threshold Increment ≤ 30%) when following a vehicle at a close distance of 30m, and sufficient lighting intensity (road surface illuminance ≥ 2 lux) at a distance of 100m. This achieves adaptive illumination distance and brightness adjustment based on vehicle distance, completely resolving the disconnect between depth perception and lighting control, and balancing anti-glare and lighting effects.
[0270] The above are merely preferred embodiments of the present invention and are not intended to limit the implementation methods and protection scope of the present invention. Those skilled in the art should recognize that any equivalent substitutions and obvious changes made based on the description and illustrations of the present invention should be included within the protection scope of the present invention.
Claims
1. A vehicle headlight adaptive control method based on vehicle center sampling and graph neural network feature fusion, characterized in that, Includes the following steps: S1: Obtaining the bounding box of the vehicle in front: The bounding box information of the vehicle in front in the current frame image is obtained using an object detection network; S2: Adaptive Expanding Cropping: Using the bounding box center obtained in the previous step as a reference, crop the current frame and the previous frame image according to the adaptive expansion factor; S3: Temporally aligned sampling: Using the same spatial coordinates as the current frame for the previous frame image, a temporally aligned ROI region is obtained; S4: RAFT optical flow calculation: Input the time-aligned ROI region into the RAFT optical flow estimation network to calculate the dense optical flow map; S5: ROIAlign Dimensionality Reduction: The dense optical flow map is reduced in dimension by ROIAlign to obtain a dimension-reduced optical flow map; S6: Graph Neural Network Feature Extraction: The reduced-dimensional optical flow graph is divided into spatial blocks as graph nodes. A weighted adjacency matrix is constructed based on spatial proximity and motion similarity. Node features are aggregated through a multi-layer graph convolutional network to output context-aware features. Extract the geometric features of the headlights of the vehicle in front, and concatenate them with the context-aware features to form a joint feature vector; The construction of the weighted adjacency matrix based on spatial proximity and motion similarity includes: Calculate the spatial distance between nodes ; Calculate the movement distance between nodes ; edge weight ,in For spatial bandwidth, For motion bandwidth; S7: Monocular Depth Estimation and Vehicle Distance Calculation: The current vehicle distance, vehicle speed, and road pitch angle predicted by the monocular depth estimation network are fused with the joint feature vector, and the vehicle headlight control parameters are obtained by mapping through a multilayer perceptron. S8: Adaptive headlight control: Dynamically adjusts the horizontal illumination angle, vertical illumination angle, high beam brightness, low beam brightness, high beam cutoff line position, and fog light fill light width of the headlights according to the headlight control parameters.
2. The adaptive headlight control method based on vehicle center sampling and graph neural network feature fusion according to claim 1, wherein step S1 specifically includes the following steps: S11: Obtain the bounding box information of the vehicle in front in the current frame image through the object detection network: The object detection network is a YOLOv8n network architecture, fine-tuned using the BDD100K night driving dataset based on the COCO pre-trained weights, and the detection head outputs a set of bounding boxes of the vehicle in front, B. t ={B t1 B t2 ,...,B tn }, The i-th bounding box is denoted as B. t i =(x t i ,y t i ,w t i ,h t i ,c t i ), (x t i ,y t i ) represents the center pixel coordinates of the bounding box, w t i h t i These represent the bounding box width and height, respectively, c t i ∈[0,1] represents the confidence score; S12: Select the bounding box with the highest confidence level as the primary target B. t =(x t ,y t ,w t ,h t When c tmax When the value is less than 0.7, it is determined that there is no valid target, and the system maintains the default lighting mode.
3. The adaptive headlight control method based on vehicle center sampling and graph neural network feature fusion according to claim 1, characterized in that, Step S2 specifically includes the following steps: using the center of the bounding box Based on the vehicle speed v, the coordinates of the clipping region are calculated using an adjustable expansion factor α. The value of the adaptive expansion factor α is determined according to the vehicle speed v. ego Dynamic adjustment, the calculation formula is: , The coordinates of the cropping region rectangle are calculated as follows: , Among them, W img H img These represent the image width and height, respectively.
4. The adaptive headlight control method based on vehicle center sampling and graph neural network feature fusion according to claim 1, characterized in that, In step S3, the cropped region is uniformly scaled and adjusted to a resolution of 256×256 pixels using a bilinear interpolation algorithm to ensure that the ROIs of the two frames are strictly aligned at the pixel level.
5. The adaptive headlight control method based on vehicle center sampling and graph neural network feature fusion according to claim 1, characterized in that, The RAFT optical flow estimation network includes the following components: Feature encoder: Uses 6 residual blocks to extract multi-scale features, outputting a feature map of 256×256×256; 4D related volume construction: Calculate the visual similarity between all pixel pairs to construct the 4D related volume. ; The iterative update operator employs gated cyclic units to optimize the optical flow estimation, with 12 iterations. Each update retrieves relevant volumes based on the current optical flow estimation and calculates the update increment. The RAFT network outputs an optical flow graph. The first channel u represents the horizontal pixel displacement, and the second channel v represents the vertical pixel displacement, with the unit being pixels per frame.
6. The adaptive headlight control method based on vehicle center sampling and graph neural network feature fusion according to claim 1, characterized in that, Step S6 specifically includes the following steps: S61: Graph Node Construction: The reduced optical flow graph is divided into p×q non-overlapping spatial blocks, with default configurations of p=4 and q=4, resulting in the construction of N=p×q=16 graph nodes; the i-th node v i Corresponding coordinate region in the optical flow diagram: row i =⌊i / q⌋,col i =imodq,x start =col i ×8, x end =(col i +1)×8,y start =row i ×8, y end =(row i +1)×8; Node feature vector x i ∈R 6 The following was obtained by calculating the optical flow vector within this region: , in, , Statistic The same calculation applies; S62: Adjacency Matrix Construction: Construct a weighted adjacency matrix A∈R based on spatial proximity and motion similarity. N×N Node v i With v j The edge weight A between them ij Calculated as: , Where the spatial distance d ijs =(row i -row j ) 2 +(col i -col j ) 2 Distance d ijm =(μ ui -μ uj ) 2 +(μ vi -μ vj ) 2 Spatial bandwidth σ s =2.0, motion bandwidth σ m =0.5; S63: Graph Convolutional Feature Aggregation: A 3-layer graph convolutional network is used for node feature aggregation, and a normalized adjacency matrix is defined. ; The convolution operation for the l-th layer graph is: , Among them, H (0) =X∈R N×6 Let W be the initial node feature matrix. (l) ∈R dl×dl+1 The learnable weight matrix has dimensions configured as [6, 128], [128, 128], and [128, 128], with σ(⋅) as the ReLU activation function. Each layer is followed by LayerNorm normalization and Dropout, with a Dropout ratio of 0.
1. The output is the feature matrix H of the third layer nodes. (3) ∈R 16×128 Graph-level features are obtained through global average pooling. ; S64: Geometric Feature Extraction of Vehicle Lights: Extracting the geometric feature vector g∈R of the front taillight region using image processing algorithms. 8 Specifically, it includes: (1) Taillight region segmentation: In the ROI image Rt, the taillight mask M is extracted based on the HSV space color thresholds H∈[0,10]∪[160,180], S>0.6, and V>0.
3. tail ; (2) Contour detection: Canny edge detection and contour tracking are used to obtain the taillight contour C. tail Calculate the aspect ratio of the bounding rectangle of the outline. ; (3) LED particle detection: for mask M tail Distance transformation and local maximum detection are performed to identify LED light-emitting particles and calculate the average spacing. , Where, p i Let these be the coordinates of the center of the i-th LED particle; (4) Brake light status recognition: Based on brightness change detection and frequency domain analysis, determine the brake light activation state s brake ∈{0,1}, the frequency range for frequency domain analysis is 3-5Hz; (5) Calculation of area ratio: Calculate the ratio of the taillight area to the ROI area. ; (6) Construction of geometric eigenvectors: g=[r aspect ,d LED ,s brake ,r area ,μ hue ,σ hue ,μ sat ,μ val ]T, where μ hue σ hue For mask M tail Mean and standard deviation of inner hue, μ sat μ val For mask M tail Mean values of internal saturation and brightness; S65: Feature Fusion: The GNN output features h GNN Concatenated with the geometric feature g, forming a joint feature vector z=[h GNN ;g]∈R 136 .
7. The adaptive headlight control method based on vehicle center sampling and graph neural network feature fusion according to claim 1, characterized in that, Step S7 specifically includes the following steps: S71: Deep Network Forward Inference: Transform the original image I t The input consists of a deep network with an encoder-decoder architecture. The encoder uses a Swing Transformer Tiny network as its backbone to extract multi-scale features f1, f2, f3, and f4, with resolutions of 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the original image, respectively. The decoder employs progressive upsampling and skip connections, combined with NeWCRFs for dense prediction refinement, and outputs a depth map D∈R with the same resolution as the input image. H×W ; S72: Vehicle Distance Calculation: Include the boundary box of the preceding vehicle B t Project onto the depth map and extract the set of depth values D = {D(x,y)|(x,y)∈B} of all pixels within the bounding box. t Median filtering is used to suppress outliers, and the average vehicle distance d = median(D) is calculated. S73: Uncertainty Quantification: Synchronously output a depth uncertainty map Σ∈RH×W, representing the model's confidence in depth prediction; the formula for calculating vehicle distance uncertainty is... , When σ d When the distance is greater than 3m, the estimated distance is marked as low confidence and its weight in subsequent control decisions is reduced.
8. The adaptive headlight control method based on vehicle center sampling and graph neural network feature fusion according to claim 1, characterized in that, Further features include emergency braking warning procedures, anti-glare feedback control procedures, and cornering advance lighting procedures. The emergency braking warning steps include: monitoring the inter-frame variation rate of the vertical component of the optical flow in the taillight area. ,when When the brake light status changes from inactive to active, it is determined to be an emergency braking; the high-frequency flashing of the taillights is triggered, the vehicle is forced to switch to low beam low brightness mode and the beam angle is turned away from the vehicle in front, while a pre-preparation signal is sent to the automatic emergency braking system. The anti-glare feedback control steps include: detecting the intensity of reflected light in the area of the rearview mirror of a neighboring vehicle using a forward-facing camera. ;when And current vehicle distance At this time, a closed-loop PID control law is used to adjust the low beam brightness, allowing only a decrease in brightness and prohibiting an increase in brightness via PID control. ; The curve preview lighting step includes: estimating road curvature using a fusion method of steering wheel angle and lane line detection, and obtaining the fused curvature through Kalman filtering; calculating the preview distance based on the preview time and vehicle speed, and obtaining the preview lighting angle. Where κ=1.5 is the aiming coefficient; aim the main headlights toward the inside of the curve, activate the fog lights on the outside of the curve to supplement the light, and dynamically adjust the position of the ADB high beam cutoff line to avoid illuminating the oncoming lane.
9. A control system employing the vehicle headlight adaptive control method based on vehicle center sampling and graph neural network feature fusion as described in any one of claims 1-8, characterized in that, It includes a perception layer, a processing layer, and an execution layer. The perception layer includes vehicle cameras, gyroscopes, photosensors, and a CAN bus; The processing layer includes: The target detection module is used to detect the bounding box of the vehicle in front. The vehicle center sampling module is used to perform adaptive expansion and clipping based on the center of the bounding box; The RAFT optical flow estimation module is used to calculate the dense optical flow map of the ROI region; The GNN feature extraction module is used to construct the graph structure and aggregate contextual features; The depth estimation module is used to predict the current vehicle distance and uncertainties; The vehicle lighting control decision module is used to fuse multi-source features and output control parameters; The vehicle lighting control module includes an LED driver, an LED matrix, a stepper motor, and a taillight controller, which are used to control the angle and brightness of the vehicle lights. The execution layer includes an LED driver, an LED matrix, a stepper motor, and a taillight controller.
10. The control system according to claim 9, characterized in that, The vehicle lighting control decision module also includes: The emergency braking warning submodule is used to trigger a warning response based on optical flow mutation and brake light status detection; The anti-glare feedback submodule is used to adjust the near beam brightness in a closed loop based on the monitoring of reflected light intensity. The curve pre-aiming lighting submodule is used to estimate and adjust the illumination angle based on road curvature.