A helmet detection parameter optimization method and system based on environment adaptation

By using an environment-adaptive helmet detection parameter optimization method, environmental characteristics are analyzed in real time and detection parameters are dynamically adjusted, solving the problem of unstable detection accuracy under different environmental conditions and realizing high-precision helmet wearing status detection in complex environments.

CN120375126BActive Publication Date: 2026-02-24CHANGAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510426546.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2026-02-24
Estimated Expiration
2045-04-07

AI Technical Summary

Technical Problem

Existing helmet detection technologies have inconsistent detection accuracy under different environmental conditions, especially in low light, strong light, and rainy/foggy weather, making it impossible to achieve efficient helmet wearing monitoring.

Method used

By analyzing environmental characteristics in real time and dynamically adjusting detection parameters, an environment-adaptive helmet detection parameter optimization method is constructed, including environmental feature vector extraction, parameter configuration library, multi-dimensional detection quality assessment, and parameter optimization mechanism, to achieve adaptive detection for different environments.

Benefits of technology

It significantly improves the accuracy and stability of helmet detection, especially under extreme conditions such as low light, strong light, and rain and fog, where detection performance is greatly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120375126B_ABST
    Figure CN120375126B_ABST
Patent Text Reader

Abstract

The application discloses a helmet detection parameter optimization method and system based on environment self-adaption, comprising the following steps: S1, acquiring images and extracting environment feature vectors; S2, classifying different environment types according to the environment feature vectors and calculating confidence scores of each environment type; S3, establishing a parameter configuration library; S4, searching corresponding parameter groups from the parameter configuration library and adjusting parameters; S5, defining a multi-dimensional detection quality evaluation index system to obtain evaluation results and adjusting detection parameters in real time according to the evaluation results; S6, pre-processing the acquired images, performing helmet detection to obtain helmet detection results, and optimizing the helmet detection results after configuring a detection network; and S7, evaluating the detection performance of the evaluation index environment type, establishing a parameter optimization learning mechanism according to the evaluation results, and optimizing the parameter configuration library regularly. The accuracy and stability of the application are significantly improved under various complex environment conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and intelligent transportation, specifically to a method and system for optimizing helmet detection parameters based on environmental adaptation. Background Technology

[0002] With the increasing prevalence of electric bicycles, motorcycles, and other modes of transportation, helmet-wearing monitoring has become a crucial component of traffic safety management. Existing helmet detection technologies typically rely on computer vision and deep learning methods, but their accuracy is significantly affected by varying environmental conditions (such as changes in lighting and weather). Traditional methods often employ fixed parameters, making them ill-suited to complex and changing environments, resulting in unstable detection results.

[0003] For example, in low-light conditions, reduced image contrast makes helmet edge features less distinct, leading to a significant drop in detection accuracy. In strong light or rain / fog, overexposed or blurred images also increase the false detection rate. Existing technologies lack adaptive adjustment mechanisms and cannot intelligently optimize detection parameters for different environments, resulting in insufficient robustness of helmet detection systems in practical applications. Existing detection methods mainly fall into the following categories: 1. Fixed-parameter YOLO series methods: These methods use uniform detection parameters applicable to all environmental conditions. While fast, they exhibit poor stability in different environments, particularly prone to false detections and missed detections under complex lighting conditions. 2. Multi-model ensemble strategies: These methods train models separately for different environmental conditions, selecting the appropriate model based on the current environment. While improving accuracy, the large number of models and high system complexity make them unsuitable for resource-constrained edge device deployment. 3. Image enhancement and preprocessing methods: These methods improve image quality through image processing techniques such as HDR and adaptive contrast. However, these methods are typically only effective for specific environments and cannot systematically solve detection problems in multiple environments.

[0004] However, existing technologies have the following shortcomings: the optimal operating parameters of the detection algorithm vary significantly under different environmental conditions. For example, in nighttime scenes, the detector requires a lower confidence threshold to improve recall compared to daytime scenes; in rainy or foggy weather, a more powerful image preprocessing enhancement module is needed to improve feature quality. Detection accuracy cannot be guaranteed under different weather conditions.

[0005] Therefore, there is an urgent need to develop a method that can automatically adjust detection parameters according to different environmental conditions in order to improve the accuracy of helmet detection under various conditions. This invention addresses this need by proposing an environment-adaptive helmet detection parameter optimization method and system. Summary of the Invention

[0006] The purpose of this invention is to solve the problem of unstable detection accuracy of existing helmet detection technology under different environmental conditions, and to provide a helmet detection parameter optimization method based on environmental adaptation. By analyzing environmental characteristics in real time and dynamically adjusting detection parameters, high-precision helmet wearing status detection under different environmental conditions can be achieved to overcome the shortcomings of existing technologies.

[0007] To achieve the above objectives, the present invention provides the following technical solutions:

[0008] On the one hand, the present invention provides a helmet detection parameter optimization method based on environment adaptation, characterized by comprising the following steps:

[0009] S1, after acquiring the image and performing global statistical feature analysis on the image, the environmental feature vector is extracted;

[0010] S2, based on the environmental feature vector extracted in S1, classify the environmental conditions to obtain different environmental types, and calculate the confidence score of each environmental type;

[0011] S3, Establish a parameter configuration library for environment types and detection parameters, and preset different combinations of optimized parameter values ​​for each environment type;

[0012] S4. Based on the environment type classified in S2 and the confidence score corresponding to the environment type, retrieve the corresponding parameter group from the parameter configuration library established in S3 and adjust the parameters accordingly.

[0013] S5 defines a multi-dimensional quality assessment index system to obtain assessment results, and adjusts the testing parameters in real time based on the assessment results;

[0014] S6. After preprocessing the acquired image using the parameter set determined in S4, helmet detection is performed on the preprocessed image to obtain the helmet detection result. The helmet detection result is then optimized after configuring the detection network.

[0015] S7, the detection performance is evaluated based on the environmental type of the evaluation index to obtain the evaluation result, and the F1 score is determined based on the evaluation result. or stability index Adjust the parameter values ​​in the parameter configuration library according to the environment type, establish a learning mechanism for parameter optimization, and optimize the parameter configuration library regularly.

[0016] Furthermore, the process of obtaining the environmental feature vector in S1 is specifically as follows:

[0017] S1.1, Obtain the image captured by the traffic monitoring camera as the input image;

[0018] S1.2, Calculate the local brightness value of the image. Image contrast value Image blur And analyze the image color temperature value Density of weather elements ;

[0019] S1.3, divide the image into a 4×4 grid and calculate the local brightness for each grid. and contrast Special attention was paid to key areas such as the center of the road, and the brightness difference index between grids was calculated.

[0020] S1.4: Use a circular buffer to record the most recent 30 frames of images and calculate the brightness change rate of 10 consecutive frames. and contrast change rate After assessing environmental stability, an environmental feature vector is obtained.

[0021] Furthermore, the environment type mentioned in S2 includes a single environment type and a composite environment type. The specific process in S2 is as follows:

[0022] S2.1, the specific environmental types obtained by classifying environmental conditions include:

[0023] Sunny daytime: ;

[0024] Cloudy daytime: ;

[0025] Dawn and dusk: ;

[0026] at night: ;

[0027] rain: ;

[0028] Foggy days: ;

[0029] Light difference environment: brightness difference between grids ;

[0030] Standard condition: None of the above conditions are met;

[0031] The composite environment type is a combination of two or more of the above-mentioned single environment types;

[0032] S2.2, Calculate the confidence score for a single environment type using the sigmoid function:

[0033]

[0034] in, The confidence score is... The parameter for adjusting the steepness of the function curve is set to 2.0. This represents the actual value for the environment type. Determine the threshold for this environment type;

[0035] S2.3 uses conditional probability to calculate the combination probability of environment types; at the same time, an environment type priority matrix is ​​set to handle label conflicts. When multiple environment types meet the conditions at the same time, the environment type with higher priority is selected.

[0036] Furthermore, the establishment of the parameter configuration library in S3 specifically includes:

[0037] S3.1, Construct the image preprocessing parameter set Including brightness adjustment coefficient Contrast enhancement factor Gamma correction coefficient Noise reduction intensity and sharpening factor ;

[0038] S3.2, Construct the target detection parameter set Including confidence threshold Non-maximum suppression threshold Anchor frame size ratio and the number of feature extraction layers ;

[0039] S3.3, Construct the post-processing parameter set Including time smoothing coefficient Spatial consistency weight and multi-scale fusion ratio ;

[0040] S3.4, for a single environment type, preset different combinations of optimization parameter values;

[0041] S3.5, Design parameter interpolation mechanism, using a weighted fusion formula to calculate interpolation parameters for complex environment types:

[0042]

[0043] in, For environment type The confidence score, For the parameter group corresponding to the environment type, This is the sum of all confidence scores.

[0044] Furthermore, the dynamic parameter adjustment in S4 specifically includes:

[0045] S4.1, Based on the environmental classification results, retrieve the corresponding parameter group from the parameter configuration library;

[0046] S4.2, regarding confidence level For a single environment type, directly use the corresponding preset parameter group;

[0047] For confidence level For a single environment type, a parameter set is selected based on the similarity of the calculated environment types:

[0048] ;

[0049] in, This is the feature vector of the current environment. The template feature vector is from the parameter library. For scaling parameters;

[0050] For complex environment types, calculate the weighted average parameter value:

[0051]

[0052] in, For the first Confidence scores for each environmental type. For the corresponding parameter group, The sum of all confidence scores;

[0053] S4.3, Set up a parameter smooth transition mechanism. When the environment type changes, the parameter value will be adjusted according to the following formula:

[0054]

[0055] in, Based on the smoothing coefficient, The parameter value for the current frame. The parameter value is from the previous frame. The target parameter value;

[0056] S4.4 employs an adaptive smoothing coefficient based on the rate of environmental change.

[0057]

[0058] in, The rate of environmental change represents the Euclidean distance between environmental feature vectors of adjacent frames, and the coefficient 0.5 is a parameter that controls the adaptation speed.

[0059] Furthermore, the multi-dimensional detection quality evaluation index system in S5 specifically includes: inter-frame consistency index CI, detection confidence distribution index CD, target feature quality index FQ, and time stability index TS;

[0060] The specific process of S5 is as follows:

[0061] S5.1, calculate the inter-frame consistency index of the detection results respectively. Detection confidence distribution index Target characteristic quality index (FQ) and time stability index (TS);

[0062] S5.2, when At that time, increase the time smoothing coefficient. ;

[0063] S5.3, when At that time, the confidence threshold is adjusted based on the mean confidence level of the detection. ;

[0064] S5.4, when At the same time, enhance image preprocessing parameters.

[0065] Furthermore, the specific process in S6 is as follows:

[0066] S6.1, using image preprocessing parameter groups Preprocessing multiple input images of different resolutions;

[0067] S6.2, Use the YOLO11 object detection network to perform helmet detection on the preprocessed image;

[0068] S6.3, using target detection parameter set Configure the detection network to obtain detection results;

[0069] S6.4 A weighted fusion method is used to obtain the merged detection results, and a Kalman filter and time smoothing strategy are used to perform post-processing optimization on the merged detection results.

[0070] Furthermore, the specific process of S7 is as follows:

[0071] S7.1, the evaluation indicators include:

[0072] Accuracy : ;

[0073] Recall rate : ;

[0074] F1 score : ;

[0075] Stability Indicators : ;

[0076] Where TP represents the number of true positive samples, FP represents the number of false positive samples, and FN represents the number of false negative samples. The standard deviation of the number of detected targets in consecutive frames. This represents the average number of detected targets in consecutive frames;

[0077] F1 score or stability index The environment type uses grid search and Bayesian optimization to adjust parameter values ​​in the parameter configuration library;

[0078] S7.2, Establish a reinforcement learning mechanism for parameter optimization and define the reward function:

[0079]

[0080] Among them, 0.3, 0.3, and 0.4 are the weighting coefficients of each performance index;

[0081] S7.3, adopts - Greedy strategy balance exploration and utilization:

[0082]

[0083]

[0084] in, Let be the probability of randomly selecting an action. The exploration rate decreases as the number of training episodes increases, with 0.995 being the decay coefficient and 0.1 being the minimum exploration rate.

[0085] S7.4 constructs a parameter sensitivity heatmap to identify key parameters and introduces an anomaly detection mechanism. When an anomaly is detected, an alarm is triggered and the system reverts to the default parameter configuration.

[0086] Furthermore, to avoid frequent changes in environment type, exponential smoothing is used for time smoothing:

[0087]

[0088] in, For smoothing coefficients, The environment type label for the current frame. This is the environment type label for the previous frame. This is the original classification result for the current frame.

[0089] Secondly, the present invention also provides a helmet detection parameter optimization system based on environment adaptation, comprising the following modules:

[0090] Extraction module: Acquires images and performs global statistical feature analysis on the images to extract environmental feature vectors;

[0091] Classification module: Based on the environmental feature vectors extracted by the extraction module, the environmental conditions are classified into different environmental types, and the confidence score of each environmental type is calculated;

[0092] Establishment Module: Establish a parameter configuration library for environment types and detection parameters, and preset different combinations of optimized parameter values ​​for each environment type;

[0093] Adjustment module: Based on the environment type classified by the classification module and the confidence score corresponding to the environment type, retrieve the corresponding parameter group from the parameter configuration library established by S3 and adjust the parameters;

[0094] Optimization module: Defines a multi-dimensional detection quality assessment index system to obtain assessment results, and adjusts the detection parameters in real time based on the assessment results;

[0095] Detection module: After preprocessing the acquired image using the parameter set determined by the adjustment module, helmet detection is performed on the preprocessed image to obtain the helmet detection result. The helmet detection result is then optimized after configuring the detection network.

[0096] Update module: The detection performance is evaluated based on the environmental type and evaluation indicators to obtain the evaluation results. Based on these results, the F1 score is adjusted. or stability index Adjust the parameter values ​​in the parameter configuration library according to the environment type, establish a learning mechanism for parameter optimization, and optimize the parameter configuration library regularly.

[0097] Compared with the prior art, the present invention has the following beneficial technical effects:

[0098] This invention provides an environment-adaptive helmet detection parameter optimization method. By extracting environmental feature vectors and classifying environmental conditions, it can accurately identify different environmental types and adjust detection parameters accordingly. This environment-adaptive mechanism significantly improves the accuracy and stability of helmet detection under various complex environmental conditions, especially greatly improving detection performance under extreme conditions such as low light, strong light, rain, and fog.

[0099] This invention constructs a complete parameter configuration library, containing parameter sets across multiple dimensions, including image preprocessing parameter sets, object detection parameter sets, and post-processing parameter sets, covering more than 30 key parameters. Compared to traditional fixed-parameter methods, this invention achieves automatic optimization and dynamic adjustment of detection parameters. Through mechanisms such as weighted averaging and time-smooth transition, it realizes intelligent parameter updates, significantly reducing the workload of manual parameter tuning.

[0100] This invention can record detection performance data under different environments, and continuously improves the parameter configuration library by using reinforcement learning algorithms and Bayesian optimization methods to form a "detection-evaluation-optimization" model. Attached Figure Description

[0101] Figure 1 This is a flowchart of the helmet detection parameter optimization method based on environment adaptation according to an embodiment of the present invention;

[0102] Figure 2 This is a schematic diagram illustrating the environmental feature vector obtained in an embodiment of the present invention;

[0103] Figure 3 This is a schematic diagram of the structure of the parameter configuration library and the parameter mapping relationship in an embodiment of the present invention;

[0104] Figure 4 This is a flowchart illustrating the dynamic parameter adjustment mechanism in this embodiment of the invention.

[0105] Figure 5 This is a comparison chart of helmet test results under different environmental conditions according to an embodiment of the present invention. Detailed Implementation

[0106] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0107] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0108] like Figure 1 As shown, this invention provides a helmet detection parameter optimization method based on environmental adaptation. This method dynamically adjusts detection parameters by analyzing environmental characteristics in real time, achieving high-precision helmet wearing status detection under different environmental conditions. It includes the following steps:

[0109] like Figure 2As shown, S1 involves acquiring an image and performing global statistical feature analysis on the image to extract the environmental feature vector;

[0110] S1.1 First, acquire the image captured by the traffic monitoring camera, with a resolution of 1920×1080;

[0111] S1.2, Perform global statistical feature analysis on the image:

[0112] Calculate the local brightness value of the image The average value of the V channel in the HSV color space is used:

[0113] ;

[0114] in, Total number of pixels For the first The V channel value of each pixel, ranging from [0, 255].

[0115] Calculate image contrast value The root mean square contrast formula is used:

[0116] ;

[0117] in, For pixel grayscale values, The average grayscale value of all pixels in the image. This represents the total number of pixels.

[0118] Calculate image blur The variance using the Laplace operator:

[0119]

[0120] in, For the input image, is the Laplacian operator convolution kernel used to detect image edge sharpness, and variance is a function of the variance of the calculated result.

[0121] Analyze the image color temperature value Tcolor and estimate it by calculating the RGB channel ratio:

[0122]

[0123] in, , , These are the normalized average values ​​of the red, green, and blue channels of the image, respectively. The coefficients 0.3, 0.6, and 0.1 are the weight coefficients of each channel, and the constants 1000 and 9000 are used to map the results to the color temperature range [1000K, 10000K].

[0124] This embodiment also detects the density of special weather elements such as raindrops and fog in the image. The method employs frequency domain analysis and texture feature extraction. First, wavelet transform is performed on the input image to extract high-frequency components. Then, texture features such as the energy, contrast, and homogeneity of the gray-level co-occurrence matrix are calculated. Combined with a pre-trained weather classifier, the density values ​​of special weather elements are determined.

[0125] S1.3, In order to capture the local features of the input image, this embodiment divides the image into equal parts. Grid, for each grid Calculate local brightness and contrast And calculate the brightness difference index between grids:

[0126] ;

[0127] For critical areas (such as the center of a road), apply adaptive weights:

[0128]

[0129] Perform additional fine-grained feature extraction to better capture local backlighting or shadow situations.

[0130] S1.4: Use a circular buffer to record the most recent 30 frames of images and calculate the brightness change rate of 10 consecutive frames. and contrast change rate :

[0131]

[0132]

[0133] in, For the current frame brightness value, For the first Frame brightness value, For the current frame brightness value, For the first The brightness value of the frame.

[0134] The final environmental feature vector is obtained as follows:

[0135] ;

[0136] SNR is the signal-to-noise ratio evaluation value.

[0137] S2, based on the environmental feature vector extracted in S1, classify the environmental conditions to obtain different environmental types, and calculate the confidence score of each environmental type;

[0138] Environmental types include single environmental types and complex environmental types. Single environmental types include eight basic types: sunny daytime, cloudy daytime, dawn and dusk, nighttime, rainy day, foggy day, light difference environment, and standard conditions. Complex environmental types are combinations of two or more of the above eight environmental types.

[0139] S2.1, the classification uses a hybrid method based on rules and statistics, comparing the environmental feature vector with a predetermined threshold.

[0140] The criteria for determining a sunny daytime day are as follows:

[0141] ;

[0142] The criteria for determining whether it is a cloudy daytime event are:

[0143] Cloudy daytime: ;

[0144] Dawn and dusk refer to two environments: dusk or dawn. The criteria for determining dawn and dusk are as follows:

[0145] Dawn and dusk: ;

[0146] The criteria for determining nighttime are:

[0147] at night: ;

[0148] The criteria for determining a rainy day are:

[0149] rain: ;

[0150] The criteria for determining a foggy day are:

[0151] Foggy days: ;

[0152] A lighting difference environment consists of two elements: strong light or backlight. The criteria for determining a lighting difference environment are:

[0153] Light difference environment: brightness difference between grids ;

[0154] The criteria for determining standard conditions are as follows:

[0155] Standard condition: None of the above conditions are met;

[0156] To handle situations where environmental feature vectors fluctuate around a threshold, this invention applies the sigmoid function to calculate the confidence score for each environmental type:

[0157]

[0158] in, The confidence score is... The parameter for adjusting the steepness of the function curve is set to 2.0. This represents the actual value for the environment type. Determine the threshold for this environment type;

[0159] S2.3, use conditional probability to calculate the probability of combination of environment types;

[0160] When the composite environment type is met by two single environment types, the conditional probability calculation method is as follows:

[0161]

[0162] in, For environment type The probability, In the environment type Environmental type under conditions The conditional probability.

[0163] Simultaneously, an environment type priority matrix is ​​set up so that when multiple environment types meet the conditions, the type with the higher priority is selected.

[0164] To avoid frequent changes in environment type, this invention also applies exponential smoothing for time smoothing:

[0165]

[0166] in, For smoothing coefficients, The environment type label for the current frame. This is the environment type label for the previous frame. This is the original classification result for the current frame.

[0167] like Figure 3 As shown, this invention constructs a mapping relationship library between environment type and detection parameters, and establishes three main parameter groups: image preprocessing parameter group. Target detection parameter group and post-processing parameter group ;

[0168] S3.1, Construct the image preprocessing parameter set ,include:

[0169] Brightness adjustment coefficient Range [0.5, 3.0]; Contrast enhancement factor Range [0.8, 2.5]; Gamma correction factor Range [0.5, 2.0]; Denoising intensity Range [0,10]; Sharpening factor Range [0.5, 2.0]; Filter kernel size : Optional values ​​[3,5,7].

[0170] S3.2, Construct the target detection parameter set Including confidence threshold Range [0.3, 0.8]; Non-maximum suppression threshold Range [0.3, 0.7]; Anchor frame size ratio Range [0.8, 1.5]; Number of feature extraction levels : Optional values ​​[3,4,5]; Input image size : Optional values ​​[416, 640, 960]; Enhanced switch during testing : Boolean value; Model integration switch : Boolean value.

[0171] S3.3, Construct the post-processing parameter set Including time smoothing coefficient Range [0.5, 0.95]; Spatial consistency weight Range [0.3, 0.8]; Multi-scale fusion ratio Range [0.4, 0.6]; Kalman filter parameters Range [0.1, 0.5]; Tracking start threshold Range [2,5]; Number of frames tracked Range [5,30];

[0172] For eight single environment types, different combinations of optimization parameter values ​​are preset;

[0173] For example: Parameter value combinations for sunny daytime conditions:

[0174] ;

[0175] ;

[0176] ;

[0177] Nighttime parameter value combinations:

[0178] ;

[0179] ;

[0180] ;

[0181] S3.5, Design parameter interpolation mechanism, using a weighted fusion formula to calculate interpolation parameters for complex environment types:

[0182] For continuous parameters, a weighted fusion formula is used:

[0183]

[0184] in, The confidence score for environment type iii. For the corresponding parameter group, This is the sum of all confidence scores.

[0185] For gamma correction coefficient (Nonlinear parameters), using logarithmic domain interpolation:

[0186]

[0187] For discrete parameters (such as filter kernel size) The system employs a weighted voting mechanism, voting for different parameter values ​​based on the confidence level of each environment type, and selecting the parameter value with the highest number of votes.

[0188] like Figure 4 As shown, based on the environment type classified in S2 and the confidence score corresponding to the environment type, the corresponding parameter group is retrieved from the parameter configuration library established in S3 and the parameters are adjusted.

[0189] S4.1, Based on the environmental classification results, retrieve the corresponding parameter group from the parameter configuration library;

[0190] S4.2, regarding confidence level For a single environment type, directly use the corresponding preset parameter group;

[0191] For confidence level For a single environment type, a parameter set is selected based on the similarity of the calculated environment types:

[0192] ;

[0193] in, This is the feature vector of the current environment. The template feature vector is from the parameter library. The scaling parameters are used to select the most suitable parameter set for the current environment by calculating similarity.

[0194] For complex environment types, this invention calculates the weighted average parameter value:

[0195]

[0196] in, For the first Confidence scores for each environmental type. For the corresponding parameter group, The sum of all confidence scores;

[0197] In addition, to better adapt to complex scenarios, a parameter importance weight matrix is ​​applied to enhance the weight of key parameters:

[0198]

[0199] in, For environment type For parameters Importance weights.

[0200] S4.3 To avoid unstable detection results due to sudden parameter changes, this invention sets up a parameter smoothing transition mechanism. When the environmental type changes, the parameter values ​​are adjusted according to the following formula:

[0201]

[0202] in, Based on the smoothing coefficient, The parameter value for the current frame. The parameter value is from the previous frame. The target parameter value;

[0203] Simultaneously apply an adaptive smoothing coefficient based on the rate of environmental change:

[0204]

[0205] in, The rate of environmental change represents the Euclidean distance between environmental feature vectors of adjacent frames, and the coefficient 0.5 is a parameter that controls the adaptation speed.

[0206] S5, this invention defines a multi-dimensional detection quality evaluation index system to obtain evaluation results, and adjusts the detection parameters in real time based on the evaluation results; the multi-dimensional detection quality evaluation index system specifically includes: inter-frame consistency index CI, detection confidence distribution index CD, target feature quality index FQ, and time stability index TS;

[0207] S5.1, Calculate the inter-frame consistency index of the detection results. :

[0208]

[0209] in, To detect the target quantity, Detect bounding boxes for the current frame. Detect bounding boxes for the previous frame. To calculate the intersection-union ratio, divide the area of ​​the intersection of the two bounding boxes by the area of ​​their union.

[0210] Calculate the confidence distribution index of the detection :

[0211]

[0212] in, It is a function of standard deviation. It is a mean function. This is the set of confidence values ​​for all detection boxes. This metric reflects the central tendency of detection confidence; a higher value indicates more consistent detection results.

[0213] Calculate target feature quality index :

[0214]

[0215] in, Calculated by the gradient strength of the target boundary Calculated by target contour closure. This indicator reflects the sharpness and completeness of the detected target.

[0216] Based on the above indicators, this invention establishes a feedback optimization mechanism:

[0217] S5.2, when At that time, increase the time smoothing coefficient. ;

[0218]

[0219]

[0220] Where 0.05 is the adjustment step size coefficient, 0.7 is the target threshold, and 0.3 is the normalization factor;

[0221] S5.3, when At that time, the confidence threshold is adjusted based on the mean confidence level of the detection. ;

[0222]

[0223]

[0224] S5.4, when At the same time, enhance image preprocessing parameters, especially sharpening and contrast coefficients;

[0225] In this invention, based on the target density The detection threshold is dynamically adjusted, among which... The number of targets detected. This represents the area in pixels of the image.

[0226] S6, such as Figure 5 As shown in the figure, ↑ indicates improved accuracy, and ↓ indicates reduced false alarm rate. After preprocessing the acquired image using the parameter set determined by S4, helmet detection is performed on the preprocessed image to obtain helmet detection results. The helmet detection results are then optimized after configuring the detection network.

[0227] S6.1, this invention employs a multi-scale detection fusion strategy, scaling the input image at three ratios of 0.8x, 1.0x, and 1.2x respectively to obtain images with three different resolutions. , and The input image is then preprocessed. The specific preprocessing process is as follows:

[0228] Image preprocessing parameter set The input image undergoes preprocessing, including brightness adjustment, contrast enhancement, gamma correction, noise reduction, and image sharpening. The preprocessing formula is as follows:

[0229] Brightness adjustment:

[0230]

[0231] Contrast enhancement:

[0232]

[0233] Gamma correction:

[0234]

[0235] Noise reduction processing: using a kernel size of Strength is Bilateral filtering;

[0236] Image sharpening: using an intensity of Unsharpened masking;

[0237] S6.2, Use the YOLO11 object detection network to perform helmet detection on the preprocessed image;

[0238] Input size can be adaptively selected based on environment type:

[0239] For a single environment type, select 640×640×640.

[0240] For the composite environment type, select 960×960×960.

[0241] S6.3, using target detection parameter set Configure the detection network to obtain detection results;

[0242] Using target detection parameter set Configure the detection network, including confidence thresholds. Non-maximum suppression threshold Anchor frame size ratio and the number of feature extraction layers For complex environments, such as nighttime and rainy / foggy weather, test-time enhancement and model fusion strategies are also enabled to improve detection accuracy. The parameter value is: test-time enhancement switch. : Boolean value; Model integration switch Boolean value, to three sets of test results , and ;

[0243] S6.4, the three sets of detection results are combined using a weighted fusion method, and the final result is expressed as follows:

[0244]

[0245] The detection results are post-processed and optimized using a Kalman filter and a time smoothing strategy.

[0246]

[0247] in, This is the time smoothing coefficient. The location of the detection box predicted by Kalman filtering. This is the current test result.

[0248] S7, the detection performance is evaluated based on the environmental type of the evaluation index to obtain the evaluation result, and the F1 score is determined based on the evaluation result. or stability index Adjust the parameter values ​​in the parameter configuration library according to the environment type, establish a learning mechanism for parameter optimization, and optimize the parameter configuration library regularly;

[0249] S7.1, the evaluation indicators include:

[0250] Accuracy : ;

[0251] Recall rate : ;

[0252] F1 score : ;

[0253] Stability Indicators : ;

[0254] Where TP represents the number of true positive (correctly detected) samples, FP represents the number of false positive (false positive) samples, and FN represents the number of false negative (false negative) samples. The standard deviation of the number of detected targets in consecutive frames. This represents the average number of detected targets in consecutive frames;

[0255] S7.2, for environments with poor performance, i.e. ( or ), using grid search and Bayesian optimization to find the optimal combination of parameters;

[0256] S7.3, Establish a reinforcement learning mechanism for parameter optimization and define the reward function:

[0257]

[0258] Among them, 0.3, 0.3, and 0.4 are the weighting coefficients of each performance indicator, reflecting the contribution of different indicators to the overall performance;

[0259] use Greedy strategy balance exploration and utilization:

[0260]

[0261] With probability Randomly select parameters to adjust actions; with probability Select the current optimal parameters.

[0262] As the number of training rounds increases, Gradually decrease:

[0263]

[0264] The system implements an experience playback mechanism, storing historical parameter adjustment records and their effects, and periodically reviewing and learning from them; at the same time, it periodically removes redundant parameter configurations and merges similar parameter groups to keep the parameter configuration library concise and efficient.

[0265] S7.4 constructs a parameter sensitivity heatmap to identify key parameters and introduces an anomaly detection mechanism. When an anomaly is detected, an alarm is triggered and the system reverts to the default parameter configuration.

[0266] This invention also includes a road distance perception loss function, specifically comprising:

[0267] Design weight calculation formula:

[0268]

[0269] in, To detect the center point of the target The distance from the road edge is calculated using the minimum Euclidean distance to the road boundary pixel;

[0270] Weighted loss calculation:

[0271]

[0272] in, The original detection loss is a weighted sum of the bounding box regression loss and the classification loss.

[0273] Final loss calculation:

[0274]

[0275] in, To control the coefficient of road distance perception loss weight, the ratio of original loss to road perception loss is balanced.

[0276] This invention relates to an application of an environment-adaptive helmet detection parameter optimization method in a traffic safety monitoring system. It can be deployed on traffic monitoring cameras to monitor helmet wearing status of electric bicycle riders in real time. Environmental feature extraction and parameter optimization are performed using edge computing devices, improving helmet detection accuracy under complex lighting and weather conditions and achieving high-precision monitoring of traffic violations. Alternatively, it can be deployed on intelligent traffic light control boxes or intelligent traffic light poles to detect helmet wearing on electric bicycle riders at intersections. It can also link with the traffic light control system to provide warnings to riders without helmets. A cloud-edge collaborative architecture enables regular updates of parameter configurations, maintaining the stability and reliability of the detection system around the clock. Before deployment on traffic monitoring cameras, intelligent traffic light control boxes, or intelligent traffic light poles, model quantization and acceleration steps are performed, specifically including:

[0277] The road structure analysis network and detection network are quantized using INT8, mapping the weights and activation values ​​of the floating-point model to integers in the range [−128, 127].

[0278] Channel pruning based on L1 norm is adopted. The L1 norm of each channel in each convolutional layer is calculated, and 30% of channels with L1 norm below a preset threshold are removed to reduce the number of parameters and computational complexity.

[0279] Accelerate model deployment and inference using NVIDIA TensorRT, optimize layer fusion and parallel computing, merge serial operations into a single operation, and leverage the parallel computing capabilities of the GPU.

[0280] This invention also provides an environment-adaptive helmet detection parameter optimization system, comprising the following modules:

[0281] Extraction module: Acquires images and performs global statistical feature analysis on the images to extract environmental feature vectors;

[0282] Classification module: Based on the environmental feature vectors extracted by the extraction module, the environmental conditions are classified into different environmental types, and the confidence score of each environmental type is calculated;

[0283] Establishment Module: Establish a parameter configuration library for environment types and detection parameters, and preset different combinations of optimized parameter values ​​for each environment type;

[0284] Adjustment module: Based on the environment type classified by the classification module and the confidence score corresponding to the environment type, retrieve the corresponding parameter group from the parameter configuration library established by S3 and adjust the parameters;

[0285] Optimization module: Defines a multi-dimensional detection quality assessment index system to obtain assessment results, and adjusts the detection parameters in real time based on the assessment results;

[0286] Detection module: After preprocessing the acquired image using the parameter set determined by the adjustment module, helmet detection is performed on the preprocessed image to obtain the helmet detection result. The helmet detection result is then optimized after configuring the detection network.

[0287] Update module: The detection performance is evaluated based on the environmental type and evaluation indicators to obtain the evaluation results. Based on these results, the F1 score is adjusted. or stability index Adjust the parameter values ​​in the parameter configuration library according to the environment type, establish a learning mechanism for parameter optimization, and optimize the parameter configuration library regularly.

[0288] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.

Claims

1. A method for optimizing helmet detection parameters based on environment adaptation, characterized in that, Includes the following steps: S1, acquire the image and extract the environmental feature vector; S2, Based on the environmental feature vector, classify the environmental conditions to obtain different environmental types, and calculate the confidence score of each environmental type; The environment type mentioned in S2 includes a single environment type and a composite environment type. The specific process in S2 is as follows: S2.1, the specific environmental types obtained by classifying environmental conditions include: Sunny daytime: ; Cloudy daytime: ; Dawn and dusk: ; at night: ; rain: ; Foggy days: ; Light difference environment: brightness difference between grids ; Standard condition: None of the above conditions are met; The composite environment type is a combination of two or more of the above-mentioned single environment types; S2.2, Calculate the confidence score for a single environment type using the sigmoid function: in, The confidence score is... The parameter for adjusting the steepness of the function curve is set to 2.

0. This represents the actual value for the environment type. Determine the threshold for this environment type; S2.3, use conditional probability to calculate the combination probability of environment types; at the same time, set an environment type priority matrix, and when multiple environment types meet the conditions at the same time, select the environment type with higher priority; To avoid frequent changes in environment type, exponential smoothing is used for time smoothing. in, For smoothing coefficients, The environment type label for the current frame. This is the environment type label for the previous frame. This is the original classification result for the current frame; S3, establish a parameter configuration library to preset different combinations of optimized parameter values ​​for each environment type; S4. Based on the environment type and the confidence score of each environment type, retrieve the corresponding parameter group from the parameter configuration library and adjust the parameters accordingly. S5 defines a multi-dimensional quality assessment index system to obtain assessment results, and adjusts the testing parameters in real time based on the assessment results; S6. After preprocessing the acquired image using the parameter set determined in S4, helmet detection is performed on the preprocessed image to obtain the helmet detection result. The helmet detection result is then optimized after configuring the detection network. S7 evaluates the detection performance of the indicator environment type, establishes a parameter optimization learning mechanism based on the evaluation results, and regularly optimizes the parameter configuration library.

2. The helmet detection parameter optimization method based on environment adaptation according to claim 1, characterized in that, The process of obtaining the environmental feature vector in S1 is as follows: S1.1, Obtain the image captured by the traffic monitoring camera as the input image; S1.2, Calculate the local brightness value of the image. Image contrast value Image blur And analyze the image color temperature value , density of weather elements ; S1.3, divide the image into a 4×4 grid and calculate the local brightness for each grid. and contrast ; S1.4: Use a circular buffer to record the most recent 30 frames of images and calculate the brightness change rate of 10 consecutive frames. and contrast change rate The environmental feature vector is then obtained.

3. The helmet detection parameter optimization method based on environment adaptation according to claim 2, characterized in that, The establishment of the parameter configuration library in S3 specifically includes: S3.1, Construct the image preprocessing parameter set Including brightness adjustment coefficient Contrast enhancement factor Gamma correction coefficient Noise reduction intensity and sharpening factor ; S3.2, Construct the target detection parameter set Including confidence threshold Non-maximum suppression threshold Anchor frame size ratio and the number of feature extraction layers ; S3.3, Construct the post-processing parameter set Including time smoothing coefficient Spatial consistency weight and multi-scale fusion ratio ; S3.4, for a single environment type, preset different combinations of optimization parameter values; S3.5, Design parameter interpolation mechanism, using a weighted fusion formula to calculate interpolation parameters for complex environment types: in, For environment type The confidence score, For the parameter group corresponding to the environment type, This is the sum of all confidence scores.

4. The helmet detection parameter optimization method based on environment adaptation according to claim 2, characterized in that, The dynamic parameter adjustment in S4 specifically includes: S4.1, Based on the environmental classification results, retrieve the corresponding parameter group from the parameter configuration library; S4.2, regarding confidence level For a single environment type, directly use the corresponding preset parameter group; For confidence level For a single environment type, a parameter set is selected based on the similarity of the calculated environment types: ; in, This is the feature vector of the current environment. The template feature vector is from the parameter library. For scaling parameters; For complex environment types, calculate the weighted average parameter value: in, For the first Confidence scores for each environmental type For the corresponding parameter group, The sum of all confidence scores; S4.3, Set up a parameter smooth transition mechanism. When the environment type changes, the parameter value will be adjusted according to the following formula: in, Based on the smoothing coefficient, The parameter value for the current frame. The parameter value is from the previous frame. The target parameter value; S4.4 employs an adaptive smoothing coefficient based on the rate of environmental change. in, The rate of environmental change represents the Euclidean distance between environmental feature vectors of adjacent frames, and the coefficient 0.5 is a parameter that controls the adaptation speed.

5. The helmet detection parameter optimization method based on environment adaptation according to claim 1, characterized in that, The multi-dimensional detection quality evaluation index system in S5 specifically includes: inter-frame consistency index CI, detection confidence distribution index CD, target feature quality index FQ, and time stability index TS; The specific process of S5 is as follows: S5.1, calculate the inter-frame consistency index of the detection results respectively. Detection confidence distribution index Target characteristic quality index (FQ) and time stability index (TS); S5.2, when At that time, increase the time smoothing coefficient. ; S5.3, when At that time, the confidence threshold is adjusted based on the mean confidence level of the detection. ; S5.4, when At the same time, enhance image preprocessing parameters.

6. The helmet detection parameter optimization method based on environment adaptation according to claim 3, characterized in that, The specific process in S6 is as follows: S6.1, using image preprocessing parameter groups Preprocessing multiple input images of different resolutions; S6.2, Use the YOLO11 object detection network to perform helmet detection on the preprocessed image; S6.3, using target detection parameter set Configure the detection network to obtain detection results; S6.4 A weighted fusion method is used to obtain the merged detection results, and a Kalman filter and time smoothing strategy are used to perform post-processing optimization on the merged detection results.

7. The helmet detection parameter optimization method based on environment adaptation according to claim 1, characterized in that, The specific process of S7 is as follows: S7.1, the evaluation indicators include: Accuracy : ; Recall rate : ; F1 score : ; Stability Indicators : ; Where TP represents the number of true positive samples, FP represents the number of false positive samples, and FN represents the number of false negative samples. The standard deviation of the number of detected targets in consecutive frames. This represents the average number of detected targets in consecutive frames; F1 score or stability index The environment type uses grid search and Bayesian optimization to adjust parameter values ​​in the parameter configuration library; S7.2, Establish a reinforcement learning mechanism for parameter optimization and define the reward function: Among them, 0.3, 0.3, and 0.4 are the weighting coefficients of each performance index; S7.3, adopts - Greedy strategy balance exploration and utilization: in, Let be the probability of randomly selecting an action. The exploration rate decreases as the number of training episodes increases, with 0.995 being the decay coefficient and 0.1 being the minimum exploration rate. S7.4 constructs a parameter sensitivity heatmap to identify key parameters and introduces an anomaly detection mechanism. When an anomaly is detected, an alarm is triggered and the system reverts to the default parameter configuration.

8. A helmet detection parameter optimization system based on environment adaptation, characterized in that, Includes the following modules: Extraction module: Acquires images and performs global statistical feature analysis on the images to extract environmental feature vectors; Classification module: Based on the environmental feature vectors extracted by the extraction module, the environmental conditions are classified into different environmental types, and the confidence score of each environmental type is calculated; The classification module includes: Environmental type definition unit: This is used to define the criteria for distinguishing between single and complex environmental types. Specifically, a single environmental type includes: Sunny daytime: ; Cloudy daytime: ; Dawn and dusk: ; at night: ; rain: ; Foggy days: ; Light difference environment: brightness difference between grids ; Standard condition: None of the above conditions are met; The composite environment type is a combination of two or more of the above-mentioned single environment types; Confidence calculation unit: Used to calculate confidence scores for a single environment type using the sigmoid function: in, The confidence score is... The parameter for adjusting the steepness of the function curve is set to 2.

0. This represents the actual value for the environment type. Determine the threshold for this environment type; Type Decision Unit: This is used to calculate the probability of combination of environment types using conditional probability; at the same time, an environment type priority matrix is ​​set so that when multiple environment types meet the conditions at the same time, the environment type with higher priority is selected. To avoid frequent changes in environment type, exponential smoothing is used for time smoothing. in, For smoothing coefficients, The environment type label for the current frame. This is the environment type label for the previous frame. This is the original classification result for the current frame; Establishment Module: Establish a parameter configuration library for environment types and detection parameters, and preset different combinations of optimized parameter values ​​for each environment type; Adjustment module: Based on the environment type classified by the classification module and the confidence score corresponding to the environment type, retrieve the corresponding parameter group from the parameter configuration library established by S3 and adjust the parameters; Optimization module: Defines a multi-dimensional detection quality assessment index system to obtain assessment results, and adjusts the detection parameters in real time based on the assessment results; Detection module: After preprocessing the acquired image using the parameter set determined by the adjustment module, helmet detection is performed on the preprocessed image to obtain the helmet detection result. The helmet detection result is then optimized after configuring the detection network. Update module: The detection performance is evaluated based on the environmental type and evaluation indicators to obtain the evaluation results. Based on these results, the F1 score is adjusted. or stability index Adjust the parameter values ​​in the parameter configuration library according to the environment type, establish a learning mechanism for parameter optimization, and optimize the parameter configuration library regularly.

Citation Information

Patent Citations

  • Visual optimization method for camera in rainy days

    CN118898562A

  • Methods and systems for updating parameters of a parameterized optimization algorithm in federated learning

    WO2023061500A1