Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The embodiment of the disclosure provides a method and a device for detecting a target in vehicle-road cooperation and a road test device.
In one embodiment of the present disclosure, a method for detecting a target in vehicle-road cooperation is provided, where the method includes:
performing target detection on the image to obtain a candidate target region in the image, a confidence coefficient of the candidate target region and a degree of shielding of the candidate target region;
updating the confidence coefficient of the candidate target area based on the intersection ratio among the candidate target areas and the shielding degree of the candidate target area;
and detecting the target in the image from the candidate target region according to the updated confidence.
The intersection ratio among the candidate target regions can reflect the contact ratio among the candidate target regions, and the shielding degree of the candidate target regions can reflect the shielding degree of the candidate target regions, so that the confidence coefficient is updated according to the intersection ratio and the shielding degree, the confidence coefficient of the target regions can refer to the overlapping condition among the target regions, the updated confidence coefficient of the candidate target regions is more similar to the actual condition, the image is subjected to target detection according to the updated confidence coefficient, and the target detection accuracy can be improved.
The execution body of the embodiment of the present disclosure is explained below.
The execution subject of the embodiment of the present disclosure may be an electronic device integrated with a target detection function, where the electronic device may be: desktop computers, notebook computers, servers, image acquisition equipment, and the like. Wherein, the image capturing apparatus may include: video cameras, still cameras, automobile data recorders, etc.
The scheme provided by the embodiment of the disclosure can be applied to target detection of images acquired under application scenes such as road monitoring and vehicle path planning of vehicle and road cooperation V2X.
In addition, the scheme provided by the embodiment of the disclosure can also be used for carrying out target detection on images acquired in other scenes. For example, the other scenes may be scenes with highly dense persons such as subway stations, shopping malls, and concert, and image acquisition is performed on the scenes, and the acquired images are also often dense in persons, so that the faces of some persons are easily shielded by the faces of other persons. The scene can also be a scene with dense personnel, such as a museum entrance, a bank hall and the like, image acquisition is carried out on the scene, and the situation that the faces of the personnel are shielded by other personnel or buildings and the like can occur in the acquired image.
The above is merely an example of an application scenario of the embodiment of the present disclosure, and the present disclosure is not limited thereto.
The object may be a human face, an animal, a vehicle, etc.
The following specifically describes a target detection method in vehicle-road cooperation provided by an embodiment of the present disclosure.
Referring to fig. 1, fig. 1 is a schematic flowchart of a method for detecting an object in vehicle-road coordination according to an embodiment of the present disclosure, where the method includes the following steps S101 to S103.
Step S101: and carrying out target detection on the image to obtain a candidate target region in the image, the confidence coefficient of the candidate target region and the sheltered degree of the candidate target region.
The image may be acquired for a particular scene. The scene may include a vehicle driving scene and a parking lot scene, in which case the target is a vehicle; the scenes can also include public space scenes such as subway stations and high-speed railway stations, and in this case, the target is people.
For different types of targets, different detection algorithms can be adopted to realize target detection, such as a face detection algorithm, a license plate detection algorithm and the like.
The candidate target regions refer to: areas where the target may be present are considered possible by target detection. Taking fig. 2 as an example, the region surrounded by the rectangular frames in fig. 2 is a candidate target region obtained by performing animal detection on an image.
Confidence of candidate target regions reflects: the likelihood of the target being present in the candidate target region is large. The above confidence may be expressed in decimal, percentage, or the like. The larger the value of the confidence, the higher the probability that the target exists in the candidate target region.
For example: in the case where the target is a person, when the confidence of the candidate target region a is higher than that of the candidate target region B, it indicates that the probability that a person is present in the candidate target region a is higher than that in the candidate target region B.
The occlusion degree of the candidate target region is reflected: the degree to which the candidate target region is occluded. The occlusion degree can be expressed by decimal fraction, percentage, etc., and can also be expressed by an occlusion grade serial number, the occlusion grade can comprise severe occlusion, moderate occlusion, light occlusion, etc., and the occlusion grade serial number comprises 1, 2, 3, etc.
The specific target detection process can be seen in the following examples, which are not detailed herein.
Step S102: and updating the confidence degree of the candidate target region based on the intersection ratio between the candidate target regions and the occlusion degree of the candidate target region.
The intersection ratio between candidate target regions is used to describe the degree of coincidence between two candidate target regions.
Specifically, the overlapping area between the two candidate target regions may be calculated to obtain a first area, the sum of the areas of the two candidate target regions is calculated to obtain a second area, then the difference between the second area and the first area is calculated to obtain a third area, and the ratio between the first area and the third area is determined as the intersection ratio between the candidate target regions.
For example: the area of the candidate target region a is 48, the area of the candidate target region B is 32, the overlapping area of the candidate target region a and the candidate target region B is 16, that is, the first area is 16, the total area of the candidate target region a and the candidate target region B is (46+32) 80, that is, the second area is 80, the difference between the second area and the first area (80-16) is calculated to be 64, that is, the third area is 64, the ratio of the first area to the third area is calculated to obtain 16/64 of 0.25, and 0.25 is the intersection ratio between the candidate target regions.
In one implementation, a reference region may be selected from each candidate target region, an intersection ratio between each other candidate target region and the reference region may be calculated, and the calculated intersection ratio may be determined as an intersection ratio for updating the confidence of the candidate target region. For example: the region with the highest confidence may be selected from the candidate target regions as the reference region.
In another implementation manner, for each candidate target region, an intersection ratio may be selected from intersection ratios between the candidate target region and other candidate target regions, and the selected intersection ratio is determined as an intersection ratio used for updating the confidence of the candidate target region. For example: the maximum cross-over ratio, the average cross-over ratio, the median cross-over ratio, or the minimum cross-over ratio may be selected from the plurality of cross-over ratios described above.
When the confidence of the candidate target region is updated, an adjustment coefficient may be calculated according to a preset first weight and a preset second weight according to the intersection ratio between the candidate target regions and the shielding degree of the candidate target region, and the confidence of the candidate target region may be updated according to the adjustment coefficient obtained by calculation.
Specifically, the product between the intersection ratio between the candidate target regions and the first weight may be calculated, the product between the occlusion degree of the candidate target regions and the second weight may be calculated, and the sum of the two calculated products may be used as the adjustment coefficient.
For example: the intersection ratio among the candidate target regions is 80%, the occlusion degree of the candidate target regions is 50%, the preset first weight is 0.8, the preset second weight is 0.2, and the product of the intersection ratio among the candidate target regions and the first weight is calculated as follows: 0.8 × 80% ═ 64%, the product between the occlusion degree of the candidate target region and the second weight is calculated as: 0.2 × 50% ═ 10%, the sum of the two products calculated is: the adjustment coefficient was 74% when 64% + 10% + was 74%.
After the adjustment coefficient is obtained by calculation, a product between the adjustment coefficient and the confidence of the candidate target region may be calculated as the updated confidence of the candidate target region.
Step S103: and detecting the target in the image from the candidate target region according to the updated confidence.
In one embodiment of the present disclosure, a candidate target region with an updated confidence greater than a preset confidence threshold may be selected, and a target in the selected candidate target region may be determined as a target in the image.
The preset confidence threshold may be set by a worker according to experience, for example: where confidence is expressed as a percentage, the preset confidence threshold may be 90%, 95%, etc.
The above target determination process is described as an example, and it is assumed that the confidence levels of the updated candidate target regions are respectively: 80%, 70%, 90%, 95%, with a preset confidence threshold of 85%, and the updated confidence greater than 85% is 90%, 95%, where the updated confidence of region 1 is 90%, and the updated confidence of region 2 is 95%, so the target in region 1 and the target in region 2 are the targets in the image.
Thus, for candidate target regions with confidence levels greater than the preset confidence level threshold, the likelihood of including a target in these candidate target regions is higher than the likelihood of including a target in other candidate target regions. Therefore, the target in the candidate target region with the confidence coefficient larger than the preset confidence coefficient threshold value is determined as the target in the image, and the accuracy of the obtained target is high.
In an embodiment of the present disclosure, a preset number of candidate target regions with the maximum updated confidence may be further selected, and a target in the selected candidate target regions is determined as a target in the image.
The preset number may be set by a worker according to experience, for example: the preset number may be 1, 3, 5, etc.
The above object determination process is explained as an example. The confidence degrees of the target regions are assumed to be: 80%, 70%, 90% and 95%, wherein the preset number is 3, and the 3 with the maximum confidence degrees after updating are respectively 95%, 90% and 80%; and determining the target in the candidate target region with the updated confidence degrees of 95%, 90% and 80% as the target in the image.
Thus, for a preset number of candidate target regions with the highest confidence, the probability of including a target in these candidate target regions is higher than the probability of including a target in other candidate regions. Therefore, the target in the preset number of candidate target regions with the maximum confidence coefficient is determined as the target in the image, and the accuracy of the obtained target is high.
As can be seen from the above, when the scheme provided by the embodiment of the present disclosure is applied to target detection, the confidence of the candidate target region is updated according to the intersection ratio between the candidate target regions and the occlusion degree of the candidate target region, and then the target in the image is detected from the candidate target region based on the updated confidence. The coincidence ratio between the candidate target regions can reflect the coincidence degree between the candidate target regions, and the shielding degree of the candidate target regions can reflect the shielding degree of the candidate target regions, so that the confidence coefficient is updated according to the coincidence ratio and the shielding degree, the confidence coefficient of the target regions can refer to the overlapping condition between the target regions, and the updated confidence coefficient of the candidate target regions is more similar to the actual condition, thereby performing target detection on the image according to the updated confidence coefficient, and improving the accuracy of the target detection.
In addition, in dense scenes, such as dense pedestrian traffic and dense vehicle traffic, the situation that the target is blocked is particularly serious. For the images of the dense scenes, the occlusion degree of each candidate target region is high, so that targets in the candidate target regions are incomplete, and the obtained confidence degree error of the candidate target regions is large. The confidence coefficient of the candidate target area is updated according to the sheltered degree of the candidate target area, so that the error influence on the confidence coefficient when each candidate target area is sheltered can be effectively eliminated, the accuracy of the updated confidence coefficient is high, and an accurate target is obtained through detection. Therefore, the scheme provided by the embodiment of the disclosure can be better adapted to the situation that shielding exists in a dense scene, and the accuracy of target detection is improved.
In order to accurately update the confidence of the candidate target region, in an embodiment of the present disclosure, a first region with the highest confidence may be selected from the region set in a loop, and the confidence of other regions may be updated according to the intersection ratio between other regions in the region set and the first region and the occlusion degree of the other regions, so that a confidence updating operation is completed, and the above operations are performed in a loop until one region is included in the region set. Each confidence update operation may be referred to as a loop.
The above-mentioned region set includes: the unselected ones of the candidate target regions. Specifically, at the beginning of the first cycle, the region set includes each candidate target region obtained in step S101; after selecting a first region from the set of regions in each cycle, the set of regions no longer includes the selected first region.
At the beginning of the first cycle, the first region is: the region with the highest confidence level in each candidate target region obtained in the step S101; at each subsequent cycle, the first region is: the region with the highest confidence level in each updated region obtained after the last cycle
The other regions mentioned above mean: the regions are concentrated in regions other than the first region. Such as a set of regions comprising: the area 1 is a first area, and the areas other than the first area are area 2 and area 3, and then area 2 and area 3 are the other areas.
In each circulation, each region in the region set can be traversed, the confidence degrees of the regions are ranked from high to low, and the region with the highest confidence degree is determined as the first region. In addition, the first region may be stored in the prediction set, and the number of first regions stored in the prediction set may increase as the number of cycles increases.
The above-described cyclic process is described below with reference to specific examples.
Assume that the respective candidate target regions obtained in step S101 are b1, b2, b3, … … bn.
At the beginning of the first cycle, the region set B ═ B1, B2, B3, … …, bn }. Since the region with the highest confidence level among the candidate target regions is the region b1, the region b1 is defined as the first region. Since the regions other than the region B1 in the region set B are B2, B3, … …, and bn, { B2, B3, … …, and bn } are other regions.
And updating the confidence degrees of the other regions { b2, b3, … … and bn } according to the intersection and combination ratio between the other regions { b2, b3, … … and bn } and the occlusion degree of the other regions { b2, b3, … … and bn }. And the first region may be added to the prediction set D, the added prediction set D being { b1 };
at the beginning of the second loop, since region B1 has already been selected as the first region, region set B does not include region B1, and region set B is { B2, B3, … …, bn }. Among these updated { b2, b3, … …, bn }, the region with the highest confidence level is the region b2, and therefore the region b2 is defined as the first region. Since the regions other than the region B2 in the region set B are B3, … …, and bn, { B3, … …, and bn } are the other regions.
And updating the confidence of the other regions { b3, … …, bn } according to the intersection ratio between the other regions { b3, … …, bn } and the region b2 and the occlusion degree of the other regions { b3, … …, bn }. And the first region may be added to the prediction set D, the added prediction set D being { b1, b2 }.
At the beginning of the third cycle, since the regions B1 and B2 have already been selected as the first regions, the region set B is { B3, … …, bn }. Since the region with the highest reliability among { b3, … …, bn } after update is the region b3, the region b3 is defined as the first region. Since the regions other than the region B3 in the region set B are B4, … …, and bn, { B4, … …, and bn } are the other regions.
And updating the confidence of the other regions { b4, … …, bn } according to the intersection ratio between the other regions { b4, … …, bn } and the region b3 and the occlusion degree of the other regions { b4, … …, bn }. And the first region may be added to the prediction set D, the added prediction set D ═ { b1, b2, b3 }.
In a similar manner, until the number of the regions in the region set B is 1, directly adding a unique region in the region set B to the prediction set D, and ending the loop to obtain the updated confidence of each region.
In this way, the confidence of the regions in the region set is updated according to the intersection ratio between the other regions in the region set and the first region and the occlusion degree of the other regions in each loop. The occlusion degree of other regions reflects the occlusion degree of other regions, the confidence degree of the detected region is low when the region is occluded, and the confidence degree of the updated candidate target region can be high by introducing the occlusion degree of other regions; and the intersection ratio between the other region and the first region reflects the coincidence ratio between the other region and the first region, and the first region is the region with the highest confidence coefficient. Therefore, the confidence of other areas can be effectively updated according to the intersection ratio and the occlusion degree in each circulation. And, through the iterative update process of circulation, can further improve the degree of accuracy of confidence after the update.
In one embodiment of the present disclosure, the confidence of other regions may be updated as per steps a 1-a 4 below.
Step A1: and calculating the intersection ratio between other areas in the area set and the first area.
Specifically, the overlapping area between the other region and the first region is calculated first, and the total area of the other region and the first region is calculated; and then calculating the difference between the total area and the overlapping area to obtain a target area, and finally determining the ratio of the overlapping area to the target area as the intersection ratio between the candidate target areas.
Step A2: and determining a first confidence coefficient adjusting value according to the intersection ratio and a preset intersection ratio threshold value.
The preset intersection ratio threshold may be set by a worker according to experience, for example: the cross-over ratio threshold may be 90%, 95%, etc.
Specifically, in an embodiment, it may be determined whether the cross-over ratio is smaller than a preset cross-over ratio threshold, if so, the first confidence coefficient adjustment value is determined to be a first preset value, and if not, the first confidence coefficient adjustment value is determined to be a second preset value.
The first preset value and the second preset value are set by the worker according to experience.
In an embodiment of the present disclosure, it may also be determined whether the cross-over ratio is less than a preset cross-over ratio threshold; if so, determining that the first confidence coefficient adjustment value is 1; if not, determining that the first confidence coefficient adjustment value is: 1 and cross-over ratio.
For example: assuming that the preset intersection ratio threshold is 90%, when the intersection ratio between the other areas and the first area is 95%, the intersection ratio 95% is greater than the preset intersection ratio threshold 90%, and determining a first confidence coefficient adjustment value: 1-95% ═ 5%; when the intersection ratio between the other areas and the first area is 50%, the intersection ratio 50% is smaller than a preset intersection ratio threshold value 90%, and a first confidence degree adjustment value is determined: 1.
in this way, when the intersection ratio is smaller than the preset intersection ratio threshold, it indicates that the overlap ratio between the other region and the first region is small, which indicates that the small image content in the other region is blocked, and the confidence level of the detected other region is high in accuracy. The first confidence adjustment value is set to 1, so that the confidence of the region can not be adjusted. When the intersection ratio is not less than the preset intersection ratio threshold, it indicates that the coincidence degree between the other region and the first region is relatively large, which indicates that most of the image content in the other region is occluded, and the accuracy of the confidence level of the detected other region is low. Setting the first confidence adjustment value as the difference of the 1-cross-over ratio can make the adjusted confidence approach to the actual situation.
Step A3: and determining a second confidence coefficient adjusting value according to the shielded degrees of other areas.
In one embodiment, the product of the occlusion degree of the other region and the preset adjustment coefficient may be calculated as the second confidence adjustment value.
The preset adjustment coefficient can be set by the operator according to experience, for example: the preset adjustment factor may be 1.2, 1.5, etc.
In one embodiment of the present disclosure, the second confidence adjustment value g (occ _ pred) may also be determined according to the following expression:
g(occ_pred)=αocc_pred
wherein occ _ pred is the occlusion degree of other regions, α is a preset constant, α > 1.
Because α >1, the second confidence adjustment value g (occ _ pred) increases as the degree of occlusion of other regions increases.
Since the confidence of the region is low when the occlusion degree of the region is high, the confidence of the region needs to be adjusted greatly, so that the adjusted confidence approaches to the actual situation. Since the second confidence adjustment value g (occ _ pred) increases with the degree of occlusion of the other region, that is, the higher the degree of occlusion of the other region, the larger the second confidence adjustment value, the greater the confidence of the other region can be adjusted, so that the adjusted confidence of the other region approaches to the actual situation.
Step A4: and adjusting the confidence of other regions by adopting the first confidence adjustment value and the second confidence adjustment value.
In one embodiment of the present disclosure, the confidence of the other regions may be adjusted according to the following expression:
S’=S*T1*T2
where S' represents the confidence of the other region after the adjustment, S represents the confidence of the other region before the adjustment, T1 represents the first confidence adjustment value, and T2 represents the second confidence adjustment value.
In this way, since the adjusted confidence is the product of the first confidence adjustment value, the second confidence adjustment value and the confidence of the other region, and since the first confidence adjustment value and the second confidence adjustment value reflect the blocked condition of the other region from different angles, the adjusted confidence refers to the blocked condition of the other region, so that the adjusted confidence approaches to the actual condition more.
In another embodiment, a product of the first confidence level adjustment value, the second confidence level adjustment value and the confidence levels of the other regions may be calculated as a reference confidence level, and the reference confidence level is adjusted by a preset confidence level error value to obtain an adjusted reference confidence level as the adjusted confidence level of the other regions.
In this way, the first confidence coefficient adjustment value is determined by the intersection ratio between the other region and the first region, the intersection ratio reflects the overlap ratio between the other region and the first region, the second confidence coefficient adjustment value is determined according to the occluded degree of the other region, the occluded degree reflects the occluded degree of the other region, and the first confidence coefficient adjustment value and the second confidence coefficient adjustment value can reflect the occluded condition of the other region from different angles. Therefore, when the confidence degrees of other regions are adjusted by adopting the first confidence degree adjustment value and the second confidence degree adjustment value, the occlusion conditions of the other regions are reflected by the first confidence degree adjustment value and the second confidence degree adjustment value from different angles, and when the first confidence degree adjustment value and the second confidence degree adjustment value are adjusted, the confidence degree is adjusted based on the accurate occlusion conditions of the other regions, so that the adjusted confidence degree is closer to the actual condition.
The above-mentioned way of updating confidence level of loop update is described in a specific implementation procedure.
Assuming that the candidate target regions are b1, b2, and b3, the preset intersection ratio threshold Nt is 90%, and the confidence level and the occlusion degree of each candidate target region are shown in table 1 below.
TABLE 1
Candidate target region
|
Confidence level
|
Degree of being shielded
|
Region b1
|
Cv1
|
Co1
|
Region b2
|
Cv2
|
Co2
|
Region b3
|
Cv3
|
Co3 |
At the beginning of the first loop, the region set B ═ B1, B2, B3, where the confidence Cv1 of region B1 is highest, region B1 is the first region, and regions B2 and B3 are the other regions.
For region b2, a cross-over ratio between region b2 and region b1 is calculated, and a first confidence adjustment value is determined based on the cross-over ratio and 90%. And determining a second confidence adjustment value according to the occlusion degree Co2 of the region b 2. And adjusting the confidence Cv2 of the region b2 according to the first confidence adjustment value and the second confidence adjustment value, wherein the updated confidence is Cv 21.
For region b3, a cross-over ratio between region b3 and region b1 is calculated, and a first confidence adjustment value is determined based on the cross-over ratio and 90%. And determining a second confidence adjustment value according to the occlusion degree Co3 of the region b 3. And adjusting the confidence Cv3 of the region b3 according to the first confidence adjustment value and the second confidence adjustment value, wherein the updated confidence is Cv 31.
The confidence of each updated candidate target region obtained in the first loop is shown in table 2 below.
TABLE 2
At the beginning of the second loop, since the region B1 has already been selected, the region set B is { B2, B3}, where the confidence Cv21 of the region B2 is highest, the region B2 is the first region, and the region B3 is the other region.
For region b3, a cross-over ratio between region b3 and region b2 is calculated, and a first confidence adjustment value is determined based on the cross-over ratio and 90%. And determining a second confidence adjustment value according to the occlusion degree Co3 of the region b 3. And adjusting the confidence Cv31 of the region b3 according to the first confidence adjustment value and the second confidence adjustment value, wherein the updated confidence is Cv 311.
Since the region B1 and the region B3 have already been selected, the region set B ═ B3, which includes one region, and the loop ends.
The confidence of each of the updated candidate target regions obtained finally is shown in table 3 below.
TABLE 3
Candidate target region
|
Confidence level
|
Region b1
|
Cv1
|
Region b2
|
Cv21
|
Region b3
|
Cv311 |
In an embodiment of the present disclosure, in step S101, target detection may be performed on an image according to different target scales, so as to obtain candidate target regions of different scales in the image, confidence degrees of the candidate target regions, and degrees of occlusion of the candidate target regions.
The target dimensions refer to: the size of the target.
The target scale may be a predetermined scale value, for example, the target scale may be 16x16, 32x32, 64x 64.
Specifically, multi-layer feature extraction can be performed on the image, and then feature fusion is performed on different features to obtain features of different scales. And performing target detection on the image by adopting the features of different scales to obtain candidate target areas of different scales, and obtaining confidence degrees and shielding degrees of the candidate target areas of different scales.
Therefore, due to the fact that the candidate target regions with different scales contain different image feature information, the feature information of the candidate target regions on different scales is enriched by obtaining the candidate target regions with different scales in the image.
In an embodiment of the present disclosure, an image may be input into a target detection model obtained by pre-training, and a candidate target region, a confidence of the candidate target region, and an occlusion degree of the candidate target region in the image output by the target detection model may be obtained.
The target detection model includes: the device comprises a target detection layer for detecting a candidate target area in an image and an occlusion degree prediction layer for predicting the occlusion degree of the candidate target area.
In one implementation, the target detection layer may calculate confidence of the candidate target region in addition to detecting the candidate target region in the image, in which case, a network structure of a target detection model may be as shown in fig. 3a, and the target detection model includes a target detection layer and an occlusion degree prediction layer.
Specifically, after the image is input into the target detection model, a target detection layer in the model detects a candidate target region in the image, calculates the confidence of the candidate target region, and transmits the detection result to an occlusion degree prediction layer; the occlusion degree prediction layer predicts the occlusion degree of each candidate target area, and the target detection model outputs the candidate target area, the confidence degree of the candidate target area and the occlusion degree.
It is known from the foregoing embodiments that, when performing target detection on an image, candidate target regions with different scales, confidence degrees of the candidate target regions, and occlusion degrees of the candidate target regions can be obtained for each target scale. In this case, FPN (Feature Pyramid Networks) may be added on the basis of the above network model, and the FPN is used to obtain candidate target regions of various scales, confidence degrees of the candidate target regions, and degrees of occlusion.
The network structure of the network model after adding the FPN may be as shown in fig. 3b, and the network structure shown in fig. 3b includes a Backbone network (Backbone) and the FPN.
The backbone network is used for extracting the features of the image, obtaining the image features of different levels in the image, and inputting the image features of different levels into the FPN.
For example: when the backbone network is a convolutional neural network, each convolutional layer of the convolutional neural network can perform convolution operation on the image, so that image features of different levels are obtained.
The FPN is used for carrying out feature fusion on the image features of different levels to obtain the image features of different scales, carrying out target detection based on the image features of different scales to obtain candidate target areas of different scales, and obtaining confidence degrees and shielding degrees of the candidate target areas, so that the image features of different levels are subjected to divide-and-conquer processing.
When the target detection model is trained, the sample image is used as a training sample, a real candidate target area and a real shielded degree in the sample image are used as training labels, a preset neural network model is trained until a training end condition is met, and the trained target detection model is obtained.
The preset Neural Network model may be a CNN (Conv Neural Network) model, an RNN (Recurrent Neural Network) model, a DNN (Deep Neural Network) model, or the like.
Specifically, after a sample image is input into a preset neural network model, the preset neural network model performs target detection on the sample image to obtain a candidate target area and a sheltered degree of the sample image, calculates a difference between the candidate target area and a real target area and a difference between the sheltered degree and the real sheltered degree of the candidate target area, adjusts parameters of the neural network model according to the calculated difference, and continuously iteratively adjusts the parameters until a preset training end condition is met.
The training end condition may be that the training times reach a preset number, the model parameters satisfy a preset model parameter convergence condition, and the like.
The target detection model is obtained through training of a large number of training samples, and the target detection model learns the characteristics of the target area and the shielded characteristics in the sample image in the training process, so that the target detection model has high robustness, and accurate candidate target areas, confidence degrees of the candidate target areas and shielded degrees can be output when the target detection model is adopted to carry out target detection on the image.
In step S101, in addition to performing object detection on an image by using an object detection model, the image may be divided into a plurality of regions, for each region, the image features in the region are extracted, and candidate object regions in the region are determined according to the image features.
The image features include: texture features, color features, edge features, and the like.
And after each candidate target region is obtained, predicting the confidence coefficient of each candidate target according to the image characteristics of each candidate target region.
And the occlusion degree of each candidate target area can be calculated according to the layer to which each candidate target area belongs and the position information.
Specifically, whether shielding occurs between candidate target regions may be determined according to the relative relationship between the position and the layer to which the candidate target regions belong, and a ratio between the shielded area and the shielded area is calculated as the shielding degree of the candidate target regions.
For example: when the candidate target area a is located in the foreground layer, the candidate target area B is located in the background layer, and the position information of the candidate target area a and the candidate target area B coincide with each other, it may be determined that the candidate target area B is occluded, and a ratio of an occluded area of the candidate target area B to an area of the candidate target area B is calculated as an occluded degree of the candidate target area B.
Corresponding to the target detection method in the vehicle-road cooperation, the embodiment of the disclosure also provides a target detection device in the vehicle-road cooperation.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a target detection device in vehicle-road cooperation according to an embodiment of the present disclosure, where the device includes the following modules 401 and 403.
The information obtaining module 401 is configured to perform target detection on an image, so as to obtain a candidate target region in the image, a confidence of the candidate target region, and a degree of occlusion of the candidate target region;
a confidence updating module 402, configured to update the confidence of the candidate target region based on the intersection ratio between the candidate target regions and the occlusion degree of the candidate target region;
and an object detection module 403, configured to detect an object in the image from the candidate object region according to the updated confidence.
As can be seen from the above, when the scheme provided by the embodiment of the present disclosure is applied to target detection, the confidence of the candidate target region is updated according to the intersection ratio between the candidate target regions and the occlusion degree of the candidate target region, and then the target in the image is detected from the candidate target region based on the updated confidence. The coincidence ratio between the candidate target regions can reflect the coincidence degree between the candidate target regions, and the shielding degree of the candidate target regions can reflect the shielding degree of the candidate target regions, so that the confidence coefficient is updated according to the coincidence ratio and the shielding degree, the confidence coefficient of the target regions can refer to the overlapping condition between the target regions, and the updated confidence coefficient of the candidate target regions is more similar to the actual condition, thereby performing target detection on the image according to the updated confidence coefficient, and improving the accuracy of the target detection.
In an embodiment of the present disclosure, the confidence updating module 402 is specifically configured to select a first region with the highest confidence from a region set in a loop, and update the confidences of other regions according to an intersection ratio between the other regions in the region set and the first region and the occlusion degrees of the other regions until the region set includes one region, where the region set includes: the unselected ones of the candidate target regions.
In this way, the confidence of the regions in the region set is updated according to the intersection ratio between the other regions in the region set and the first region and the occlusion degree of the other regions in each loop. The occlusion degree of other regions reflects the occlusion degree of other regions, the confidence degree of the detected region is low when the region is occluded, and the confidence degree of the updated candidate target region can be high by introducing the occlusion degree of other regions; and the intersection ratio between the other region and the first region reflects the coincidence ratio between the other region and the first region, and the first region is the region with the highest confidence coefficient. Therefore, the confidence of other areas can be effectively updated according to the intersection ratio and the occlusion degree in each circulation. And, through the iterative update process of circulation, can further improve the degree of accuracy of confidence after the update.
In an embodiment of the present disclosure, the confidence updating module 402 includes:
the intersection ratio calculation unit is used for calculating the intersection ratio between other areas in the area set and the first area;
the first adjusting value determining unit is used for determining a first confidence coefficient adjusting value according to the intersection ratio and a preset intersection ratio threshold;
the second adjusting value determining unit is used for determining a second confidence coefficient adjusting value according to the shielded degree of other areas;
and the confidence coefficient adjusting unit is used for adjusting the confidence coefficient of other regions by adopting the first confidence coefficient adjusting value and the second confidence coefficient adjusting value.
In this way, the first confidence coefficient adjustment value is determined by the intersection ratio between the other region and the first region, the intersection ratio reflects the overlap ratio between the other region and the first region, the second confidence coefficient adjustment value is determined according to the occluded degree of the other region, the occluded degree reflects the occluded degree of the other region, and the first confidence coefficient adjustment value and the second confidence coefficient adjustment value can reflect the occluded condition of the other region from different angles. Therefore, when the confidence degrees of other regions are adjusted by adopting the first confidence degree adjustment value and the second confidence degree adjustment value, the occlusion conditions of the other regions are reflected by the first confidence degree adjustment value and the second confidence degree adjustment value from different angles, and when the first confidence degree adjustment value and the second confidence degree adjustment value are adjusted, the confidence degree is adjusted based on the accurate occlusion conditions of the other regions, so that the adjusted confidence degree is closer to the actual condition.
In an embodiment of the present disclosure, the first adjustment value determining unit is specifically configured to determine whether the intersection ratio is smaller than a preset intersection ratio threshold; if so, determining that the first confidence coefficient adjustment value is 1; if not, determining that the first confidence coefficient adjustment value is: 1 and the cross-over ratio.
In this way, when the intersection ratio is smaller than the preset intersection ratio threshold, it indicates that the overlap ratio between the other region and the first region is small, which indicates that the small image content in the other region is blocked, and the confidence level of the detected other region is high in accuracy. The first confidence adjustment value is set to 1, so that the confidence of the region can not be adjusted. When the intersection ratio is not less than the preset intersection ratio threshold, it indicates that the coincidence degree between the other region and the first region is relatively large, which indicates that most of the image content in the other region is occluded, and the accuracy of the confidence level of the detected other region is low. Setting the first confidence adjustment value as the difference of the 1-cross-over ratio can make the adjusted confidence approach to the actual situation.
In an embodiment of the present disclosure, the second adjustment value determining unit is specifically configured to determine the second confidence adjustment value g (occ _ pred) according to the following expression:
g(occ_pred)=αocc_pred
wherein occ _ pred is the occlusion degree of other regions, α is a preset constant, α > 1.
Since the confidence of the region is low when the occlusion degree of the region is high, the confidence of the region needs to be adjusted greatly, so that the adjusted confidence approaches to the actual situation. Since the second confidence adjustment value g (occ _ pred) increases with the degree of occlusion of the other region, that is, the higher the degree of occlusion of the other region, the larger the second confidence adjustment value, the greater the confidence of the other region can be adjusted, so that the adjusted confidence of the other region approaches to the actual situation.
In an embodiment of the present disclosure, the confidence level adjusting unit is specifically configured to adjust the confidence levels of the other regions according to the following expression:
S’=S*T1*T2
wherein S' represents the confidence of the other region after the adjustment, S represents the confidence of the other region before the adjustment, T1 represents the first confidence adjustment value, and T2 represents the second confidence adjustment value.
In this way, since the adjusted confidence is the product of the first confidence adjustment value, the second confidence adjustment value and the confidence of the other region, and since the first confidence adjustment value and the second confidence adjustment value reflect the blocked condition of the other region from different angles, the adjusted confidence refers to the blocked condition of the other region, so that the adjusted confidence approaches to the actual condition more.
In an embodiment of the present disclosure, the target detection module 403 is specifically configured to select a candidate target region whose updated confidence is greater than a preset confidence threshold, and determine a target in the selected candidate target region as a target in the image; or selecting a preset number of candidate target regions with the maximum updated confidence coefficient, and determining the target in the selected candidate target regions as the target in the image.
Thus, for candidate target regions with confidence levels greater than the preset confidence level threshold, the likelihood of including a target in these candidate target regions is higher than the likelihood of including a target in other candidate target regions. Therefore, the target in the candidate target region with the confidence coefficient larger than the preset confidence coefficient threshold value is determined as the target in the image, and the obtained target has higher accuracy; for a preset number of candidate target regions with the highest confidence, the probability of including the target in these candidate target regions is higher than the probability of including the target in other candidate regions. Therefore, the target in the preset number of candidate target regions with the maximum confidence coefficient is determined as the target in the image, and the accuracy of the obtained target is high.
In an embodiment of the present disclosure, the information obtaining module 401 is specifically configured to perform target detection on an image according to different target scales, so as to obtain candidate target regions of different scales in the image, confidence degrees of the candidate target regions, and occlusion degrees of the candidate target regions.
Therefore, due to the fact that the candidate target regions with different scales contain different image feature information, the feature information of the candidate target regions on different scales is enriched by obtaining the candidate target regions with different scales in the image.
In an embodiment of the present disclosure, the information obtaining module 401 is specifically configured to input an image into a pre-trained target detection model, and obtain a candidate target region, a confidence of the candidate target region, and an occlusion degree of the candidate target region in the image output by the target detection model, where the target detection model includes: the device comprises a target detection layer for detecting a candidate target area in an image and an occlusion degree prediction layer for predicting the occlusion degree of the candidate target area.
Therefore, the target detection model is obtained by training a large number of training samples, and the target detection model learns the characteristics of the target area and the shielded characteristics in the sample image in the training process, so that the target detection model has high robustness, and accurate candidate target areas, confidence degrees of the candidate target areas and shielded degrees can be output when the target detection model is adopted to detect the target of the image.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
In one embodiment of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any of the above method embodiments of vehicle-to-vehicle cooperative in-vehicle object detection methods.
In one embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, which stores computer instructions for causing a computer to execute any one of the above method embodiments for detecting a target in vehicle-road coordination.
In an embodiment of the present disclosure, a computer program product is provided, which includes a computer program that, when being executed by a processor, implements the method for object detection in vehicle-road coordination in any one of the foregoing method embodiments.
In one embodiment of the present disclosure, a roadside apparatus is provided, which includes the above-described electronic apparatus.
In an embodiment of the present disclosure, a cloud control platform is provided, which includes the above electronic device.
FIG. 5 illustrates a schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the apparatus 500 comprises a computing unit 501 which may perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The calculation unit 501, the ROM 502, and the RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in the device 500 are connected to the I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, or the like; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508, such as a magnetic disk, optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 501 executes the respective methods and processes described above, such as the target detection method in the vehicle-road cooperation. For example, in some embodiments, the method of object detection in vehicle road coordination may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM 502 and/or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the object detection method in vehicle-road coordination described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the target detection method in vehicle-road coordination by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Optionally, the roadside device may include a communication component and the like in addition to the electronic device, and the electronic device may be integrated with the communication component or may be separately disposed. The electronic device may acquire data, such as pictures and videos, from a sensing device (e.g., a roadside camera) for image video processing and data computation. Optionally, the electronic device itself may also have a sensing data acquisition function and a communication function, for example, an AI camera, and the electronic device may directly perform image video processing and data calculation based on the acquired sensing data.
Optionally, the cloud control platform performs processing at the cloud end, and the electronic device included in the cloud control platform may acquire data of the sensing device (such as a roadside camera), such as pictures and videos, so as to perform image video processing and data calculation; the cloud control platform can also be called a vehicle-road cooperative management platform, an edge computing platform, a cloud computing platform, a central system, a cloud server and the like.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.