Intelligent identification and positioning method for traffic cone barrel

Traffic cone images are generated through GA-PSO hybrid optimization of BP neural network and deep convolutional generative adversarial network, and the YOLOv8 algorithm is improved to solve the problem of low traffic cone identification and positioning accuracy on highways, and realize intelligent identification of traffic cones. and positioning, providing basic conditions for its automatic retraction and release.

CN118608751APending Publication Date: 2024-09-06GUANGXI UNIV +1
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410657491.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-25
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Existing traffic cone detection methods have low identification and positioning accuracy during highway maintenance, which limits the automation and intelligent retraction and deployment of traffic cones.

Method used

The GA-PSO hybrid optimized BP neural network is used to calibrate the binocular camera, combined with the deep convolutional generative adversarial network (DCGAN) to generate traffic cone images, and the YOLOv8 algorithm is improved, including backbone network, neck network design and loss function adjustment. Identify lodging patterns and locate traffic cones.

Benefits of technology

It improves the recognition accuracy and positioning accuracy of traffic cones, provides image and data basis for the intelligent placement and recycling of traffic cones, and realizes the intelligent identification and positioning of traffic cones on highways.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118608751A
    Figure CN118608751A
Patent Text Reader

Abstract

The invention discloses an intelligent identification and positioning method for a traffic cone barrel, and the method comprises the following steps: calibrating a binocular camera based on a GA-PSO hybrid optimization BP neural network algorithm, and obtaining a conversion relation between a left camera and a right camera; using a deep convolutional generative adversarial network (DCGAN) to generate traffic cone-bucket images in various scenes; a YOLOv8 algorithm is improved, including optimization of backbone network and neck network design and adjustment of a loss function, identification of traffic cone buckets in different scenes, and discrimination of a lodging form; and after the traffic cone barrel in the image is successfully identified, the traffic cone barrel is positioned by using a binocular camera system. The method is used for capturing the lodging condition of the traffic cone barrel on the expressway, distinguishing the lodging form and positioning the position of the traffic cone barrel, and provides image and data basis for placement and recovery of the traffic cone barrel. The identification accuracy and positioning precision of the traffic cone barrels are optimized, and basic conditions are provided for intelligent placement and recovery of the traffic cone barrels.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of traffic technology, and in particular to a method for intelligently identifying and locating traffic cones. Background Art

[0002] As urbanization accelerates, highways have become an important link between cities, and the increasing number of cars has put higher demands on their carrying capacity. In this context, traffic cones are key props for highway maintenance. Their automatic retraction and deployment can reduce labor costs, ensure the safety of maintenance personnel, and realize the basis of intelligent highway maintenance. Realizing intelligent identification and positioning of traffic cones is particularly critical.

[0003] At present, the detection algorithms for structured roads with obvious edge features (such as urban roads and highways) are relatively mature, but there are relatively few studies on the detection of traffic cones temporarily set up during highway maintenance. Existing traffic cone detection methods are mainly divided into two categories: one is based on the color and structural features of the cones, and is identified through image processing technology. For example, the method of using HSV color space conversion and flood filling algorithm combined with least squares method to identify traffic cones by the School of Automotive Engineers of Hubei Automotive Industry College shows good results, but the position of the cones needs to be kept flat. The other category focuses on the application of neural network algorithms and radar detection algorithms, such as the YOLOv8 road scene target detection algorithm based on double-layer routing attention proposed by Guilin University of Electronic Technology. By improving the backbone network and introducing feature extraction modules and attention mechanisms, the accuracy of target detection in complex traffic scenes is effectively improved. In the field of visual positioning, two methods are mainly used to achieve spatial coordinate positioning of objects: PnP estimation of monocular cameras and depth information method of binocular cameras. The former converts the projection information from the camera coordinate system to the pixel coordinate system through the calibration parameters of the monocular camera, and then uses the PnP algorithm to estimate the position and posture of the camera relative to the world coordinate system. The latter calculates the three-dimensional coordinates of the object based on the depth map generated by the binocular camera according to the principle of binocular stereo vision.

[0004] At present, the retraction and deployment of traffic cones mainly rely on manual or automatic traffic cone retracting and deployment vehicles for auxiliary operations. Compared with the detection and recognition of traffic signs and traffic lights, traffic cones have received little attention. The disadvantage of automatic traffic cone retracting and deployment vehicles is that the recognition and positioning accuracy of traffic cones is not high, which restricts the automation and intelligence of traffic cone retraction and deployment.

[0005] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgment or any form of suggestion that the information constitutes the prior art already known to a person skilled in the art. Summary of the invention

[0006] The purpose of the present invention is to provide a method for intelligently identifying and locating traffic cones. The method is used to capture the collapse of traffic cones on highways, identify the collapse form and locate the position of traffic cones, and provide images and data basis for the placement and recovery of traffic cones.

[0007] To achieve the above object, the present invention provides a method for intelligently identifying and locating traffic cones, comprising the following steps:

[0008] Step 1: Calibrate the binocular camera based on the GA-PSO hybrid optimization BP neural network algorithm to obtain the conversion relationship between the left and right cameras;

[0009] Step 2: Use the deep convolutional generative adversarial network DCGAN to generate traffic cone images in various scenarios;

[0010] Step 3: Improve the YOLOv8 algorithm, including optimizing the backbone network and neck network design and adjusting the loss function, to identify traffic cones in different scenarios and distinguish the fallen shapes;

[0011] Step 4: After successfully identifying the traffic cone in the image, use the binocular camera system to locate the traffic cone.

[0012] Preferably, in the above technical solution, step 1 of calibrating the binocular camera based on the GA-PSO hybrid optimized BP neural network algorithm includes:

[0013] (1) Use the camera to take pictures of the calibration block and preprocess them, and save the images of the left and right cameras in a one-to-one correspondence;

[0014] (2) The optimal initial value and threshold calculated by the GA-PSO hybrid optimization algorithm are assigned to the BP neural network as neural network parameters, the relationship between image features and camera parameters is mapped, and the number of training samples, target accuracy, and maximum number of iterations are set;

[0015] (3) Verify and adjust the optimized parameters through additional image data to ensure that the calibration results meet the expected requirements and obtain the conversion relationship between the left and right cameras, which includes the extrinsic parameter matrix, the camera extrinsic parameter matrix and the distortion coefficient;

[0016] Preferably, in the above technical solution, the BP neural network algorithm model based on GA-PSO hybrid optimization includes:

[0017] 1) Establish BP neural network: Establish a 3-layer BP neural network, set the number and dimension of the particle swarm, and make the dimension equal to the number of BP neural network weights and parameters such as position and speed;

[0018] 2) Calculate the fitness value of each individual: Calculate the individual fitness value to determine whether each particle is in a suitable position, and use dynamic adjustment to give higher weights to samples with large errors, improve the fitting ability of difficult samples, and enhance the adaptability to various situations of the training set under different states of traffic cones; the specific expression of the error function E(w) is shown in formula (1.1):

[0019]

[0020] Where Y i , Z i are the predicted output and actual result of the i-th particle respectively; L is the total number of input samples; α i is the adaptive weight function. i The expression is shown in formula (1.2):

[0021]

[0022] In the formula, E i is the training error of the ith sample; mean(E) is the average of the training errors of all samples; β is a parameter that controls the degree of adjustment;

[0023] 3) Dynamically select particles by probability and place them into groups P1 and P2: Calculate the mean μ and variance σ of the current population fitness 2 , and standardize the fitness value of each particle E(w) norm , the standardized fitness value is calculated through the Sigmoid function to calculate the dynamic selection probability p of each particle dyn , the dynamic selection probability p dyn Compared with the traditional choice probability p fixed Linear combination gives p final , through p final The probability selected particles are put into P1, and the rest are put into P2;

[0024] 4) When the particle in population P1 updates its velocity, through the crossover operation in the GA algorithm, the new velocity update formula is as shown in formula (1.3):

[0025]

[0026] In the formula, v A,i is the velocity component of particle A in the i-th dimension, v B,i is the velocity component of particle B in the i-th dimension; v′ A,i , v′ B,i is the result of particle velocity crossover; v″ A , v″ BThe new speed update formula is a combination of the crossover operation of the GA algorithm and the PSO speed update rule; r1 and r2 are randomly generated acceleration weight coefficients between [0,1]; c1 and c2 are acceleration numbers, which take random values ​​around 2; ω is the inertia weight;

[0027] 5) When the velocity of the particle P1 in the population is updated, the new position update formula is as follows through the mutation operation in the GA algorithm:

[0028]

[0029] Where r3 and r4 are random numbers in [0,1]; is the formula after speed update; k is the number of iterations; f(k) is the mutation probability; X 上 、z 下 are the upper and lower boundary values ​​of the current particle respectively; based on the mutation operation, the particle can jump out of the local optimal solution;

[0030] 6) Compare the fitness values ​​of populations P1 and P2, and update the position and speed;

[0031] 7) Determine whether the algorithm has reached the termination condition, that is, reached the maximum number of evolutions or set the minimum fitness value; if the requirement is met, proceed to step 8), otherwise return to step 2) and repeat the iteration;

[0032] 8) The optimal initial value and threshold calculated by the GA-PSO hybrid optimization algorithm are assigned to the BP neural network as neural network parameters.

[0033] Preferably, in the above technical solution, step 2 uses a deep convolutional generative adversarial network DCGAN to generate traffic cone images in various scenarios, including the following steps:

[0034] 1) Take pictures of traffic cones in different geographical locations, road types and scenes to form a data set;

[0035] 2) Construct a DCGAN model, design the network structure of the generator and the discriminator, and set appropriate hyperparameters; the generator is responsible for converting random noise vectors into realistic traffic cone images, and the discriminator is responsible for distinguishing the generated fake images from real images; during the training process, an adversarial training method is used to alternately train the generator and the discriminator to optimize the model performance; a loss function is designed to guide model learning, and performance indicators are monitored during the training process to ensure that the model can effectively learn the characteristics and distribution of traffic cone images;

[0036] 3) Verify the quality and diversity of generated images, and adjust model parameters and structure to further improve the generation effect.

[0037] Preferably, in the above technical solution, in step 3, the YOLOv8 algorithm is improved, and the improved backbone network design includes:

[0038] 1) Dynamic snake convolution module DSConv: DSConv better adapts to the slender tubular structure based on the dynamic structure, so as to better perceive the key features; introduces continuity constraints so that each convolution position is based on the previous position to ensure the freedom and continuity of the receptive field transformation; in DSConv, a standard two-dimensional convolution kernel K of size 9 is used, and the center position of K in the x-axis and y-axis directions is:

[0039]

[0040]

[0041] In the formula, (x i+c ,y i+c ) is the center coordinate position, c is the horizontal distance of the center grid, and Δy is an offset in the y-axis direction;

[0042] 2) Triplet Attention Module: Triplet Attention module is used to suppress noise information. Given the input tensor χ∈R C×H×W , rotate 90 degrees counterclockwise along the H axis and the W axis to obtain tensors χ1 and χ2, and simplify the tensors through the Z-pool operation. Then use the standard 7×7 Conv convolution layer and Sigmoid activation layer to generate interactive attention weights about the channel dimension and spatial dimension H and W and apply them to χ1 and χ2. Finally, rotate 90 degrees clockwise along the H axis and the W axis to retain the original input shape of χ. The Z-pool is:

[0043] Z-pool(χ)=[MaxPool 0d (χ),AvgPool(χ)] (3.3)

[0044] In the formula, 0d is the 0th dimension where the maximum pooling operation and the average pooling operation occur. The other branch does not need to be rotated, and the rest of the operations are the same as the first two branches.

[0045] 3) Improved C2f module: ordinary convolution and dynamic snake convolution are combined into an improved convolution module CBS_DS, and the CBS_DS module replaces the CBS module in the residual module Bottleneck in the C2f module to form a new feature extraction module C2f_DS;

[0046] 4) Improved backbone network structure: The C2f modules of the 4th, 6th, and 8th layers of the original YOLOv8 network are replaced with C2f_DS modules, and the 2nd layer is not replaced; the Triplet Attention module is used at the end of the backbone network to reduce or suppress noise.

[0047] Preferably, in the above technical solution, in step 3, the YOLOv8 algorithm is improved, and the improved neck network design includes:

[0048] 1) SimAM Attention Mechanism: The SimAM Attention module is an attention mechanism module based on neuroscience theory. The energy function proposed based on neuroscience theory is:

[0049]

[0050] Y=ω t t+b t (3.5)

[0051] In the formula, all values ​​are scalars, w t and b t are the weights and biases of the transformation, λ is the regularization coefficient, t and x i is the input feature χ∈R C×H×W The target neuron and other neurons in the unit channel, i is the index in the spatial dimension, M = H × W is the number of neurons in the channel;

[0052] w in formula (3.5) t and b t There is a fast closed-form solution, which is easily obtained as:

[0053]

[0054]

[0055] In the formula, u t and σ t are the mean and variance of all neurons except t.

[0056] Since the solutions of (3.6) and (3.7) are obtained in a single channel, it is reasonable to assume that all images in a single channel follow the same distribution, and the minimum energy expression is obtained as follows:

[0057]

[0058] In the formula, energy The lower it is, the more different the neuron t is from the surrounding neurons, and the more important it is in the neural network; the entire process is element-wise calculation, using the Sigmoid function for feature refinement and machine learning for fast calculation;

[0059] 2) Improved neck network structure: The improved backbone network is sampled and fused with the feature information input from the 4th and 6th layers. The SimAM Attention module is used to reconstruct the features of the fused complex information, so that the network pays more attention to the target features.

[0060] Preferably, in the above technical solution, in step 3, the YOLOv8 algorithm is improved, and the improved loss function design includes:

[0061] YOLOv8 uses CIoU as the default loss function and designs a bounding box regression loss WIoU with a dynamic aggregation mechanism. WIoU is specifically expressed as:

[0062] L WIoU =rR WIoU L IoU (3.9)

[0063]

[0064] In the network formula (3.9), L IoU ∈[0,1] represents the intersection-over-union ratio between the predicted box and the real box, which can significantly reduce the high-quality anchor box R WIoU , R WIoU ∈[1,e] can significantly amplify the normal mass L IoU , which can effectively prevent the generation of gradients that hinder convergence; in formula (3.10), (x, y) is the center coordinate of the prediction box, (x gt ,y gt ) The center coordinate of the real frame, W g , H g is the size of the minimum enclosing box; the gain r is:

[0065]

[0066]

[0067] In formula (3.11), δ and α are hyperparameters, and the gain r is determined by the previous three parameters; in formula (3.12), is the mean of the dynamic cross ratio of the prediction box, β∈[0,+∞) is the outlier degree of the prediction box, which is used to evaluate the rationality of the annotation box. When β=δ, r=1;

[0068] Initialization before training Make L IoU= 1, the anchor frame gradient gain is the largest, avoiding leaving low-quality anchor frames; the training speed slows down in the later stage, and a small gradient gain is assigned to low-quality anchor frames to reduce harmful gradients and improve the accuracy of the model in detecting side frames.

[0069] Preferably, in the above technical solution, step 4 of positioning the traffic cone barrel comprises the following steps:

[0070] 1) After completing the stereo camera calibration based on the camera internal and external parameters obtained by the GA-PSO hybrid optimization BP neural network, the Bouguet algorithm is used for stereo correction to eliminate the perspective difference between the stereo cameras so that the images are aligned on the horizontal line and the viewing planes are parallel to eliminate distortion;

[0071] 2) Perform stereo matching on the left and right images to obtain a disparity map;

[0072] 3) Based on the principle of triangulation, combined with the transformation relationship between the left and right cameras and the parallax information, the three-dimensional coordinates of the object in the binocular camera coordinate system are calculated.

[0073] Preferably, in the above technical solution, step 2) performing stereo matching on the left and right images to obtain a disparity map comprises the following steps:

[0074] 1. Use Shi-Tomasi algorithm to extract corner features in the left and right images, and use BRIEF feature descriptor to describe the feature points;

[0075] 2. Use the nearest neighbor search algorithm to match feature points and obtain the corresponding feature point pairs in the left and right images;

[0076] 3. Through the adaptive local affine matching algorithm, false matches caused by lighting changes, occlusion, etc. are eliminated.

[0077] Preferably, in the above technical solution, step 3) calculating the three-dimensional coordinates of the object in the binocular camera coordinate system includes:

[0078] 1. Convert pixel coordinates to coordinates in the camera coordinate system, consider the internal and external parameters of the camera, and the pixel displacement information in the disparity map, and map the two-dimensional image coordinates to the three-dimensional space through triangulation;

[0079] 2. By converting the three-dimensional coordinates in the camera coordinate system into the world coordinate system, the real position of the object in the world coordinate system is obtained.

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

[0081] The invention discloses an intelligent identification and positioning method for traffic cones, which is used to capture the collapse of cones, identify the collapse morphology and locate the position of traffic cones on highways, and provide images and data basis for the placement and recovery of traffic cones. First, a GA-PSO hybrid optimization BP neural network algorithm is designed to calibrate the binocular camera to obtain the conversion relationship between the left and right cameras, that is, the external parameter matrix, the camera internal and external parameter matrix and the distortion coefficient; then, a deep convolution generative adversarial network (DCGAN) is used to generate traffic cone images in various scenes. Then, the YOLOv8 algorithm is improved, including the optimization of the backbone network and the neck network design and the adjustment of the loss function, so as to improve the recognition accuracy and discrimination ability of traffic cone detection in complex scenes such as insufficient lighting, small target overlap and occlusion. Finally, the camera parameters obtained in step 1 are combined, and the Bouguet algorithm is used for stereo correction, and then stereo matching is performed to calculate the parallax information of the traffic cones in the image, and the position of each traffic cone in three-dimensional space is calculated by combining the geometric relationship of the binocular camera and the triangulation principle. Optimize the recognition accuracy and positioning precision of traffic cones to provide basic conditions for realizing intelligent placement and recycling of traffic cones. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] Figure 1 is a flow chart of the intelligent identification and positioning method of traffic cones according to the present invention;

[0083] Figure 2 It is a BP graph based on GA-PSO hybrid optimization in the method of the present invention;

[0084] Figure 3 Improved YOLOv8 network structure diagram according to the method of the present invention;

[0085] Figure 4 Schematic diagram of traffic cone recognition using the improved YOLOv8 algorithm in the method of the present invention. DETAILED DESCRIPTION

[0086] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation modes.

[0087] Unless explicitly stated otherwise, throughout the specification and claims, the term “comprise” or variations such as “include” or “comprising”, etc., will be understood to include the stated elements or components but not to exclude other elements or components.

[0088] A method for intelligently identifying and locating traffic cones comprises the following steps:

[0089] Step 1: Stereo camera calibration based on GA-PSO hybrid optimization BP neural network algorithm

[0090] First, use the camera to take pictures of the calibration block and preprocess them, and save the images of the left and right cameras one by one. Then, the optimal initial value and threshold calculated by the GA-PSO hybrid optimization algorithm are assigned to the BP neural network as neural network parameters, mapping the relationship between image features and camera parameters, setting the number of training samples to 600, the target accuracy to 0.0001, and the maximum number of iterations to 10000. In addition, the optimized parameters are verified and adjusted through additional image data to ensure that the calibration results meet the expected requirements, and the conversion relationship between the left and right cameras is obtained, that is, the external parameter matrix, the camera internal and external parameter matrix and the distortion coefficient; among them, the BP neural network algorithm based on the GA-PSO hybrid optimization is as follows Figure 1 As shown, the details are as follows:

[0091] 1) Establish BP neural network: Establish a 3-layer BP neural network, set the number and dimension of the particle swarm, and make the dimension equal to the number of BP neural network weights and parameters such as position and speed;

[0092] 2) Calculate the fitness value of each individual. Calculate the individual fitness value to determine whether each particle is in a suitable position. In order to be closer to the actual problem and improve the generalization ability of the model, a dynamic adjustment method is used to give higher weights to samples with large errors, improve the fitting ability of difficult samples, and enhance the adaptability to various situations of the training set under different states of traffic cones. The specific expression of the error function E(w) is shown in formula (1.1):

[0093]

[0094] Where Y i , Z i are the predicted output and actual result of the ith particle respectively; l is the total number of input samples; α i is the adaptive weight function. i The expression is shown in formula (1.2):

[0095]

[0096] In the formula, E i is the training error of the ith sample; mean(E) is the average of the training errors of all samples; β is a parameter that controls the degree of adjustment;

[0097] 3) Dynamically select particles by probability and place them in groups P1 and P2. Calculate the mean μ and variance σ of the current population fitness 2 , and standardize the fitness value of each particle E(w) norm , the standardized fitness value is calculated through the Sigmoid function to calculate the dynamic selection probability p of each particle dyn , the dynamic selection probability p dynCompared with the traditional choice probability p fixed Linear combination gives p final , through p final The probability selection particles are placed in P1, and the remaining particles are placed in P2. The introduction of dynamic selection probability can increase the focus on exploration in the early stages of the algorithm, and pay more attention to the use of discovered excellent solutions in the later stages, achieving a balance between global search and local search.

[0098] 4) When the particle p1 in the population updates its velocity, through the crossover operation in the GA algorithm, the new velocity update formula is as shown in formula (1.3):

[0099]

[0100] In the formula, v A,i is the velocity component of particle A in the i-th dimension, v B,i is the velocity component of particle B in the i-th dimension; v′ A,i , v′ B,i is the result of particle velocity crossover; v″ A , v″ B The new speed update formula is a combination of the crossover operation of the GA algorithm and the PSO speed update rule; r1 and r2 are randomly generated acceleration weight coefficients between [0,1]; c1 and c2 are acceleration numbers, which take random values ​​around 2; ω is the inertia weight;

[0101] 5) When the velocity of the particle P1 in the population is updated, the new position update formula is as follows through the mutation operation in the GA algorithm:

[0102]

[0103] Where r3 and r4 are random numbers in [0,1]; is the formula after speed update; k is the number of iterations; f(k) is the mutation probability; X 上 , X 下 are the upper and lower boundary values ​​of the current particle respectively; based on the mutation operation, the particle can jump out of the local optimal solution;

[0104] 6) Compare the fitness values ​​of populations P1 and P2, and update the position and speed;

[0105] 7) Determine whether the algorithm has reached the termination condition, that is, reached the maximum number of evolutions or set the minimum fitness value; if the requirement is met, proceed to step 8), otherwise return to step 2) and repeat the iteration;

[0106] 8) The optimal initial value and threshold calculated by the GA-PSO hybrid optimization algorithm are assigned to the BP neural network as neural network parameters.

[0107] Step 2: Use DCGAN for data expansion

[0108] In the intelligent recognition system of traffic cones, high-quality and diverse training data is crucial. Factors including but not limited to environmental background, lighting conditions, and the angle of the traffic cones pose challenges to the comprehensiveness of the data set. However, it is difficult to obtain sufficient data covering all possible scenarios directly from the real environment. In order to improve the recognition accuracy of unknown scenes and the practicality and reliability of the system, Deep Convolution Generative Adversarial Aetworks (DCGAN) is used to generate traffic cone images in various scenarios. The specific process is as follows:

[0109] 1) In order to reduce the cost of producing traffic cone data and ensure the realism and diversity of the images generated by the deep convolutional generative adversarial network (DCGAN), drones are used to shoot different geographical locations, different road types, and different scenes. In this process, areas with high traffic volume such as highways, such as road maintenance areas, traffic accident sites, and areas that may be affected by traffic control and construction activities, such as gas stations and rest areas, are selected as training samples and real image samples. These areas cover different weather conditions and different time periods to ensure the diversity and representativeness of the data set, and the collected images are preprocessed to ensure the quality and consistency of the data.

[0110] 2) Build a DCGAN model, design the network structure of the generator and discriminator, and set appropriate hyperparameters. The generator is responsible for converting random noise vectors into realistic traffic cone images, and the discriminator is responsible for distinguishing between generated fake images and real images. During the training process, an adversarial training method is used, that is, the generator and the discriminator are trained alternately to optimize the model performance. A loss function is designed to guide model learning, and performance indicators are monitored during training to ensure that the model can effectively learn the characteristics and distribution of traffic cone images.

[0111] 3) Verify the quality and diversity of generated images, and adjust model parameters and structure to further improve the generation effect. Ensure that the generated traffic cone images can meet the system training and application requirements, and improve the performance and robustness of the system.

[0112] Step 3: Improve the YOLOv8 algorithm to identify traffic cones

[0113] The improved YOLOv8 (You Only Look Once Version 8) detection algorithm is used to detect the fallen traffic cones in different scenes such as insufficient light, overlapping small targets, and being blocked, and to identify the fallen shapes, providing images and data basis for the placement and recovery of traffic cones. The improved YOLOv8 algorithm is as follows:

[0114] 1. Improve backbone network design

[0115] 1) Dynamic Snake Convolution (DSConv). DSConv is better adapted to the slender tubular structure based on the dynamic structure, so as to better perceive the key features. The continuity constraint is introduced so that each convolution position is based on the previous position to ensure the freedom and continuity of the receptive field transformation. In DSConv, a standard two-dimensional convolution kernel K of size 9 is used, and the center position of K in the x-axis and y-axis directions is:

[0116]

[0117]

[0118] In the formula, (x i+c ,y i+c ) is the center coordinate position, c is the horizontal distance of the center grid, and Δy is an offset in the y-axis direction;

[0119] 2) Triplet Attention Module: DSConv is used to enhance the backbone network’s ability to extract features from traffic cones in different states, but this makes the backbone network more sensitive to background noise information. Therefore, the Triplet Attention module is used to suppress noise information. Given an input tensor of χ∈R C×H×W , rotate 90 degrees counterclockwise along the H axis and the W axis to obtain tensors χ1 and χ2, and simplify the tensors through the Z-pool operation. Then use the standard 7×7 Conv convolution layer and Sigmoid activation layer to generate interactive attention weights about the channel dimension and spatial dimension H and W and apply them to χ1 and χ2. Finally, rotate 90 degrees clockwise along the H axis and the W axis to retain the original input shape of χ. The Z-pool is:

[0120] Z-pool(χ)=[MaxPool 0d (χ),AvgPool(χ)] (3.3)

[0121] In the formula, 0d is the 0th dimension where the maximum pooling operation and the average pooling operation occur. The other branch does not need to be rotated, and the rest of the operations are the same as the first two branches.

[0122] 3) Improved C2f module: Directly replacing the Conv module in the original backbone network with the dynamic snake convolution module will greatly increase the model calculation amount. Therefore, the ordinary convolution and dynamic snake convolution are combined to form an improved convolution module CBS_DS. The CBS_DS module replaces the CBS module in the residual module Bottleneck in the C2f module to form a new feature extraction module C2f_DS, so that the model calculation amount is not greatly increased but the feature extraction receptive field is expanded.

[0123] 4) Improved backbone network structure: The reasonable use of C2f_DS modules can improve the network model's recognition performance for occluded targets. Small target detection relies on shallow information, which will be lost a lot due to the increase in network depth in the early stage of the network. Therefore, the C2f modules of the 4th, 6th, and 8th layers of the original YOLOv8 network are replaced with C2f_DS modules, and the 2nd layer is not replaced. The Triplet Attention module is used at the end of the backbone network to reduce or suppress noise and improve the robustness of the model.

[0124] 2. Improved Neck Network Design

[0125] 1) SimAM Attention Mechanism: The SimAM Attention module is an attention mechanism module based on neuroscience theory. The energy function proposed based on neuroscience theory is:

[0126]

[0127] Y=ω t t+b t (3.5)

[0128] In the formula, all values ​​are scalars, w t and b t are the weights and biases of the transformation, λ is the regularization coefficient, t and x i is the input feature χ∈R C×H×W The target neuron and other neurons in the unit channel, i is the index in the spatial dimension, M = H × W is the number of neurons in the channel;

[0129] w in formula (3.5) t and b t There is a fast closed-form solution, which is easily obtained as:

[0130]

[0131]

[0132] In the formula, u t and σ t are the mean and variance of all neurons except t.

[0133] Since the solutions of (3.6) and (3.7) are obtained in a single channel, it is reasonable to assume that all images in a single channel follow the same distribution, and the minimum energy expression is obtained as follows:

[0134]

[0135] In the formula, energy The lower it is, the more different the neuron t is from the surrounding neurons, and the more important it is in the neural network; the entire process is element-wise calculation, using the Sigmoid function for feature refinement and machine learning for fast calculation;

[0136] 2) Improved neck network structure: The neck network structure of YOLOv8 is similar to a path aggregation network with a feature pyramid network. It extracts and fuses multi-scale features through up and down sampling. The improved backbone network is sampled and fused with the input feature information from the 4th and 6th layers. The SimAM Attention module is used to reconstruct the features of the fused complex information, so that the network pays more attention to the target features, so as to achieve the goal of not increasing the consumption of computing resources too much but improving the model's ability to locate the features of interest.

[0137] 3. Improve the loss function design

[0138] YOLOv8 uses CIoU as the default loss function. CIoU has comprehensive information consideration and better robustness to larger boxes, but its computational complexity increases. Performance depends on parameter adjustment and is affected by tasks and datasets. Therefore, a bounding box regression loss Wise-IoU (hereinafter referred to as WIoU) with a dynamic aggregation mechanism is designed. WIoU is a dynamic non-monotonic frequency modulation mechanism that reduces the competitiveness of high-quality anchor boxes, reduces harmful gradients generated by low-quality samples, and improves the overall performance of the detection head. WIoU is specifically expressed as:

[0139] L WIoU =rR WIoU L IoU (3.9)

[0140]

[0141] In the network formula (3.9), L IoU ∈[0,1] represents the intersection-over-union ratio between the predicted box and the real box, which can significantly reduce the high-quality anchor box R WIoU , R WIoU ∈[1,e] can significantly amplify the normal mass L IoU , which can effectively prevent the generation of gradients that hinder convergence; in formula (3.10), (x, y) is the center coordinate of the prediction box, (x gt,y gt ) The center coordinate of the real frame, W g , H g is the size of the minimum enclosing box; the gain r is:

[0142]

[0143]

[0144] In formula (3.11), δ and α are hyperparameters, and the gain r is determined by the previous three parameters; in formula (3.12), is the mean of the dynamic cross ratio of the prediction box, β∈[0,+∞) is the outlier degree of the prediction box, which is used to evaluate the rationality of the annotation box. When β=δ, r=1.

[0145] Initialization before training Make L IoU = 1, the anchor frame gradient gain is the largest, avoiding leaving low-quality anchor frames; the training speed slows down in the later stage, and a small gradient gain is assigned to low-quality anchor frames to reduce harmful gradients and improve the accuracy of the model in detecting side frames.

[0146] Step 4: Positioning traffic cones

[0147] After completing the binocular camera calibration in step one, the Bouguet algorithm is used for stereo correction. Then stereo matching is performed to calculate the parallax information of the traffic cone in the image, that is, the position difference of the corresponding points of the left and right images of a traffic cone. Combined with the geometric relationship of the binocular camera and the principle of triangulation, the position of the traffic cone in three-dimensional space is calculated.

[0148] After successfully identifying the traffic cones in the image, the specific process of using the binocular camera system to locate the traffic cones is as follows: First, after completing the binocular camera calibration based on the GA-PSO hybrid optimized BP neural network to obtain the conversion relationship between the left and right cameras, the Bouguet algorithm is used for stereo correction to eliminate the difference in viewing angles between the binocular cameras, so that the images are aligned on the horizontal line and the viewing planes are parallel to eliminate distortion. Then, the left and right images are stereo matched to obtain the disparity map. The process is as follows: First, the Shi-Tomasi algorithm is used to extract the corner point features in the left and right images, and the BRIEF feature descriptor is used to describe the feature points. Subsequently, the nearest neighbor search algorithm is used to match the feature points to obtain the corresponding feature point pairs in the left and right images. The adaptive local affine matching algorithm is used to eliminate the mismatch caused by illumination changes, occlusion, etc., and improve the accuracy and stability of the matching. Then, based on the principle of triangulation, combined with the conversion relationship between the left and right cameras and the disparity information, the three-dimensional coordinates of the object in the binocular camera coordinate system are calculated. This step includes converting pixel coordinates into coordinates in the camera coordinate system, and considering the internal and external parameters of the camera, as well as the pixel displacement information in the disparity map, the two-dimensional image coordinates are mapped to the three-dimensional space through triangulation. Finally, by converting the three-dimensional coordinates in the camera coordinate system to the world coordinate system, the real position of the object in the world coordinate system is obtained.

[0149] The foregoing description of specific exemplary embodiments of the present invention is for the purpose of illustration and demonstration. These descriptions are not intended to limit the present invention to the precise form disclosed, and it is clear that many changes and variations can be made based on the above teachings. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the present invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the present invention and various different selections and changes. The scope of the present invention is intended to be limited by the claims and their equivalents.

Claims

1. A method for intelligent identification and positioning of traffic cones, characterized in that: The following steps are involved: Step 1: Calibrate the binocular camera based on the GA-PSO hybrid optimization BP neural network algorithm to obtain the conversion relationship between the left and right cameras; Step 2: Use the deep convolutional generative adversarial network DCGAN to generate traffic cone images in various scenarios; Step 3: Improve the YOLOv8 algorithm, including optimizing the backbone network and neck network design and adjusting the loss function, to identify traffic cones in different scenarios and distinguish the fallen shapes; Step 4: After successfully identifying the traffic cone in the image, use the binocular camera system to locate the traffic cone.

2. The intelligent identification and positioning method of traffic cones according to claim 1 is characterized in that: Step 1: Calibrate the binocular camera based on the GA-PSO hybrid optimization BP neural network algorithm, including: (1) Use the camera to take pictures of the calibration block and preprocess them, and save the images of the left and right cameras in a one-to-one correspondence; (2) The optimal initial value and threshold calculated by the GA-PSO hybrid optimization algorithm are assigned to the BP neural network as neural network parameters, mapping the relationship between image features and the number of cameras, and setting the number of training samples, target accuracy, and maximum number of iterations; (3) Verify and adjust the optimized parameters through additional image data to ensure that the calibration results meet the expected requirements and obtain the transformation relationship between the left and right cameras. The transformation relationship includes the extrinsic parameter matrix, the camera extrinsic parameter matrix and the distortion coefficient.

3. The intelligent identification and positioning method of traffic cones according to claim 2 is characterized in that: The BP neural network algorithm model based on GA-PSO hybrid optimization includes: 1) Establish BP neural network: Establish a 3-layer BP neural network, set the number and dimension of the particle swarm, and make the dimension equal to the number of BP neural network weights and parameters such as position and speed; 2) Calculate the fitness value of each individual: Calculate the individual fitness value to determine whether each particle is in a suitable position, and use dynamic adjustment to give higher weights to samples with large errors, improve the fitting ability of difficult samples, and enhance the adaptability to various situations of the training set under different states of traffic cones; the specific expression of the error function E(w) is shown in formula (1.1): Where Y i , Z i are the predicted output and actual result of the ith particle respectively; L is the total number of input samples; α i is the adaptive weight function. i The expression is shown in formula (1.2): In the formula, E i is the training error of the ith sample; mean(E) is the average of the training errors of all samples; β is a parameter that controls the degree of adjustment; 3) Dynamically select particles by probability and place them into groups P1 and P2: Calculate the mean μ and variance σ of the current population fitness 2 , and standardize the fitness value of each particle E(w) norm , the standardized fitness value is calculated through the Sigmoid function to calculate the dynamic selection probability p of each particle dyn , the dynamic selection probability p dyn Compared with the traditional choice probability p fixed Linear combination gives p final , through p final The probability selected particles are put into P1, and the rest are put into P2; 4) When the particle in population P1 updates its velocity, through the crossover operation in the GA algorithm, the new velocity update formula is as shown in formula (1.3): In the formula, v A,i is the velocity component of particle A in the i-th dimension, vB ,i is the velocity component of particle B in the i-th dimension; v′ A,i , v′ B,i is the result of particle velocity crossover; v″ A , v″ B The new speed update formula is a combination of the crossover operation of the GA algorithm and the PSO speed update rule; r1 and r2 are randomly generated acceleration weight coefficients between [0,1]; c1 and c2 are acceleration numbers, which take random values ​​around 2; ω is the inertia weight; 5) When the velocity of the particle P1 in the population is updated, the new position update formula is as follows through the mutation operation in the GA algorithm: Where r3 and r4 are random numbers in [0,1]; is the formula after speed update; k is the number of iterations; f(k) is the mutation probability; X 上 , X 下 are the upper and lower boundary values ​​of the current particle respectively; based on the mutation operation, the particle can jump out of the local optimal solution; 6) Compare the fitness values ​​of populations P1 and P2, and update the position and speed; 7) Determine whether the algorithm has reached the termination condition, that is, reached the maximum number of evolutions or set the minimum fitness value; if the requirement is met, proceed to step 8), otherwise return to step 2) and repeat the iteration; 8) The optimal initial value and threshold calculated by the GA-PSO hybrid optimization algorithm are assigned to the BP neural network as neural network parameters.

4. The intelligent identification and positioning method of traffic cones according to claim 1 is characterized in that: Step 2 uses the deep convolutional generative adversarial network DCGAN to generate traffic cone images in various scenarios, including the following steps: 1) Take pictures of traffic cones in different geographical locations, road types and scenes to form a data set; 2) Construct a DCGAN model, design the network structure of the generator and the discriminator, and set appropriate hyperparameters; the generator is responsible for converting random noise vectors into realistic traffic cone images, and the discriminator is responsible for distinguishing the generated fake images from real images; during the training process, an adversarial training method is used to alternately train the generator and the discriminator to optimize the model performance; a loss function is designed to guide model learning, and performance indicators are monitored during the training process to ensure that the model can effectively learn the characteristics and distribution of traffic cone images; 3) Verify the quality and diversity of generated images, and adjust model parameters and structure to further improve the generation effect.

5. The intelligent identification and positioning method of traffic cones according to claim 1 is characterized in that: In step 3, the YOLOv8 algorithm is improved. The improved backbone network design includes: 1) Dynamic snake convolution module DSConv: DSConv better adapts to the slender tubular structure based on the dynamic structure, so as to better perceive the key features; introduces continuity constraints so that each convolution position is based on the previous position to ensure the freedom and continuity of the receptive field transformation; in DSConv, a standard two-dimensional convolution kernel K of size 9 is used, and the center position of K in the x-axis and y-axis directions is: In the formula, (x i+c ,y i+c ) is the center coordinate position, c is the horizontal distance of the center grid, and Δy is an offset in the y-axis direction; 2) Triplet Attention Module: Triplet Attention module is used to suppress noise information. Given the input tensor χ∈R C×H×W , rotate 90 degrees counterclockwise along the H axis and the W axis to obtain tensors χ1 and χ2, and simplify the tensors through the Z-pool operation. Then use the standard 7×7 Conv convolution layer and Sigmoid activation layer to generate interactive attention weights about the channel dimension and spatial dimension H and W and apply them to χ1 and χ2. Finally, rotate 90 degrees clockwise along the H axis and the W axis to retain the original input shape of χ. The Z-pool is: Z-pool(x)=[MaxPool 0d (x),AvgPool(x)] (3.3) In the formula, 0d is the 0th dimension where the maximum pooling operation and the average pooling operation occur. The other branch does not need to be rotated, and the rest of the operations are the same as the first two branches. 3) Improved C2f module: ordinary convolution and dynamic snake convolution are combined into an improved convolution module CBS_DS, and the CBS_DS module replaces the CBS module in the residual module Bottleneck in the C2f module to form a new feature extraction module C2f_DS; 4) Improved backbone network structure: The C2f modules of the 4th, 6th, and 8th layers of the original YOLOv8 network are replaced with C2f_DS modules, and the 2nd layer is not replaced; the Triplet Attention module is used at the end of the backbone network to reduce or suppress noise.

6. The intelligent identification and positioning method of traffic cones according to claim 1 is characterized in that: In step 3, the YOLOv8 algorithm is improved. The improved neck network design includes: 1) SimAM Attention Mechanism: The SimAM Attention module is an attention mechanism module based on neuroscience theory. The energy function proposed based on neuroscience theory is: Y=ω t t+b t (3.5) In the formula, all values ​​are scalars, w t and b t are the weights and biases of the transformation, λ is the regularization coefficient, t and x i is the input feature χ∈R C×H×W The target neuron and other neurons in the unit channel, i is the index in the spatial dimension, M = H × W is the number of neurons in the channel; w in formula (3.5) t and b t There is a fast closed-form solution, which is easily obtained as: In the formula, u t and σ t are the mean and variance of all neurons except t. Since the solutions of (3.6) and (3.7) are obtained in a single channel, it is reasonable to assume that all images in a single channel follow the same distribution, and the minimum energy expression is obtained as follows: In the formula, energy The lower it is, the more different the neuron t is from the surrounding neurons, and the more important it is in the neural network; the entire process is element-wise calculation, using the Sigmoid function for feature refinement and machine learning for fast calculation; 2) Improved neck network structure: The improved backbone network is sampled and fused with the feature information input from the 4th and 6th layers. The SimAM Attention module is used to reconstruct the features of the fused complex information, so that the network pays more attention to the target features.

7. The intelligent identification and positioning method of traffic cones according to claim 1 is characterized in that: In step 3, the YOLOv8 algorithm is improved, and the improved loss function design includes: YOLOv8 uses CIoU as the default loss function and designs a bounding box regression loss WIoU with a dynamic aggregation mechanism. WIoU is specifically expressed as: L WIoU =rR WIoU L IoU (3.9) In the network formula (3.9), L IoU ∈[0,1] represents the intersection-over-union ratio between the predicted box and the real box, which can significantly reduce the high-quality anchor box R WIoU , R WIoU ∈[1,e] can significantly amplify the normal mass L IoU , which can effectively prevent the generation of gradients that hinder convergence; in formula (3.10), (x, y) is the center coordinate of the prediction box, (x gt ,y gt ) The center coordinate of the real frame, W g , H g is the size of the minimum enclosing box; the gain r is: In formula (3.11), δ and α are hyperparameters, and the gain r is determined by the previous three parameters; in formula (3.12), is the mean of the dynamic cross ratio of the prediction box, β∈[0,+∞) is the outlier degree of the prediction box, which is used to evaluate the rationality of the annotation box. When β=δ, r=1; Initialization before training Make L IoU = 1, the anchor frame gradient gain is the largest, avoiding leaving low-quality anchor frames; the training speed slows down in the later stage, and a small gradient gain is assigned to low-quality anchor frames to reduce harmful gradients and improve the accuracy of the model in detecting side frames.

8. The intelligent identification and positioning method of traffic cones according to claim 1 is characterized in that: Step 4: Position the traffic cones, including the following steps: 1) After completing the binocular camera calibration based on the conversion relationship between the left and right cameras obtained by the GA-PSO hybrid optimization BP neural network, the Bouguet algorithm is used for stereo correction to eliminate the perspective difference between the binocular cameras so that the images are aligned on the horizontal line and the viewing planes are parallel to eliminate distortion; 2) Perform stereo matching on the left and right images to obtain a disparity map; 3) Based on the principle of triangulation, combined with the transformation relationship and parallax information between the left and right cameras, the three-dimensional coordinates of the object in the binocular camera coordinate system are calculated.

9. The intelligent identification and positioning method of traffic cones according to claim 8 is characterized in that: Step 2) stereo matching the left and right images to obtain a disparity map, including the following steps:

1. Use Shi-Tomasi algorithm to extract corner features in the left and right images, and use BRIEF feature descriptor to describe the feature points; 2. Use the nearest neighbor search algorithm to match feature points and obtain the corresponding feature point pairs in the left and right images; 3. Through the adaptive local affine matching algorithm, false matches caused by lighting changes, occlusion, etc. are eliminated.

10. The intelligent identification and positioning method of traffic cones according to claim 8, characterized in that: Step 3) Calculate the three-dimensional coordinates of the object in the binocular camera coordinate system, including:

1. Convert pixel coordinates to coordinates in the camera coordinate system, consider the internal and external parameters of the camera, and the pixel displacement information in the disparity map, and map the two-dimensional image coordinates to the three-dimensional space through triangulation; 2. By converting the three-dimensional coordinates in the camera coordinate system into the world coordinate system, the real position of the object in the world coordinate system is obtained.

Citation Information

Cited By

  • Pavement elevation measurement system based on stereoscopic vision and measurement method thereof

    CN119268646A

  • Intelligent mainboard display driving system based on 3D display and reality augmentation

    CN119512490A

  • Infrared photovoltaic module defect identification method, device and equipment and storage medium

    CN120689601A

  • Video-based lodging traffic cone automatic righting system

    CN120823536A