A distributed guided optimized deep learning tunnel lighting detection method and system

Through the deep learning method of distribution guidance optimization, the problems of low detection accuracy and poor flexibility of tunnel lamps in the prior art are solved, and higher detection accuracy and lower false alarm rate are achieved.

CN119540664BActive Publication Date: 2025-04-29SHENZHEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510104631.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-04-29
Estimated Expiration
2045-01-23

AI Technical Summary

Technical Problem

Existing image-based deep learning technology has problems of low detection accuracy and poor flexibility in tunnel lamp detection, especially in low-light environments with poor image quality and severe noise interference.

Method used

Deep learning method of distribution guidance optimization is adopted to obtain the original grayscale image of the tunnel, label the category and location information of the lamp, train the object detection model, and optimize the detection results based on the distribution guidance optimization strategy, and output the optimized tunnel lamp detection results.

Benefits of technology

It significantly improves the accuracy of tunnel lamp detection, reduces false alarms and missed reports, and reduces the need for training data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540664B_ABST
    Figure CN119540664B_ABST
Patent Text Reader

Abstract

The present invention discloses a distribution-guided optimized deep learning tunnel lamp detection method and system, comprising: obtaining the original grayscale image of the tunnel, and marking the category and location information of the lamps to construct a training data set; selecting a target detection model based on deep learning, inputting the marked training data into the target detection model for training, and obtaining a trained target detection model; inputting the tunnel image to be detected into the trained target detection model, analyzing and processing the tunnel image to be detected, predicting the location and category information of the lamps, and obtaining the detection result of the trained target detection model; optimizing the detection result of the trained target detection model based on the distribution-guided optimization strategy, and outputting the optimized tunnel lamp detection result. The present invention improves the detection result of the deep learning model based on distribution-guided optimization, improves the accuracy of tunnel lamp detection, reduces false positives and false negatives, and reduces the demand for training data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of target recognition and detection technology, and in particular to a distribution-guided optimized deep learning tunnel lamp detection method and system. Background Art

[0002] Intelligent management of tunnel lighting systems is crucial to improving urban traffic efficiency and safety. Among them, tunnel lighting target detection and positioning technology, as the key to realizing intelligent management of tunnel lighting, can effectively solve the problems of low efficiency and high cost of traditional manual inspection. Therefore, tunnel lighting detection technology based on point cloud data and image data has been proposed and explored. Image-based methods are widely favored because of their high cost-effectiveness, convenient data acquisition, and benefit from the excellent performance of deep learning technology, especially convolutional neural network (CNN) in feature extraction and object detection.

[0003] However, in the field of tunnel lighting detection, the training of neural networks based on image-based deep learning technology is not only limited by the large demand for high-quality annotated datasets, but also because images collected in low-light environments have significant low illumination and noise interference problems, which seriously affects the image quality and target detection accuracy.

[0004] It is a feasible idea to use the unique spatial distribution characteristics of tunnel lighting fixtures to improve detection accuracy. The current mainstream method is to use spatial information to optimize the selection of candidate areas before CNN detection. However, this also brings problems of increased model complexity and poor flexibility.

[0005] Therefore, the prior art needs to be improved. Summary of the invention

[0006] The technical problem to be solved by the present invention is that, in view of the defects of the prior art, the present invention provides a distribution-guided optimized deep learning tunnel lamp detection method and system to solve the problems of low detection accuracy and poor flexibility of the existing image-based tunnel lamp detection method.

[0007] The technical solution adopted by the present invention to solve the technical problem is as follows:

[0008] In a first aspect, the present invention provides a deep learning tunnel lamp detection method based on distribution guided optimization, comprising:

[0009] Obtain the original grayscale image of the tunnel, annotate the category and location information of the lamps, and construct a training data set;

[0010] Selecting a target detection model based on deep learning, inputting the labeled training data into the target detection model for training, and obtaining a trained target detection model;

[0011] Inputting the tunnel image to be detected into the trained target detection model, analyzing and processing the tunnel image to be detected, predicting the position and category information of the lamps, and obtaining the detection result of the trained target detection model;

[0012] The detection result of the trained target detection model is optimized based on the distribution guided optimization strategy, and the optimized tunnel lamp detection result is output.

[0013] In one implementation, the original grayscale image of the tunnel is obtained, and the category and location information of the lamps are annotated to construct a training data set, including:

[0014] Acquire continuous grayscale images of a single tunnel based on the tunnel detection system to obtain the original grayscale image;

[0015] Removing redundant white edges from the original grayscale image, compressing the image with the white edges removed to a preset range, and classifying and labeling the tunnel image according to different illumination levels;

[0016] The classified and annotated image data are divided to obtain the training data set.

[0017] In one implementation, the image data after classification and annotation is divided to obtain the training data set, and then includes:

[0018] Affine transformation, image inversion, mirroring, image brightness and contrast transformation, and Gaussian blur operation are used to retain target position features, simulate tunnel environments under different lighting conditions, and expand the training set to a preset number.

[0019] In one implementation, selecting a target detection model based on deep learning and inputting the labeled training data into the target detection model for training includes:

[0020] Select the deep learning-based target detection model according to the detection task requirements;

[0021] The labeled training data is input into the target detection model for training, the model parameters are adjusted through a back propagation algorithm, the characteristics and patterns of the tunnel lamps are learned, and the trained target detection model is obtained.

[0022] In one implementation, the optimizing the detection result of the trained target detection model based on the distribution guided optimization strategy includes:

[0023] Based on the distribution guided optimization strategy, the detection results of the trained target detection model are processed by removing redundant boxes to obtain a trusted box;

[0024] The global outlier value to be removed corresponding to the distance between the trusted boxes is screened by a K-nearest neighbor algorithm, and the global outlier distance is removed according to the global outlier value to be removed;

[0025] Using a piecewise linear fitting algorithm in combination with Akaike information criterion or Bayesian information criterion to determine the number of segments and segmentation points in the trusted box, and eliminating local outlier intervals according to the number of segments and the segmentation points;

[0026] Calculating the number of detection frame generation for the preset distances between the trusted boxes, generating a detection frame according to the calculated number of detection frame generation, and performing initial detection frame matching;

[0027] Detection frames are generated for the blank areas at the beginning and end of the detection frame to obtain a detection frame after the blank areas at the beginning and end are supplemented.

[0028] In one implementation, the removing redundant frames from the detection results of the trained target detection model based on the distribution guided optimization strategy includes:

[0029] For each grayscale image, reading the detection result of the trained object detection model;

[0030] According to the y coordinate of the detection box in the detection result, the abnormal boxes outside the range of the lamps are removed and divided into upper and lower rows, and the x coordinates of the center of each row of boxes are clustered by using a clustering algorithm to obtain multiple box clusters;

[0031] The boxes included in the multi-box cluster and the overlapping boxes are removed, and the remaining boxes are set as the trusted boxes.

[0032] In one implementation, calculating the number of detection frame generation for the preset distances between the trusted boxes, generating a detection frame according to the calculated number of detection frame generation, and performing initial detection frame matching includes:

[0033] In the segment where the preset interval is located, obtaining a minimum value and a maximum value of intervals corresponding to the trusted boxes near the preset interval, and setting the number of detection boxes generated at the preset interval according to the minimum value and the maximum value;

[0034] According to the number of detection frames generated, the detection frames are generated on average in the preset interval, and the distance between the detection frames and the initial detection frames is calculated, and the original detection frame with the shortest distance and a distance lower than a preset value is selected as the final target frame of the corresponding position.

[0035] In a second aspect, the present invention provides a deep learning tunnel lamp detection system with distributed guided optimization, comprising:

[0036] The data set preprocessing module is used to obtain the original grayscale image of the tunnel, annotate the category and location information of the lamps, and construct a training data set;

[0037] A target detection model training module is used to select a target detection model based on deep learning, input the labeled training data into the target detection model for training, and obtain a trained target detection model;

[0038] The target detection model detection module is used to input the tunnel image to be detected into the trained target detection model, analyze and process the tunnel image to be detected, predict the position and category information of the lamps, and obtain the detection result of the trained target detection model;

[0039] The distribution guided optimization module is used to optimize the detection results of the trained target detection model based on the distribution guided optimization strategy, and output the optimized tunnel lamp detection results.

[0040] In a third aspect, the present invention provides a terminal, comprising: a processor and a memory, wherein the memory stores a distributed guided optimized deep learning tunnel lamp detection program, and when the distributed guided optimized deep learning tunnel lamp detection program is executed by the processor, it is used to implement the operation of the distributed guided optimized deep learning tunnel lamp detection method as described in the first aspect.

[0041] In a fourth aspect, the present invention further provides a medium, which is a computer-readable storage medium, and which stores a distribution-guided optimized deep learning tunnel lamp detection program. When the distribution-guided optimized deep learning tunnel lamp detection program is executed by a processor, it is used to implement the operation of the distribution-guided optimized deep learning tunnel lamp detection method as described in the first aspect.

[0042] The present invention adopts the above technical solution to achieve the following effects:

[0043] The present invention obtains the original grayscale image of the tunnel and marks the category and location information of the lamps; the marked training data can be input into the target detection model for training, and the trained target detection model is used to analyze and process the tunnel image to be detected to obtain the detection result of the trained target detection model; and the detection result of the trained target detection model is optimized based on the distribution guided optimization strategy, and the optimized tunnel lamp detection result is output. Based on the excellent tunnel lamp detection results already obtained by the deep learning model, the present invention further applies the distribution guided optimization algorithm to optimize the detection results. This method not only reduces the demand for training data, but also significantly improves the accuracy of lamp detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.

[0045] Figure 1 It is a flow chart of the deep learning tunnel lamp detection method with distribution guided optimization in the present invention.

[0046] Figure 2 It is a framework diagram of a tunnel lamp detection method based on a deep learning model in the present invention.

[0047] Figure 3 It is a flow chart of the distribution guided optimization algorithm based on the lamp detection results in the present invention.

[0048] Figure 4 It is a functional principle diagram of a terminal in one implementation of the present invention.

[0049] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0051] Exemplary Methods

[0052] In the field of tunnel lighting detection, the training of neural networks based on image deep learning technology is not only limited by the large demand for high-quality annotated data sets, but also because images collected in low-light environments have significant low illumination and noise interference problems, which seriously affect the image quality and target detection accuracy. It is a feasible idea to use the unique spatial distribution characteristics of tunnel lighting fixtures to improve detection accuracy. The current mainstream method is to use spatial information to optimize the selection of candidate areas before CNN detection. However, this also brings about the problems of increased model complexity and poor flexibility.

[0053] In response to the above technical problems, an embodiment of the present invention provides a deep learning tunnel lamp detection method with distribution-guided optimization, which obtains the original grayscale image of the tunnel and marks the category and location information of the lamps; the labeled training data can be input into the target detection model for training, and the trained target detection model is used to analyze and process the tunnel image to be detected to obtain the detection results of the trained target detection model; and the detection results of the trained target detection model are optimized based on the distribution-guided optimization strategy, and the optimized tunnel lamp detection results are output. Based on the excellent tunnel lamp detection results already obtained by the deep learning model, the embodiment of the present invention further applies the distribution-guided optimization algorithm to optimize the detection results. This method not only reduces the demand for training data, but also significantly improves the accuracy of lamp detection and reduces false positives and negatives.

[0054] like Figure 1 As shown, an embodiment of the present invention provides a distribution-guided optimized deep learning tunnel lamp detection method, comprising the following steps:

[0055] Step S100, obtaining an original grayscale image of the tunnel, and marking the category and location information of the lamps to construct a training data set.

[0056] In this embodiment, a low-cost, lightweight tunnel lighting fixture detection solution based on deep learning is proposed, which achieves high detection accuracy in multiple lighting sections. In this solution, a distribution-guided optimization algorithm is proposed based on the geometric position characteristics of tunnel lighting fixtures. This distribution-guided optimization improves the detection results of the deep learning model, improves accuracy, reduces false positives and false negatives, and reduces the demand for training data. This solution is more feasible and efficient in practical applications, and provides a new and effective method for the safety management of tunnel lighting.

[0057] In this embodiment, the distribution-guided optimized deep learning tunnel lamp detection method mainly includes a tunnel lamp detection step based on deep learning and a distribution-guided optimization step; Figure 2 As shown, taking the deep learning target detection model Mask R-CNN (Mask Region-based Convolutional Neural Network, a deep learning model for target detection and instance segmentation) as an example, after data preprocessing, the steps of tunnel lamp detection based on deep learning include deep learning target detection model construction and training stage, deep learning target detection model prediction stage; after completing the basic deep learning target detection process, the detection accuracy is further improved through the distribution guided optimization step.

[0058] In the data preprocessing stage, the highway tunnel rapid detection system is mainly used to obtain the original grayscale image of the tunnel, and annotate it to determine the category, location and other information of the lamps and build a training data set.

[0059] Specifically, in an implementation of this embodiment, step S100 includes the following steps:

[0060] Step S101, acquiring continuous grayscale images of a single tunnel based on a tunnel detection system to obtain the original grayscale image;

[0061] Step S102, removing redundant white edges of the original grayscale image, compressing the image without white edges to a preset range, and classifying and labeling the tunnel image according to different illumination levels;

[0062] Step S103, dividing the classified and labeled image data to obtain the training data set;

[0063] Step S104, using affine transformation, image inversion, mirroring, image brightness and contrast transformation, and Gaussian blur operation to retain the target position features, simulate the tunnel environment under different lighting conditions, and expand the training set to a preset number.

[0064] In this embodiment, the input of the deep learning target detection model is a continuous grayscale image of a single tunnel; in order to obtain these tunnel images, a highway tunnel rapid detection system can be used to obtain a grayscale image of a tunnel. The highway tunnel rapid detection system is equipped with various sensors, cameras, and laser scanners to collect high-precision tunnel images, three-dimensional spatial information, and road data. The original images obtained by the highway tunnel rapid detection system are preprocessed to simplify the image information, eliminate color interference, and highlight the internal structure and features of the tunnel. In addition, since the grayscale image only contains brightness information, the brightness difference between the lighting equipment and the surrounding environment is significant, which helps to locate the lighting equipment more accurately and provides clearer and more reliable features for subsequent lighting detection algorithms.

[0065] In this embodiment, after obtaining the original grayscale image, considering the training efficiency and detection accuracy, it is also necessary to remove the redundant white edges of the image, compress the image size to a reasonable range (for example, compress the image to a resolution of 2560×1440), and roughly annotate the lamps (i.e., annotate the category, location, and other information of the lamps). Afterwards, the tunnel images are classified according to different illumination levels into three categories: bright, dark, and darker, so as to divide the data set. For the three types of data after division, one is randomly selected from these three categories to form a training set, and three are randomly selected from these three categories to form a verification set, and the remaining images form a test set. At the same time, considering that the output type of the collected data is an orthophoto, affine transformation, image inversion, mirroring, Gaussian blur, and image brightness and contrast transformation operations are used to retain the target position features, simulate the tunnel environment under different lighting conditions, and expand the training set to an appropriate number (for example, expand the training set to 2 times).

[0066] like Figure 1 As shown, an embodiment of the present invention provides a distribution-guided optimized deep learning tunnel lamp detection method, comprising the following steps:

[0067] Step S200: select a target detection model based on deep learning, input the labeled training data into the target detection model for training, and obtain a trained target detection model.

[0068] In this embodiment, during the deep learning target detection model construction and training stage, a suitable deep learning target detection architecture is selected, such as the YOLO model (You Only Look Once, a deep learning model for target detection), the Mask R-CNN model or the HRNet model (a deep learning model for image processing tasks, suitable for pose estimation and key point detection), etc., and the labeled training data is input into the model for training. The model is optimized by continuously adjusting the model parameters so that it can learn the characteristics and recognition patterns of tunnel lamps.

[0069] Specifically, in an implementation of this embodiment, step S200 includes the following steps:

[0070] Step S201, selecting the deep learning-based target detection model according to the detection task requirements;

[0071] Step S202, inputting the labeled training data into the target detection model for training, adjusting the model parameters through a back propagation algorithm, learning the characteristics and patterns of the tunnel lamps, and obtaining the trained target detection model.

[0072] In this embodiment, after data preprocessing, a suitable target detection algorithm is selected according to task requirements, such as MaskR-CNN model, YOLO model or HRNet model. Then the selected model is trained using the prepared annotated data set. During the training process, the model parameters are continuously adjusted through the back propagation algorithm so that the model can accurately locate and classify lamps.

[0073] After selecting and training the model, use an independent validation set to evaluate the model performance and check its accuracy, recall, and other key indicators. If the model performs poorly, you may need to return to the previous step to adjust the model architecture, hyperparameters, or add more training samples, or even reconsider the accuracy of data annotation. Once the model achieves satisfactory accuracy on the test set, it can be deployed in the actual environment. At this point, the lamp detection box output by the model is directly used as the input of the distribution-guided optimization algorithm to further improve the accuracy of tunnel lamp detection.

[0074] like Figure 1 As shown, an embodiment of the present invention provides a distribution-guided optimized deep learning tunnel lamp detection method, comprising the following steps:

[0075] Step S300: input the tunnel image to be detected into the trained target detection model, analyze and process the tunnel image to be detected, predict the position and category information of the lamps, and obtain the detection result of the trained target detection model.

[0076] In this embodiment, in the prediction stage of the deep learning target detection model, the tunnel image to be detected is input into the trained model. The model will analyze and process the image to predict the location and category information of the lamps, thereby realizing the detection of tunnel lamps and obtaining the detection results of the target detection model.

[0077] like Figure 1 As shown, an embodiment of the present invention provides a distribution-guided optimized deep learning tunnel lamp detection method, which also includes the following steps:

[0078] Step S400, optimizing the detection result of the trained target detection model based on the distribution guided optimization strategy, and outputting the optimized tunnel lamp detection result.

[0079] In this embodiment, in the stage of optimizing the model prediction results based on the distribution-guided optimization strategy, a distribution-guided optimization strategy is introduced to further improve the detection accuracy. The algorithm uses the regularity of the intervals between tunnel lamps to optimize the target detection results of the deep learning model, including steps such as outlier removal, clustering, spacing calculation, detection frame generation, and iterative optimization, ultimately achieving the purpose of improving detection accuracy. This post-processing step is important because it serves as a supplement to the entire detection process, aiming to improve model performance at minimal cost through simple calculations and rule adjustments.

[0080] Due to limitations in data volume and training time, in this embodiment, it is hoped to use a small percentage of the data set to train the network and detect the remaining tunnel lamps. Therefore, the accuracy of the neural network may not be guaranteed, and background false detections are prone to occur, and the confidence level is not high, which affects the post-processing results of the model (for example, non-maximum suppression), ultimately resulting in low detection accuracy of the deep learning model.

[0081] To ensure safe and comfortable tunnel lighting, the tunnel lamp arrangement scheme adjusts the spacing of lamps according to the lighting sections of the tunnel. The spacing of lamps in the same lighting section is roughly equal, and the spacing of lamps in adjacent lighting sections is different. This simple and direct feature can be used to improve the accuracy of detecting tunnel lamps. Therefore, this embodiment proposes a post-processing algorithm based on the tunnel lamp arrangement rules (i.e., based on a distribution-guided optimization strategy). By utilizing the position feature that the spacing of lamps in the same lighting section of the tunnel is roughly equal, the target detection results of the deep learning model are reprocessed to remove redundant frames, adjust offset candidate frames, and supplement undetected targets.

[0082] Specifically, in an implementation of this embodiment, step S400 includes the following steps:

[0083] Step S401, based on the distribution guided optimization strategy, remove redundant boxes from the detection results of the trained target detection model to obtain trusted boxes.

[0084] In one implementation of this embodiment, step S401 includes the following steps:

[0085] Step S401a, for each grayscale image, reading the detection result of the trained object detection model;

[0086] Step S401b, according to the y coordinate of the detection box in the detection result, the abnormal boxes outside the range of the lamps are removed and divided into upper and lower rows, and the x coordinates of the center of each row of boxes are clustered by using a clustering algorithm to obtain multiple box clusters;

[0087] Step S401c: remove the boxes included in the multi-box cluster and the overlapping boxes, and set the remaining boxes as the trusted boxes.

[0088] In this embodiment, in the process of removing redundant boxes, adjusting offset candidate boxes, and supplementing undetected objects from the target detection results of the deep learning model, unless otherwise specified, only the x coordinate of the detection box is processed in the following post-processing flow:

[0089] (1) Candidate box preprocessing. For each image, read the detection results of the deep learning model. Tunnel lamps are roughly distributed in two fixed upper and lower rows. Therefore, according to the y-coordinate of the detection box, the abnormal boxes outside the approximate range of the lamps are removed and divided into upper and lower rows. Then, the DBSCAN clustering algorithm (Density-Based Spatial Clustering of Applications with Noise, a density-based clustering algorithm) is used to cluster the x-coordinates of the center of each row of boxes. , min_samples=1, where max_width is half of the maximum width of all boxes in this row, and min_samples is the minimum number of samples.

[0090] The DBSCAN clustering algorithm is a density-based clustering algorithm, and its core principle revolves around the density distribution of data points. The algorithm sets two key parameters: and min_samples (minimum number of samples). For any data point in the data set, if it is the center, If the number of data points in the neighborhood is not less than min_samples, then the data point is defined as a core point. All data points in the neighborhood together form a cluster. Neighborhood, but its own If the number of data points in the neighborhood does not reach min_samples, then this data point is considered a boundary point and still belongs to a cluster. Data points that do not meet the core point conditions and do not meet the boundary point characteristics are marked as noise points. Through this density-based discrimination method, the DBSCAN clustering algorithm can effectively identify the clustering structure in the data set and accurately mine the aggregation pattern and distribution characteristics of the data.

[0091] By setting The maximum width is half, which ensures that adjacent boxes that do not belong to the same object will not be mistakenly clustered into the same cluster. Setting min_samples = 1 means that a cluster can be formed even with only one point (i.e., the center of the box). This is done to ensure that even the most isolated boxes are clustered correctly, while allowing boxes with similar x coordinates to merge into larger clusters.

[0092] (2) Trusted box acquisition. The boxes contained in the clustered multi-box cluster and the overlapping boxes are eliminated, and the remaining boxes are trusted boxes. These trusted boxes will be used as the basis for inferring the positions of other boxes. In this embodiment, the ratio of the overlapping length of two boxes in the x-axis direction to the minimum value of the width of a single box is calculated to determine whether the boxes overlap. If this ratio exceeds a preset value (for example, 10%), it can be considered that the two boxes do overlap.

[0093] Step S402, screening the global outlier values ​​to be removed corresponding to the distances of the trusted boxes by using a K-nearest neighbor algorithm, and removing the global outlier distances according to the global outlier values ​​to be removed;

[0094] Step S403, using a piecewise linear fitting algorithm in combination with Akaike information criterion or Bayesian information criterion to determine the number of segments and segmentation points in the trusted box, and removing local outlier distances according to the number of segments and the segmentation points.

[0095] In this embodiment, based on the above candidate box preprocessing and trusted box acquisition process, the following is also included:

[0096] (3) Obtaining the trust interval. There are intervals of varying sizes between the trust boxes. It is necessary to identify the interval that can truly represent the design interval of the lamps in the lighting segment from these intervals. In this embodiment, it is called the trust interval. In order to obtain the trust interval, it is necessary to eliminate the long intervals between the trusted boxes due to box elimination or missed detection by the deep learning model. Since the intervals of tunnel lamps in different lighting segments are different, they are evenly distributed in the same lighting segment, and there will be obvious interval jumps at the segmentation points. Therefore, the elimination of long intervals cannot simply consider global outliers, but needs to consider the local outliers of a certain lighting segment.

[0097] Based on this, piecewise linear regression is used in this embodiment to exclude these long spacings. First, the global outliers to be removed of the trust box spacing are screened by the K Nearest Neighbors (KNN) algorithm, and the number of neighbors is set to min(5, number of spacings - 1). The anomaly score threshold is initially set to 2.5. Then, the screening results that are greater than the average value * K are treated as obvious and extreme global outliers and removed, and K is initially set to 2. In this way, the local distribution and overall distribution characteristics of the data are taken into account at the same time, and the outliers are preliminarily identified by the KNN algorithm, and then further screened by comparison with the average value, and finally those extreme global outliers are eliminated.

[0098] The core of the KNN algorithm is to determine the "neighbor" relationship based on the distance between data points, and then judge whether the data point is abnormal based on the neighbor situation. Here, choosing the number of neighbors as min (5, spacing number - 1) is a more reasonable setting method, which can not only ensure that there are enough reference neighbors when the amount of data is small, but also avoid selecting too many neighbors when the amount of data is large and losing the ability to capture local characteristics. Then, with the help of the corresponding fitting method, the model can learn and master the distribution law of the data. After completing the learning process of the model, a special decision function method is used to calculate the abnormal score threshold corresponding to each data point. The determination of this score is closely related to key information such as the distance between the data point and its adjacent data points. Once the score exceeds the abnormal score threshold, they are judged as outliers in this embodiment. The threshold of the KNN algorithm is initially set to 2.5, which is an empirical setting, aiming to capture the possible outlier candidate range more broadly in the preliminary screening. This value can be adjusted according to the characteristics of the data and the actual application scenario. If the threshold is set too low, some real outliers may be missed; if it is set too high, some normal but slightly deviated data may be misjudged as outliers.

[0099] Next, in this embodiment, piecewise linear fitting (pwlf) technology is used, combined with Akaike Information Criterion (AIC) or Bayesian Information Criterion (BIC) to determine the optimal number of segments and segmentation points in the data. Piecewise linear fitting is a method for identifying local change points in data (i.e., the location of trend changes). It assumes that the data follows different linear relationships in different intervals. AIC and BIC are both criteria for model selection. They measure the pros and cons of statistical models by comprehensively considering model complexity (related to degrees of freedom) and data fit (related to the likelihood function), and help select relatively better models from multiple candidate models. AIC or BIC needs to be selected based on the actual performance of the program. The specific steps are as follows:

[0100] 1. Initialize the piecewise linear fitting object: Create a piecewise linear fitting object to perform piecewise linear fitting on the input data. In order to ensure that the data format is suitable for the piecewise linear fitting algorithm, this embodiment uses the spacing corresponding to the trust box that removes the global outlier as the dependent variable, and the x-coordinate of the previous box corresponding to the spacing as the independent variable.

[0101] 2. Set the maximum number of segments: According to the actual situation, set the maximum number of segments to 2, because the image usually does not contain more than three lighting parts.

[0102] 3. AIC or BIC calculation: For each possible number of segments (from 1 to 2 segments), perform the following operations: First, fit the piecewise linear model, calculate the predicted value and residual for each data point, and calculate the Gaussian likelihood function value based on the residual as the input of AIC or BIC. Finally, use the AIC or BIC formula to calculate the information criterion value to quantify the complexity and fitting quality of the model.

[0103] 4. Select the optimal number of segments: Compare the AIC or BIC values ​​corresponding to different numbers of segments, and select the number of segments corresponding to the lowest AIC or BIC value as the optimal number of segments. A lower information criterion value indicates that the model fits the data while maintaining a lower complexity.

[0104] 5. Determine the location of the change point: Use the optimal number of segments to refit the model and determine the location of the change point between each segment. If the optimal number of segments is 1, there is no segmentation point; if the optimal number of segments is 2, an x-coordinate is obtained as the location of the change point, and the trust box closest to the left of the change point is considered to be the segmentation point.

[0105] Finally, based on the detected paragraphs, it is necessary to further remove local outliers. In this embodiment, quartiles are used to determine the upper limit of each paragraph, and then points exceeding this upper limit are removed:

[0106] (1);

[0107] In the formula, is the upper bound of outliers, and outliers are usually defined as data points above the upper bound. is the third quartile of the data segment, is the interquartile range of the data segment, It is an empirical parameter based on experimental results, with an initial value of 4, which is used to determine the range of outliers.

[0108] Step S404, calculating the number of detection frame generation for the preset distances between the trusted boxes, generating a detection frame according to the calculated number of detection frame generation, and performing initial detection frame matching;

[0109] In one implementation of this embodiment, step S404 includes the following steps:

[0110] Step S404a, in the segment where the preset interval is located, obtaining the minimum value and the maximum value of the intervals corresponding to the trusted boxes near the preset interval, and setting the number of detection boxes generated at the preset interval according to the minimum value and the maximum value;

[0111] Step S404b, based on the number of detection frames generated, the detection frames are generated on average in the preset interval, and the distance between the detection frames and the initial detection frames is calculated, and the original detection frame with the shortest distance and a distance lower than a preset value is selected as the final target frame of the corresponding position.

[0112] In this embodiment, based on the above trust distance acquisition process, it also includes:

[0113] (4) Calculation of the number of detection frames generated. The number of detection frames generated is calculated for the long spacing between the trusted boxes (i.e., the preset spacing). First, in the segment where the long spacing is located, obtain the minimum and maximum values ​​of the trusted spacing near the long spacing (up to 6), and set the number of long spacing detection frames generated to L, where L∈[long spacing / maximum value, long spacing / minimum value]. Second, calculate the number of detection frames generated according to the following rules:

[0114] If there is an integer in the range and the number of clusters is within the range, take the number of clusters; if there is an integer in the range and the number of clusters is outside the range, take an integer in the range that is close to the number of clusters; if there is no integer in the range, take the integer closest to the range.

[0115] (5) Specific detection frame generation. According to the number of generation calculated in (4), the specific detection frame is generated on average in the long interval. Then, the distance between the generated detection frame and the initial detection frame is calculated. The minimum distance is less than (i.e. the preset value) is the final target frame of the position. If it is not lower than The detection frame generated by averaging the boxes is the final target frame, and the size of the detection frame is the average of the surrounding detection frames.

[0116] Step S405 , generating a detection frame for the blank areas at the beginning and end of the detection frame, and obtaining a detection frame after the blank areas at the beginning and end are filled.

[0117] In this embodiment, based on the above detection frame generation number calculation and detection frame generation process, the following steps are also included:

[0118] (6) Fill in the blank areas at the beginning and end of the detection frame. The previous steps only supplement and correct the detection frame between the first and last trusted boxes. There may be unrecognized targets before and after the beginning and the end. Following the previous steps, the detection frame is generated for the blank areas (if any) at the beginning and end of a row of detection frames. The detection frame of this blank area also has two steps, namely the calculation of the generated number and the generation of the specific detection frame. First, obtain the average spacing of all the final target frames in the segment where the first and last are located, and use the first and last trusted boxes as the benchmark to generate the detection frame until the center coordinates of the generated detection frame exceed the image boundary; secondly, the specific detection frame generation is the same as (5), and the detection frame size is taken as the average of all the final target frames in the segment where the first and last are located.

[0119] (7) Iterative optimization. A series of operations from step (1) to step (6) are executed in a loop. At the beginning of each iteration, the input data will be the output result of the previous iteration. After each iteration, the F1 score of the current round will be evaluated, which is a statistical indicator used to measure the detection accuracy and recall rate. If the F1 score of this round is higher than that of the previous round, the next round of iteration will continue. If the F1 score of this round does not increase or decrease, the algorithm will stop iterating and directly output the detection results of the previous round. This process ensures that each step of optimization is based on actual performance improvement, thereby gradually improving the overall detection accuracy.

[0120] (8) Threshold adjustment. Adjust the algorithm threshold (mainly the parameters in step (3)) according to the model prediction results of the training set and the validation set, for example, the number of nearest neighbors of KNN, the anomaly score threshold or the selection of information standard, etc., to obtain better target detection results.

[0121] As an example, Figure 3 As shown, the distribution guidance optimization algorithm based on the lamp detection results provided in this embodiment includes:

[0122] S11, start;

[0123] S12, reading the model target detection result;

[0124] S13, candidate box filtering and classification, applying DBSCAN clustering;

[0125] S14, remove multiple box clusters and overlapping boxes;

[0126] S15, remove global and local outlier intervals;

[0127] S16, calculating the number of detection frames with long spacing;

[0128] S17, generating a detection frame and matching it with the initial detection frame;

[0129] S18, supplement the blank areas at the beginning and end of the detection frame;

[0130] S19, verify whether the F1 score is optimized; if not, execute step S13; if yes, execute step S20;

[0131] S20, end.

[0132] The post-processing algorithm used in the present embodiment does not participate in the model training process, does not affect the overall architecture, is simple and lightweight to calculate, and can adjust the algorithm and threshold at any time according to the rules, thereby capturing the number and position of the correct targets well.

[0133] Based on the excellent tunnel lamp detection results already achieved by the deep learning model, this embodiment further applies a distribution-guided optimization algorithm to optimize the detection results. This method not only reduces the demand for training data, but also significantly improves the accuracy of lamp detection. This embodiment proposes a distribution-guided optimization technology, which further optimizes the prediction results of the deep learning model based on the distribution law that the spacing between tunnel lamps in the same lighting segment is roughly equal, and the spacing between lamps in adjacent lighting segments is different. It includes steps such as outlier removal, clustering, spacing calculation, detection frame generation, and iterative optimization, and ultimately achieves the purpose of removing redundant frames, adjusting offset detection frames, and supplementing undetected targets, thereby improving the accuracy of tunnel lamp detection.

[0134] This embodiment achieves the following technical effects through the above technical solution:

[0135] This embodiment obtains the original grayscale image of the tunnel and marks the category and location information of the lamps; the marked training data can be input into the target detection model for training, and the trained target detection model is used to analyze and process the tunnel image to be detected to obtain the detection result of the trained target detection model; and the detection result of the trained target detection model is optimized based on the distribution guided optimization strategy, and the optimized tunnel lamp detection result is output. This embodiment improves the detection results of the deep learning model based on the distribution guided optimization, improves the accuracy of tunnel lamp detection, reduces false positives and false negatives, and reduces the demand for training data.

[0136] Exemplary Devices

[0137] Based on the above embodiments, the present invention further provides a distributed guided optimized deep learning tunnel lamp detection system, comprising:

[0138] The data set preprocessing module is used to obtain the original grayscale image of the tunnel, annotate the category and location information of the lamps, and construct a training data set;

[0139] A target detection model training module is used to select a target detection model based on deep learning, input the labeled training data into the target detection model for training, and obtain a trained target detection model;

[0140] The target detection model detection module is used to input the tunnel image to be detected into the trained target detection model, analyze and process the tunnel image to be detected, predict the position and category information of the lamps, and obtain the detection result of the trained target detection model;

[0141] The distribution guided optimization module is used to optimize the detection results of the trained target detection model based on the distribution guided optimization strategy, and output the optimized tunnel lamp detection results.

[0142] This embodiment achieves the following technical effects through the above technical solution:

[0143] This embodiment obtains the original grayscale image of the tunnel and marks the category and location information of the lamps; the marked training data can be input into the target detection model for training, and the trained target detection model is used to analyze and process the tunnel image to be detected to obtain the detection result of the trained target detection model; and the detection result of the trained target detection model is optimized based on the distribution guided optimization strategy, and the optimized tunnel lamp detection result is output. This embodiment improves the detection results of the deep learning model based on the distribution guided optimization, improves the accuracy of tunnel lamp detection, reduces false positives and false negatives, and reduces the demand for training data.

[0144] Based on the above embodiment, the present invention further provides a terminal, whose principle block diagram can be as follows: Figure 4 shown.

[0145] The terminal includes: a processor, a memory, an interface, a display screen and a communication module connected through a system bus; wherein the processor of the terminal is used to provide computing and control capabilities; the memory of the terminal includes a storage medium and an internal memory; the storage medium stores an operating system and a computer program; the internal memory provides an environment for the operation of the operating system and the computer program in the storage medium; the interface is used to connect to external devices; the display screen is used to display corresponding information; and the communication module is used to communicate with a cloud server or other devices.

[0146] When the computer program is executed by a processor, it is used to implement the operation of the deep learning tunnel lighting detection method with distributed guided optimization.

[0147] It can be understood by those skilled in the art that Figure 4 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal to which the scheme of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0148] In one embodiment, a terminal is provided, which includes: a processor and a memory, wherein the memory stores a distributed guided optimized deep learning tunnel lamp detection program, and when the distributed guided optimized deep learning tunnel lamp detection program is executed by the processor, it is used to implement the operation of the above distributed guided optimized deep learning tunnel lamp detection method.

[0149] In one embodiment, a storage medium is provided, wherein the storage medium stores a distributed guided optimized deep learning tunnel lamp detection program, and when the distributed guided optimized deep learning tunnel lamp detection program is executed by a processor, it is used to implement the operation of the above distributed guided optimized deep learning tunnel lamp detection method.

[0150] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and volatile memory.

[0151] In summary, the present invention provides a distribution-guided optimized deep learning tunnel lamp detection method and system, including: obtaining the original grayscale image of the tunnel, and marking the category and location information of the lamps to construct a training data set; selecting a target detection model based on deep learning, inputting the labeled training data into the target detection model for training, and obtaining a trained target detection model; inputting the tunnel image to be detected into the trained target detection model, analyzing and processing the tunnel image to be detected, predicting the location and category information of the lamps, and obtaining the detection results of the trained target detection model; optimizing the detection results of the trained target detection model based on the distribution-guided optimization strategy, and outputting the optimized tunnel lamp detection results. The present invention improves the detection results of the deep learning model based on distribution-guided optimization, improves the accuracy of tunnel lamp detection, reduces false positives and false negatives, and reduces the demand for training data.

[0152] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A distribution-guided optimized deep learning tunnel lamp detection method, characterized in that: include: Obtain the original grayscale image of the tunnel, annotate the category and location information of the lamps, and construct a training data set; Selecting a target detection model based on deep learning, inputting the labeled training data into the target detection model for training, and obtaining a trained target detection model; Inputting the tunnel image to be detected into the trained target detection model, analyzing and processing the tunnel image to be detected, predicting the position and category information of the lamps, and obtaining the detection result of the trained target detection model; Optimizing the detection results of the trained target detection model based on the distribution guided optimization strategy, and outputting the optimized tunnel lamp detection results; The method of optimizing the detection result of the trained target detection model based on the distribution guided optimization strategy includes: Based on the distribution guided optimization strategy, the detection results of the trained target detection model are processed by removing redundant boxes to obtain a trusted box; The global outlier value to be removed corresponding to the distance between the trusted boxes is screened by a K-nearest neighbor algorithm, and the global outlier distance is removed according to the global outlier value to be removed; Using a piecewise linear fitting algorithm in combination with Akaike information criterion or Bayesian information criterion to determine the number of segments and segmentation points in the trusted box, and eliminating local outlier intervals according to the number of segments and the segmentation points; Calculating the number of detection frame generation for the preset distances between the trusted boxes, generating a detection frame according to the calculated number of detection frame generation, and performing initial detection frame matching; Detection frames are generated for the blank areas at the beginning and end of the detection frame to obtain a detection frame after the blank areas at the beginning and end are supplemented.

2. The distribution-guided optimized deep learning tunnel lamp detection method according to claim 1 is characterized in that: The original grayscale image of the tunnel is obtained, and the category and location information of the lamps are annotated to construct a training data set, including: Acquire continuous grayscale images of a single tunnel based on the tunnel detection system to obtain the original grayscale image; Removing redundant white edges from the original grayscale image, compressing the image with the white edges removed to a preset range, and classifying and labeling the tunnel image according to different illumination levels; The classified and annotated image data are divided to obtain the training data set.

3. The distribution-guided optimized deep learning tunnel lamp detection method according to claim 2, characterized in that: The image data after classification and annotation is divided to obtain the training data set, and then the following steps are included: Affine transformation, image inversion, mirroring, image brightness and contrast transformation, and Gaussian blur operation are used to retain target position features, simulate tunnel environments under different lighting conditions, and expand the training data set to a preset number.

4. The distribution-guided optimized deep learning tunnel lamp detection method according to claim 1, characterized in that: The selecting a target detection model based on deep learning and inputting the labeled training data into the target detection model for training includes: Select the deep learning-based target detection model according to the detection task requirements; The labeled training data is input into the target detection model for training, the model parameters are adjusted through a back propagation algorithm, the characteristics and patterns of the tunnel lamps are learned, and the trained target detection model is obtained.

5. The distribution-guided optimized deep learning tunnel lamp detection method according to claim 1, characterized in that: The method of removing redundant frames from the detection results of the trained target detection model based on the distribution guided optimization strategy includes: For each grayscale image, reading the detection result of the trained object detection model; According to the y coordinate of the detection box in the detection result, the abnormal boxes outside the range of the lamps are removed and divided into upper and lower rows, and the x coordinates of the center of each row of boxes are clustered by using a clustering algorithm to obtain multiple box clusters; The boxes included in the multi-box cluster and the overlapping boxes are removed, and the remaining boxes are set as the trusted boxes.

6. The distribution-guided optimized deep learning tunnel lamp detection method according to claim 1, characterized in that: The step of calculating the number of detection frame generation for the preset distances between the trusted boxes, generating a detection frame according to the calculated number of detection frame generation, and performing initial detection frame matching includes: In the segment where the preset interval is located, obtaining a minimum value and a maximum value of intervals corresponding to the trusted boxes near the preset interval, and setting the number of detection boxes generated at the preset interval according to the minimum value and the maximum value; According to the number of detection frames generated, the detection frames are generated on average in the preset interval, and the distance between the detection frames and the initial detection frames is calculated, and the original detection frame with the shortest distance and a distance lower than a preset value is selected as the final target frame of the corresponding position.

7. A distribution-guided optimized deep learning tunnel lamp detection system, used to implement the distribution-guided optimized deep learning tunnel lamp detection method as claimed in any one of claims 1 to 6, characterized in that: include: The data set preprocessing module is used to obtain the original grayscale image of the tunnel, annotate the category and location information of the lamps, and construct a training data set; A target detection model training module is used to select a target detection model based on deep learning, input the labeled training data into the target detection model for training, and obtain a trained target detection model; The target detection model detection module is used to input the tunnel image to be detected into the trained target detection model, analyze and process the tunnel image to be detected, predict the position and category information of the lamps, and obtain the detection result of the trained target detection model; The distribution guided optimization module is used to optimize the detection results of the trained target detection model based on the distribution guided optimization strategy, and output the optimized tunnel lamp detection results.

8. A terminal, characterized in that: include: A processor and a memory, wherein the memory stores a distribution-guided optimized deep learning tunnel lamp detection program, and when the distribution-guided optimized deep learning tunnel lamp detection program is executed by the processor, it is used to implement the operation of the distribution-guided optimized deep learning tunnel lamp detection method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a distribution-guided optimized deep learning tunnel lamp detection program, which, when executed by a processor, is used to implement the operation of the distribution-guided optimized deep learning tunnel lamp detection method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Target detection method and device, electronic equipment and readable storage medium

    CN118279555A

  • Real-time target detection streaming sensing method based on optical flow guidance

    CN119206189A