WO2022217434A1 - Cognitive network, method for training cognitive network, and object recognition method and apparatus - Google Patents
Cognitive network, method for training cognitive network, and object recognition method and apparatus Download PDFInfo
- Publication number
- WO2022217434A1 WO2022217434A1 PCT/CN2021/086643 CN2021086643W WO2022217434A1 WO 2022217434 A1 WO2022217434 A1 WO 2022217434A1 CN 2021086643 W CN2021086643 W CN 2021086643W WO 2022217434 A1 WO2022217434 A1 WO 2022217434A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- frame
- network
- regression
- candidate
- classification
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 233
- 238000012549 training Methods 0.000 title claims abstract description 192
- 230000001149 cognitive effect Effects 0.000 title abstract description 12
- 238000000605 extraction Methods 0.000 claims abstract description 60
- 230000006870 function Effects 0.000 claims description 113
- 230000008447 perception Effects 0.000 claims description 106
- 230000008569 process Effects 0.000 claims description 103
- 230000015654 memory Effects 0.000 claims description 82
- 238000012545 processing Methods 0.000 claims description 80
- 238000013527 convolutional neural network Methods 0.000 claims description 38
- 238000002372 labelling Methods 0.000 claims description 35
- 238000004590 computer program Methods 0.000 claims description 12
- 230000005540 biological transmission Effects 0.000 claims description 9
- 238000004364 calculation method Methods 0.000 abstract description 21
- 230000036992 cognitive tasks Effects 0.000 abstract 1
- 238000001514 detection method Methods 0.000 description 93
- 238000013528 artificial neural network Methods 0.000 description 45
- 239000011159 matrix material Substances 0.000 description 38
- 238000011176 pooling Methods 0.000 description 35
- 238000010586 diagram Methods 0.000 description 28
- 238000004891 communication Methods 0.000 description 20
- 239000013598 vector Substances 0.000 description 20
- 230000036961 partial effect Effects 0.000 description 14
- 230000001537 neural effect Effects 0.000 description 12
- 230000001953 sensory effect Effects 0.000 description 12
- 239000000284 extract Substances 0.000 description 9
- 230000004927 fusion Effects 0.000 description 9
- 210000002569 neuron Anatomy 0.000 description 9
- 238000013480 data collection Methods 0.000 description 8
- 238000013500 data storage Methods 0.000 description 8
- 238000012544 monitoring process Methods 0.000 description 7
- 230000001360 synchronised effect Effects 0.000 description 7
- 230000016776 visual perception Effects 0.000 description 7
- 230000004913 activation Effects 0.000 description 6
- 238000004422 calculation algorithm Methods 0.000 description 6
- 230000004438 eyesight Effects 0.000 description 5
- 230000003068 static effect Effects 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 4
- 238000013135 deep learning Methods 0.000 description 4
- 238000007726 management method Methods 0.000 description 4
- 238000013473 artificial intelligence Methods 0.000 description 3
- 239000000872 buffer Substances 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000010801 machine learning Methods 0.000 description 3
- 238000003062 neural network model Methods 0.000 description 3
- 238000010606 normalization Methods 0.000 description 3
- 239000013589 supplement Substances 0.000 description 3
- MHABMANUFPZXEB-UHFFFAOYSA-N O-demethyl-aloesaponarin I Natural products O=C1C2=CC=CC(O)=C2C(=O)C2=C1C=C(O)C(C(O)=O)=C2C MHABMANUFPZXEB-UHFFFAOYSA-N 0.000 description 2
- 210000004556 brain Anatomy 0.000 description 2
- 230000003247 decreasing effect Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 230000005764 inhibitory process Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000000670 limiting effect Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000037361 pathway Effects 0.000 description 2
- 230000002829 reductive effect Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000001629 suppression Effects 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 208000012260 Accidental injury Diseases 0.000 description 1
- 241000283070 Equus zebra Species 0.000 description 1
- 241001465754 Metazoa Species 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 208000014674 injury Diseases 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 210000000056 organ Anatomy 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 239000000047 product Substances 0.000 description 1
- 230000001373 regressive effect Effects 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
Definitions
- the present application relates to the field of computer vision, and more particularly, to a perceptual network, a training method for a perceptual network, and an object recognition method and apparatus.
- Computer vision is an integral part of various intelligent/autonomous systems in various application fields such as manufacturing, inspection, document analysis, and medical diagnostics. To put it figuratively, computer vision is to install eyes (cameras/cameras) and brains (algorithms) on computers, so that computers can perceive the environment. Computer vision uses various imaging systems to replace the visual organ to obtain input information, and then the computer replaces the brain to process and interpret the input information.
- perception networks deployed in advanced driving assistance systems (ADAS) and autonomous driving systems (ADS) can be used to identify obstacles on the road.
- Most of the current perception networks can only complete one detection task.
- To achieve multiple detection tasks it is usually necessary to deploy different networks to achieve different detection tasks.
- the simultaneous operation of multiple perception networks will increase the power consumption of the hardware and reduce the running speed of the model.
- the computing power of chips used in many fields is low, making it difficult to deploy large-scale sensor networks, and even more difficult to deploy multiple sensor networks.
- the present application provides a perceptual network, a training method for a perceptual network, an object recognition method and a device, which can reduce the amount of parameters and calculations in a multi-task perceptual network, reduce the power consumption of hardware, and improve the running speed of the model.
- a perception network including: a backbone network, a region proposal network (RPN), a region of interest extraction module, and a classification and regression network; the RPN is used to output a target object based on the second feature map
- the position information of the candidate two-dimensional (2 dementional, 2D) frame, the target object includes objects to be detected in multiple tasks, each task in the multiple tasks includes at least one category, and the second feature map is based on the first feature.
- the region of interest extraction module is used to extract the first feature information on the third feature map based on the position information of the candidate 2D frame, the first feature information is the feature of the region where the candidate 2D frame is located, and the third feature map is based on The first feature map is determined; the classification and regression network is used to process the first feature information, output the target 2D frame of the target object and the first indication information, the number of target 2D frames is less than or equal to the number of candidate 2D frames, the first The indication information is used to indicate the category to which the target object belongs.
- a sensing network is used to complete a variety of sensing tasks, and multiple tasks share one RPN, that is, one RPN predicts the area where the object to be detected in multiple tasks is located, while ensuring the performance of the sensing network.
- RPN predicts the area where the object to be detected in multiple tasks is located
- the "first feature map” refers to the feature map output by the backbone network.
- the feature maps output by the backbone network can all be referred to as first feature maps.
- a broad category includes at least one category.
- a broad category is a collection of at least one category.
- Task division criteria can be set as needed. For example, the objects to be detected are divided into multiple tasks according to the similarity of the objects to be detected.
- RPN may also be referred to as a single-head multi-task RPN.
- the second feature map may be one or multiple.
- the second feature map may include one or more of the first feature map.
- the third feature map may be one of the first feature maps.
- the perception network further includes feature pyramid networks (FPN), and the FPN is connected to the backbone network for feature fusion on the first feature map and output fusion feature map after.
- FPN feature pyramid networks
- the second feature map may include one or more of the fused feature maps.
- the third feature map may be one of the first feature maps or one of the fused feature maps output by the FPN.
- the classification and regression network is specifically used to: process the first feature information to obtain the confidence that the candidate 2D frame belongs to each category in multiple tasks; The position information of the frame is adjusted to obtain an adjusted candidate 2D frame; the target 2D frame is determined according to the adjusted candidate 2D frame; the first indication information is determined according to the confidence that the target 2D frame belongs to each category.
- the position information of the candidate 2D frame is adjusted so that the adjusted candidate 2D frame matches the shape of the actual object more closely than the candidate 2D frame, that is, the adjusted candidate 2D frame is a more compact candidate 2D frame.
- a frame merging operation is performed on the adjusted candidate 2D frame to obtain the target 2D frame.
- the adjusted 2D boxes are merged with non-maximum suppression (NMS) to obtain the target 2D boxes.
- NMS non-maximum suppression
- the classification and regression network includes a first region convolutional neural network (RCNN), and the first RCNN includes a hidden layer, a plurality of sub-classification fully connected layers and Multiple sub-regression fully-connected layers, the hidden layer is connected to multiple sub-classification fully-connected layers, the hidden layer is connected to multiple sub-regression fully-connected layers, multiple sub-classification fully-connected layers correspond to multiple tasks one-to-one, and multiple sub-regression fully connected layers are connected to Multiple tasks are in one-to-one correspondence; the hidden layer is used to process the first feature information to obtain the second feature information; the sub-category fully-connected layer is used to obtain the candidate 2D frame corresponding to the sub-category fully-connected layer according to the second feature information. The confidence of the object category in the task; the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the second feature information, and obtain the adjusted candidate 2D frame.
- RCNN first region convolutional neural network
- the hidden layer may include at least one of the following: a convolutional layer or a fully connected layer. Since multiple tasks share the hidden layer, the convolutional layer in the hidden layer can also be called a shared convolutional layer (shared convolutional, shared conv), and the fully connected layer in the hidden layer can also be called a shared fully connected layer (shared fully connected layer). layers, shared fc).
- the first RCNN includes hidden layers and multiple sub-classification fully connected layers and multiple sub-regression fully connected layers corresponding to multiple tasks.
- Each task can have an independent sub-classification fully-connected layer and sub-regression fully-connected layer.
- the sub-category fully-connected layer and the sub-regression fully-connected layer corresponding to each task can complete the detection of the object to be detected in the task.
- the sub-category fully connected layer can output the confidence level that the candidate 2D frame belongs to the object category in the task
- the sub-regression fully connected layer can output the adjusted candidate 2D box.
- a first RCNN includes multiple sub-classification fully-connected layers and sub-regression fully-connected layers. Therefore, a first RCNN can complete the detection of objects to be detected in multiple tasks.
- the first RCNN can also be called a single-head multi-task RCNN.
- each task corresponds to an independent sub-classification fully connected layer (fc) and sub-regression fc, which improves the scalability of the perception network.
- the perception network can flexibly implement functional configuration by adding or reducing sub-classification fc and sub-regression fc .
- the classification and regression network includes a second RCNN
- the second RCNN includes a hidden layer, a classification fully connected layer and a regression fully connected layer
- the hidden layer is connected with the classification fully connected layer
- the hidden layer is connected to the regression fully connected layer
- the hidden layer is used to process the first feature information to obtain the third feature information
- the classification fully connected layer is used to obtain the confidence that the candidate 2D frame belongs to each category according to the third feature information
- the regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the third feature information to obtain the adjusted candidate 2D frame.
- a second RCNN can complete the detection of objects to be detected in multiple tasks.
- the second RCNN can also be called a single-head multi-task RCNN.
- the second RCNN is used as the classification and regression network, and multiple tasks share the hidden layer of the second RCNN, which further reduces the amount of parameters and calculation of the perception network, and improves the processing efficiency.
- the output of the hidden layer in the first RCNN needs to be input to all sub-classification fully connected layers and sub-regression fully connected layers for multiple matrix operations, while the output of the hidden layer in the second RCNN only needs to be input to the classification fully connected layer.
- the matrix operation is performed in the layer and the regression fully connected layer. In this way, the operation of the matrix operation can be further reduced, which is more friendly to the hardware, further reduces the time consumption of the operation, and improves the processing efficiency.
- the classification fully connected layer is obtained by merging multiple sub-classification fully connected layers in the first RCNN, and the regression fully connected layer is obtained by merging the first RCNN into the fully connected layer.
- the first RCNN includes a hidden layer, multiple sub-category fully-connected layers and multiple sub-regression fully-connected layers, the hidden layer is connected with multiple sub-category fully-connected layers, and the hidden layer is connected with multiple sub-regression layers.
- the fully-connected layers are connected, the sub-classification fully-connected layers are in one-to-one correspondence with multiple tasks, and the sub-regression fully-connected layers are in one-to-one correspondence with multiple tasks; the sub-classification fully connected layer is used to obtain the candidate 2D frame belonging to the The confidence of the object category in the task corresponding to the sub-classification fully connected layer; the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the third feature information to obtain the adjusted candidate 2D frame.
- multiple sub-classification fc and sub-regression fc in the first RCNN are combined, and the second RCNN is used as the classification and regression network, which can further reduce the operation of matrix operations, is more friendly to hardware, and further reduces the The operation is time-consuming and the processing efficiency is improved.
- a training method for a perceptual network includes: a candidate region generation network RPN, where the RPN is used to predict the position information of a candidate two-dimensional 2D frame of a target object in a sample image, and the target object includes multiple tasks the object to be detected, each task in the multiple tasks includes at least one category; the target object includes a first task object and a second task object; the method includes: acquiring training data, the training data includes sample images, first task objects on the sample images Annotation data of a task object and a pseudo frame of the second task object on the sample image.
- the annotation data includes the class label of the first task object and the annotated 2D frame of the first task object.
- the pseudo frame of the second task object is obtained by other perception
- the target 2D frame of the second task object obtained by the network inferring the sample image; the perception network is trained based on the training data.
- the labeled data is partially labeled data, that is, when the labeled data only includes the labeled data of the first task object, when training the perception network based on the labeled data only, since multiple tasks share one RPN, when training the RPN, different The training data for tasks may inhibit each other. Specifically, since the labeled data is part of the labeled data, for example, only the labeled data of the object to be detected for one task is labeled on a sample image, when the labeled data of the object to be detected for the task is used for training, the RPN will be adjusted.
- RPN can more accurately predict the candidate 2D frame of the object to be detected for this task, but cannot accurately predict the candidate 2D frame of the object to be detected for other tasks on the sample image.
- the parameters of the RPN will be adjusted, so the adjusted RPN may not be able to accurately predict the candidate 2D frame of the object to be detected in other tasks. In this way, the training data of different tasks may suppress each other, causing RPN to fail to predict all the target objects in the image.
- the perception network is jointly trained based on the pseudo frame and the labeled data, and in the case that the labeled data only includes the labeled data of the first task object, that is, in the case of partial labeled data, the information of the second task object is provided.
- Pseudo frame in order to provide a more comprehensive frame of the object to be detected on the same sample image as the target output of the RPN, to adjust the parameters of the RPN so that the output of the RPN is constantly close to the target data, avoiding mutual inhibition between different tasks, which is beneficial to It enables RPN to obtain more comprehensive and accurate candidate 2D boxes, while improving the recall rate.
- the labeling data of the sample images in the embodiments of the present application may be partial labeling data, so that targeted collection can be performed, that is, the required sample images are collected for specific tasks, and there is no need to mark the objects to be detected for all tasks in each sample image. It reduces the cost of data collection and the cost of labeling, which is conducive to balancing the training data of different tasks.
- the scheme using part of the labeled data has flexible scalability. In the case of adding tasks, it is only necessary to provide the labeled data of the new tasks, and there is no need to label new objects to be detected on the basis of the original training data. .
- the first task objects may include objects to be detected in one or more tasks.
- the one or more tasks are the tasks where the first task object is located.
- the first task objects in different sample images in the training set may be the same or different.
- the second task objects may include objects to be detected in one or more tasks.
- the one or more tasks are the tasks where the second task object is located.
- the same object to be detected may exist in the second task object and the first task object. That is to say, the first task object and the second task object may have overlapping objects to be detected, and the first task object and the second task object may also be completely different.
- the second task objects in different sample images in the training set can be the same or different.
- Other perceptual networks refer to other perceptual networks than the one to be trained.
- the other sensing networks may be a multi-head multi-tasking sensing network or multiple single-tasking sensing networks, or the like.
- the perceptual network further includes a backbone network, a region of interest extraction module, and a classification and regression network, and the perceptual network is trained based on the training data, including: according to the first task object The difference between the marked 2D frame and the target 2D frame of the second task object and the candidate 2D frame of the target object in the sample image predicted by RPN calculates the first loss function value; calculates the second loss function value of the perception network according to the marked data ; Backpropagate the value of the first loss function and the value of the second loss function, adjust the parameters of the part that needs to be trained in the perception network, and the part that needs to be trained in the perception network includes the part to be trained in the classification and regression network, the sensor The region of interest extraction module, RPN and backbone network, and the part to be trained in the classification and regression network is determined according to the first task object.
- the labeled 2D frame of the first task object and the target 2D frame of the second task object are compared with the candidate 2D frame of the target object predicted by RPN, and the loss function value of the RPN stage is obtained, that is, the first loss function value.
- the labeled data of the sample image is compared with the output result of the classification and regression network, and the loss function value of the task where the first task object in the classification and regression network stage is located, that is, the second loss function value is obtained.
- the parameters related to the first loss function value are the parameters in the perceptual network used in the process of obtaining the first loss function value, for example, the parameters of the backbone and the parameters of the RPN. Further, in the case where the perceptual network includes FPN, the parameter related to the value of the first loss function also includes FPN.
- the gradient of the parameter related to the second loss function value is calculated, and then the parameter related to the second loss function value is adjusted based on the gradient of the parameter to realize the adjustment of the perceptual network, so that the classification regression
- the network can better correct the output 2D box and improve the accuracy of category prediction.
- the parameters related to the second loss function are the parameters in the perceptual network used in the process of calculating the value of the second loss function, for example, the parameters of the backbone, the parameters of the RPN, the parameters of the region of interest extraction module, and the classification and regression network. parameters for the part of the training required. Further, in the case where the perceptual network includes FPN, the parameter related to the value of the second loss function also includes FPN.
- the parameters related to the second loss function are the parameters of the part of the perception network that needs to be trained.
- the parts shared by different tasks in the perception network all participate in the training process based on the labeled data of different tasks, which can make
- the parts of the perceptual network shared by different tasks learn common features of each task. Different parts corresponding to different tasks in the perception network, for example, the parts corresponding to each task in the classification and regression network, only participate in the training process based on the labeled data of the respective tasks, which can make different parts corresponding to different tasks in the perception network. Its task-specific features can be learned, improving the accuracy of the model.
- the part of the classification and regression network that needs to be trained is determined according to the task, and different parts of the classification and regression network corresponding to different tasks do not affect each other during the training process, ensuring the independence of each task, making The model has strong flexibility.
- the backbone network is used to perform convolution processing on the sample image and output the first feature map of the sample image; the RPN is used to output the target object based on the second feature map
- the position information of the candidate 2D frame of the The feature information is the feature of the area where the candidate 2D frame is located, and the third feature map is determined according to the first feature map;
- the classification and regression network is used to process the first feature information, and output the target 2D frame of the target object and the first indication information , the number of target 2D boxes is less than or equal to the number of candidate 2D boxes, and the first indication information is used to indicate the category to which the target object belongs.
- the classification and regression network includes a first regional convolutional neural network RCNN
- the first RCNN includes a hidden layer, multiple sub-classification fully connected layers and multiple sub-regression fully connected layers
- the hidden layer is connected with multiple sub-classification fully connected layers
- the hidden layer is connected with multiple sub-regression fully connected layers
- multiple sub-classification fully connected layers are in one-to-one correspondence with multiple tasks
- multiple sub-regression fully connected layers are in one-to-one correspondence with multiple tasks
- the hidden layer is used to process the first feature information to obtain the second feature information
- the sub-class fully connected layer is used to obtain the confidence of the object category in the task corresponding to the sub-class fully connected layer of the candidate 2D frame according to the second feature information.
- the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the second feature information to obtain the adjusted candidate 2D frame; and the part to be trained in the classification and regression network includes the hidden layer and the first task.
- the sub-classification fully connected layer and the sub-regression fully connected layer corresponding to the task where the object is located.
- the parts shared by different tasks in the perception network that is, the backbone network, the RPN, the region of interest extraction module, and the hidden layer of the classification and regression network, all participate in the process of training based on the labeled data of different tasks. Training, so that the parts shared by different tasks in the perceptual network can learn the common features of each task.
- the different parts corresponding to different tasks in the perception network that is, the sub-classification fully connected layer and the sub-regression fully connected layer corresponding to each task in the classification and regression network, only participate in the training process based on the labeled data of the respective tasks, which can make the perception
- Different parts of the network corresponding to different tasks can learn their task-specific features, which improves the accuracy of the model.
- an object recognition method includes: a backbone network, a candidate region generation network RPN, a region of interest extraction module, and a classification and regression network.
- the method includes: using the backbone network to perform convolution processing on an input image to obtain The first feature map of the input image; using RPN to output the position information of the candidate two-dimensional 2D frame of the target object based on the second feature map, the target object includes the objects to be detected in multiple tasks, each task in multiple tasks At least one category is included, and the second feature map is determined according to the first feature map; the region of interest extraction module is used to extract the first feature information on the third feature map based on the position information of the candidate 2D frame, and the first feature information is the candidate 2D The feature of the area where the frame is located, and the third feature map is determined according to the first feature map; the first feature information is processed by the classification and regression network to obtain the target 2D frame of the target object and the first indication information, and the number of target 2D frames is less than or equal
- a sensing network is used to complete a variety of sensing tasks, and multiple tasks share one RPN, that is, one RPN predicts the area where the object to be detected in multiple tasks is located, while ensuring the performance of the sensing network.
- RPN predicts the area where the object to be detected in multiple tasks is located
- the classification and regression network is used to process the first feature information to obtain the target 2D frame of the target object and the first indication information, including: using the classification and regression network to process the first feature information.
- the feature information is processed to obtain the confidence that the candidate 2D frame belongs to each category in multiple tasks; the position information of the candidate 2D frame is adjusted by the classification and regression network, and the adjusted candidate 2D frame is obtained; according to the adjusted candidate 2D frame Determine the target 2D frame; determine the first indication information according to the confidence that the target 2D frame belongs to each category.
- the classification and regression network includes a first regional convolutional neural network RCNN, and the first RCNN includes a hidden layer, multiple sub-classification fully connected layers and multiple sub-regression fully connected layers,
- the hidden layer is connected with multiple sub-classification fully connected layers
- the hidden layer is connected with multiple sub-regression fully connected layers
- multiple sub-classification fully connected layers are in one-to-one correspondence with multiple tasks
- multiple sub-regression fully connected layers are in one-to-one correspondence with multiple tasks
- using a classification and regression network to process the first feature information, and output the target 2D frame of the target object and the first indication information, including: using the hidden layer to process the first feature information to obtain the second feature information; using the sub-category full connection According to the second feature information, the layer obtains the confidence of the candidate 2D frame belonging to the object category in the task corresponding to the sub-classification fully connected layer
- the sub-regression fully connected layer is used to adjust the position information of the candidate 2D
- the classification and regression network includes a second RCNN
- the second RCNN includes a hidden layer, a classification fully connected layer and a regression fully connected layer
- the hidden layer is connected with the classification fully connected layer
- the hidden layer is connected with the regression fully connected layer
- the classification and regression network is used to process the first feature information, and output the target 2D frame of the target object and the first indication information, including: using the hidden layer to process the first feature information to obtain the first feature information.
- Three feature information use the classification fully connected layer to obtain the confidence that the candidate 2D frame belongs to each category according to the third feature information; use the regression fully connected layer to adjust the position information of the candidate 2D frame according to the third feature information to obtain the adjusted candidate 2D frame 2D box.
- the classification fully connected layer is obtained by merging multiple sub-classification fully connected layers in the first RCNN, and the regression fully connected layer is obtained by combining the first RCNN.
- the first RCNN includes a hidden layer, multiple sub-category fully-connected layers and multiple sub-regression fully-connected layers, the hidden layer is connected with multiple sub-category fully-connected layers, and the hidden layer is connected with multiple sub-regression layers.
- the fully-connected layers are connected, the sub-classification fully-connected layers are in one-to-one correspondence with multiple tasks, and the sub-regression fully-connected layers are in one-to-one correspondence with multiple tasks; the sub-classification fully connected layer is used to obtain the candidate 2D frame belonging to the The confidence of the object category in the task corresponding to the sub-classification fully connected layer; the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the third feature information to obtain the adjusted candidate 2D frame.
- the target-aware network can be obtained by using the training method of the perception network in the second aspect.
- the target-aware network can be a trained image recognition model, and the trained image recognition model can be used to process the image to be processed.
- an apparatus for training a perceptual network includes a module or unit for performing the method in the second aspect and any one of the implementation manners of the second aspect.
- an object recognition device comprising a module or unit for executing the method in the third aspect and any one of the implementation manners of the third aspect.
- an apparatus for training a cognitive network comprising: a processor and a transmission interface, the processor receives or sends data through the transmission interface, and the processor is configured to call program instructions stored in the memory to execute The second aspect and the method in any one of the implementation manners of the second aspect.
- the processor in the sixth aspect above may be either a central processing unit (CPU), or a combination of a CPU and a neural network computing processor, where the neural network computing processor may include a graphics processor (graphics processing unit). unit, GPU), neural network processor (neural-network processing unit, NPU) and tensor processor (tensor processing unit, TPU) and so on.
- TPU is Google's fully customized artificial intelligence accelerator application-specific integrated circuit for machine learning.
- an object recognition device comprising: a processor and a transmission interface, the processor receives or sends data through the transmission interface, and the processor is configured to call program instructions stored in the memory to execute a third A method in any one implementation manner of the aspect and the third aspect.
- the processor in the above seventh aspect can be either a central processing unit, or a combination of a CPU and a neural network computing processor, where the neural network computing processor can include a graphics processor, a neural network processor, and a tensor processor. and many more.
- TPU is Google's fully customized artificial intelligence accelerator application-specific integrated circuit for machine learning.
- a computer-readable storage medium stores program code for execution by a device, and when the program code is run on a computer or a processor, causes the computer or processor to execute the second aspect or The method in any one of the implementation manners of the third aspect.
- a ninth aspect provides a computer program product comprising instructions, when the computer program product runs on a computer, the computer causes the computer to execute the method in any one of the implementation manners of the second aspect or the third aspect.
- a tenth aspect provides a chip, the chip includes a processor and a data interface, the processor reads an instruction stored in a memory through the data interface, and executes any one of the second aspect or the third aspect above method in the implementation.
- the chip may further include a memory, in which instructions are stored, the processor is configured to execute the instructions stored in the memory, and when the instructions are executed, the The processor is configured to execute the method in any one of the implementations of the first aspect or the second aspect.
- the above chip may specifically be a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC).
- FPGA field-programmable gate array
- ASIC application-specific integrated circuit
- an electronic device in an eleventh aspect, includes the apparatus in any one of the above-mentioned fourth to seventh aspects.
- FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application
- FIG. 2 is a schematic diagram of another application scenario provided by an embodiment of the present application.
- FIG. 3 is a schematic structural diagram of a system architecture provided by an embodiment of the present application.
- FIG. 4 is a schematic structural diagram of a convolutional neural network provided by an embodiment of the present application.
- FIG. 5 is a schematic diagram of the hardware structure of a chip according to an embodiment of the present application.
- FIG. 6 is a schematic diagram of a system architecture provided by an embodiment of the present application.
- FIG. 7 is a schematic block diagram of a multi-head end multi-task perception network
- FIG. 8 is a schematic structural diagram of a perception network according to an embodiment of the present application.
- FIG. 9 is a schematic structural diagram of another sensing network provided by an embodiment of the present application.
- FIG. 10 is a schematic structural diagram of another sensing network provided by an embodiment of the present application.
- FIG. 11 is a schematic structural diagram of another cognitive network provided by an embodiment of the present application.
- FIG. 12 is a schematic flowchart of a training method for a perceptual network provided by an embodiment of the present application.
- FIG. 13 is a schematic diagram of a training process of a perception network provided by an embodiment of the present application.
- FIG. 14 is a schematic block diagram of a perceptual network in a training process provided by an embodiment of the present application.
- 16 is a schematic diagram of an object recognition process provided by an embodiment of the present application.
- 17 is a schematic block diagram of a perceptual network in a reasoning process provided by an embodiment of the present application.
- FIG. 18 is a schematic diagram of a conversion process of a sensory network provided by an embodiment of the present application.
- FIG. 19 is a schematic block diagram of an apparatus provided by an embodiment of the present application.
- FIG. 20 is a schematic block diagram of another apparatus provided by an embodiment of the present application.
- the embodiments of the present application can be applied to fields that need to complete various sensing tasks, such as driving assistance, automatic driving, mobile phone terminals, monitoring, and security.
- the image is input into the perception network of the present application, and the detection result of the object of interest in the image is obtained.
- the detection results can be input to the post-processing module for processing, for example, sent to the planning control unit for decision-making in the autonomous driving system, or sent to the security system for abnormal situation detection.
- ADAS advanced driving assistant system
- ADS autonomous driving system
- the detection targets include dynamic obstacles, static obstacles and traffic signs, such as pedestrians (pedestrians), cyclists (cyclists), tricycles (tricycle), car (car), truck (truck), bus (bus), wheel (wheel), car light (car light), traffic cone (traffic cone), traffic stick (traffic stick), fire hydrant (fire hydrant), motorcycle (motorcycle) and bicycle (bicycle), traffic sign (traffic sign), guide sign (guide sign), billboard (billboard), road sign (roadsign), road pole (pole), traffic light ( traffic light) and road signs, etc.
- traffic signs such as pedestrians (pedestrians), cyclists (cyclists), tricycles (tricycle), car (car), truck (truck), bus (bus), wheel (wheel), car light (car light), traffic cone (traffic cone), traffic stick (traffic stick), fire hydrant (fire hydrant), motorcycle (motorcycle) and bicycle (bicycle), traffic sign (traffic sign), guide sign (guide sign), billboard (billboard), road sign (roadsign), road pole (pole
- Traffic lights include red traffic lights (trafficlight_red), yellow traffic lights (trafficlight_yellow), green traffic lights (trafficlight_green), and black traffic lights (trafficlight_black).
- Pavement signs include Around/straight, left/right, straight and left, straight and right/straight and around/ Turn left and around/left and right/left bend/right bend/pavement sign, etc.
- the detection tasks of the above-mentioned various targets can be realized in one sensing network, that is, objects to be detected for multiple tasks can be detected in one sensing network, and the detection results can be sent to planning control after processing.
- the unit makes decisions, such as obstacle avoidance, traffic light decisions, or traffic sign decisions.
- identifying the images in the album can facilitate the user or the system to classify and manage the album and improve user experience.
- the solutions of the embodiments of the present application it is possible to obtain or optimize a perceptual network suitable for album picture classification.
- the perception network to classify pictures, for example, classify pictures into different categories such as photos containing animals, photos containing people, etc., so as to label pictures of different categories, which is convenient for users to view and find.
- the classification tags of these pictures can also be provided to the album management system for classification management, which saves the user's management time, improves the efficiency of album management, and enhances the user experience.
- Monitoring scenarios include: smart city, field monitoring, indoor monitoring, outdoor monitoring, and in-vehicle monitoring.
- a variety of detection tasks need to be completed in the smart city perception system. For example, vehicles, license plates, people, and faces need to be detected. After processing, the detection results can be used to judge traffic violations, predict traffic congestion, etc. .
- the input road picture can be processed in a perception network, and the detection tasks of the above-mentioned various targets can be completed.
- the detection tasks of the perception network can also be increased or decreased according to the actual situation.
- the current detection tasks of the perception network include vehicle detection tasks and human detection tasks. If the detection task of traffic signs needs to be added to the detection tasks of the perception network, the structure of the perception network can be adjusted to add the detection task. The specific description can be found later, for example, FIG. 14 .
- a neural network can be composed of neural units, and a neural unit can refer to an operation unit that takes x s and an intercept 1 as input, and the output of the operation unit can be:
- W s is the weight of x s
- b is the bias of the neural unit.
- f is an activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal.
- the output signal of the activation function can be used as the input of the next convolutional layer, and the activation function can be a sigmoid function.
- a neural network is a network formed by connecting a plurality of the above single neural units together, that is, the output of one neural unit can be the input of another neural unit.
- the input of each neural unit can be connected with the local receptive field of the previous layer to extract the features of the local receptive field, and the local receptive field can be an area composed of several neural units.
- a deep neural network also known as a multi-layer neural network, can be understood as a neural network with multiple hidden layers.
- the DNN is divided according to the positions of different layers.
- the neural network inside the DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the middle layers are all hidden layers.
- the layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer.
- DNN looks complicated, in terms of the work of each layer, it is not complicated. In short, it is the following linear relationship expression: in, is the input vector, is the output vector, is the offset vector, W is the weight matrix (also called coefficients), and ⁇ () is the activation function.
- Each layer is just an input vector After such a simple operation to get the output vector Due to the large number of DNN layers, the coefficient W and offset vector The number is also higher.
- the DNN Take the coefficient W as an example: Suppose that in a three-layer DNN, the linear coefficient from the fourth neuron in the second layer to the second neuron in the third layer is defined as The superscript 3 represents the number of layers where the coefficient W is located, and the subscript corresponds to the output third layer index 2 and the input second layer index 4.
- the coefficient from the kth neuron in the L-1 layer to the jth neuron in the Lth layer is defined as
- the input layer does not have a W parameter.
- more hidden layers allow the network to better capture the complexities of the real world.
- a model with more parameters is more complex and has a larger "capacity", which means that it can complete more complex learning tasks.
- Training the deep neural network is the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (the weight matrix formed by the vectors W of many layers).
- Convolutional neural network is a deep neural network with a convolutional structure.
- a convolutional neural network consists of a feature extractor consisting of convolutional and subsampling layers.
- the feature extractor can be viewed as a filter, and the convolution process can be viewed as convolution with an input image or a convolutional feature map using a trainable filter.
- the convolutional layer refers to the neuron layer in the convolutional neural network that convolves the input signal.
- a neuron can only be connected to some of its neighbors.
- a convolutional layer usually contains several feature planes, and each feature plane can be composed of some neural units arranged in a rectangle.
- Neural units in the same feature plane share weights, and the shared weights here are convolution kernels.
- Shared weights can be understood as the way to extract image information is independent of location. The underlying principle is that the statistics of one part of the image are the same as the other parts. This means that image information learned in one part can also be used in another part. So for all positions on the image, the same learned image information can be used.
- multiple convolution kernels can be used to extract different image information. Generally, the more convolution kernels, the richer the image information reflected by the convolution operation.
- the convolution kernel can be initialized in the form of a matrix of random size, and the convolution kernel can obtain reasonable weights by learning during the training process of the convolutional neural network.
- the immediate benefit of sharing weights is to reduce the connections between the layers of the convolutional neural network, while reducing the risk of overfitting.
- the loss function loss function
- objective function objective function
- the training of the deep neural network becomes the process of reducing the loss as much as possible.
- the smaller the loss the higher the training quality of the deep neural network, and the larger the loss, the lower the training quality of the deep neural network.
- the smaller the loss fluctuation the more stable the training; the larger the loss fluctuation, the more unstable the training.
- the neural network can use the error back propagation (BP) algorithm to correct the size of the parameters in the initial model during the training process, so that the reconstruction error loss of the model becomes smaller and smaller. Specifically, forwarding the input signal until the output will generate an error loss, and updating the parameters in the initial super-resolution model by back-propagating the error loss information, so that the error loss converges.
- the back-propagation algorithm is a back-propagation motion dominated by the error loss, aiming to obtain the parameters of the optimal super-resolution model, such as the weight matrix.
- the training method for a perceptual network involves the processing of computer vision.
- data processing methods such as data training, machine learning, and deep learning can be used to perform symbolic and formalized intelligent information modeling and extraction on the training data. , preprocessing, training, etc., to finally obtain a trained perceptual network; and, the object recognition method provided by the embodiment of the application can use the above-mentioned trained perceptual network to input the input data (such as the image to be processed in the application) into the In the trained perception network, output data (such as the first indication information and the target 2D frame of the target object in this application) are obtained.
- the perceptual network training method and the object recognition method provided by the embodiments of the present application are based on the same concept, and can also be understood as two parts in a system, or two stages of an overall process: such as the model training stage and model application stage.
- an embodiment of the present application provides a system architecture 100 .
- a data collection device 160 is used to collect training data.
- the training data may include sample images, labeled data of the sample images, and pseudo frames on the sample images.
- the data collection device 160 After collecting the training data, the data collection device 160 stores the training data in the database 130 , and the training device 120 obtains the target model/rule 101 by training based on the training data maintained in the database 130 .
- the target model/rule 101 can be used to realize the object recognition method of the embodiment of the present application, that is, the image to be processed is input into the target model/rule 101, and the detection result of the object of interest in the image to be processed can be obtained.
- the training data maintained in the database 130 may not necessarily come from the collection of the data collection device 160, and may also be received from other devices.
- the training device 120 may not necessarily train the target model/rule 101 completely based on the training data maintained by the database 130, and may also obtain training data from the cloud or other places for model training. The above description should not be used as a reference to this application Limitations of Examples.
- the target model/rule 101 trained according to the training device 120 can be applied to different systems or devices, such as the execution device 110 shown in FIG. 3 , the execution device 110 can be a terminal, such as a mobile phone terminal, a tablet computer, a laptop computer , Augmented reality (AR) AR/virtual reality (VR), vehicle terminal, etc., it can also be a server or cloud.
- the execution device 110 is configured with an input/output (I/O) interface 112 for data interaction with external devices.
- the user can input data to the I/O interface 112 through the client device 140, and input data
- the image to be processed may be included.
- the execution device 110 When the execution device 110 preprocesses the input data, or the calculation module 111 of the execution device 110 performs calculations and other related processing, the execution device 110 can call the data, codes, etc. in the data storage system 150 for corresponding processing , the data and instructions obtained by corresponding processing may also be stored in the data storage system 150 .
- the I/O interface 112 returns the processing result, such as the detection result obtained above, to the client device 140, thereby providing it to the user.
- client device 140 may be a planning control unit in an automated driving system.
- the training device 120 can generate corresponding target models/rules 101 based on different training data for different goals or different tasks, and the corresponding target models/rules 101 can be used to achieve the above-mentioned goals or complete the above-mentioned goals. tasks to provide the user with the desired result.
- the user can manually specify input data, which can be operated through the interface provided by the I/O interface 112 .
- the client device 140 can automatically send the input data to the I/O interface 112 . If the user's authorization is required to request the client device 140 to automatically send the input data, the user can set the corresponding permission in the client device 140 .
- the user can view the result output by the execution device 110 on the client device 140, and the specific presentation form can be a specific manner such as display, sound, and action.
- the client device 140 can also be used as a data collection terminal to collect the input data of the input I/O interface 112 and the output result of the output I/O interface 112 as new sample data as shown in the figure, and store them in the database 130 .
- the I/O interface 112 directly uses the input data input into the I/O interface 112 and the output result of the output I/O interface 112 as shown in the figure as a new sample The data is stored in database 130 .
- FIG. 3 is only a schematic diagram of a system architecture provided by an embodiment of the present application, and the positional relationship among the devices, devices, modules, etc. shown in the figure does not constitute any limitation.
- the data The storage system 150 is an external memory relative to the execution device 110 , and in other cases, the data storage system 150 may also be placed in the execution device 110 .
- a target model/rule 101 is obtained by training according to the training device 120 , and the target model/rule 101 may be a perceptual network in this embodiment of the present application.
- CNN is a very common neural network
- a convolutional neural network is a deep neural network with a convolutional structure. It is a deep learning architecture.
- a deep learning architecture refers to an algorithm updated through a neural network model. Multiple levels of learning at different levels of abstraction.
- CNN is a feed-forward artificial neural network in which individual neurons can respond to images fed into it.
- a convolutional neural network (CNN) 200 may include an input layer 210 , a convolutional/pooling layer 220 (where the pooling layer is optional), and a fully connected layer 230 .
- the input layer 210 can obtain the image to be processed, and submit the obtained image to be processed by the convolutional layer/pooling layer 220 and the fully connected layer 230 for processing, and the processing result of the image can be obtained.
- the internal layer structure of CNN200 in Figure 4 is described in detail below.
- the convolutional/pooling layer 220 may include layers 221-226 as examples, for example: in one implementation, layer 221 is a convolutional layer, layer 222 is a pooling layer, and layer 223 is a convolutional layer Layer 224 is a pooling layer, 225 is a convolutional layer, and 226 is a pooling layer; in another implementation, 221 and 222 are convolutional layers, 223 are pooling layers, and 224 and 225 are convolutional layers. layer, 226 is the pooling layer. That is, the output of a convolutional layer can be used as the input of a subsequent pooling layer, or it can be used as the input of another convolutional layer to continue the convolution operation.
- the convolution layer 221 may include many convolution operators.
- the convolution operator is also called a kernel. Its role in image processing is equivalent to a filter that extracts specific information from the input image matrix.
- the convolution operator is essentially Can be a weight matrix, which is usually pre-defined, usually one pixel by one pixel (or two pixels by two pixels) along the horizontal direction on the input image during the convolution operation on the image. ...It depends on the value of the stride step) to process, so as to complete the work of extracting specific features from the image.
- the size of the weight matrix should be related to the size of the image. It should be noted that the depth dimension of the weight matrix is the same as the depth dimension of the input image.
- each weight matrix is stacked to form the depth dimension of the convolutional image, where the dimension can be understood as determined by the "multiple" described above.
- Different weight matrices can be used to extract different features in the image. For example, one weight matrix is used to extract image edge information, another weight matrix is used to extract specific colors of the image, and another weight matrix is used to extract unwanted noise in the image.
- the multiple weight matrices have the same size (row ⁇ column), and the size of the convolution feature maps extracted from the multiple weight matrices with the same size is also the same, and then the multiple extracted convolution feature maps with the same size are combined to form The output of the convolution operation.
- weight values in these weight matrices need to be obtained through a lot of training in practical applications, and each weight matrix formed by the weight values obtained by training can be used to extract information from the input image, so that the convolutional neural network 200 can make correct predictions .
- the shallow convolutional layers (such as 221) often extract more general features, which can also be called low-level features; As the depth of the neural network 200 deepens, the features extracted by the later convolutional layers (eg, 226) become more and more complex, such as features such as high-level semantics. Features with higher semantics are more suitable for the problem to be solved.
- the pooling layer can be a convolutional layer followed by a layer.
- the pooling layer can also be a multi-layer convolutional layer followed by one or more pooling layers.
- the pooling layer may include an average pooling operator and/or a max pooling operator for sampling the input image to obtain a smaller size image.
- the average pooling operator can calculate the pixel values in the image within a certain range to produce an average value as the result of average pooling.
- the max pooling operator can take the pixel with the largest value within a specific range as the result of max pooling. Also, just as the size of the weight matrix used in the convolutional layer should be related to the size of the image, the operators in the pooling layer should also be related to the size of the image.
- the size of the output image after processing by the pooling layer can be smaller than the size of the image input to the pooling layer, and each pixel in the image output by the pooling layer represents the average or maximum value of the corresponding sub-region of the image input to the pooling layer.
- the convolutional neural network 200 After being processed by the convolutional layer/pooling layer 220, the convolutional neural network 200 is not sufficient to output the required output information. Because as mentioned before, the convolutional layer/pooling layer 220 only extracts features and reduces the parameters brought by the input image. However, in order to generate the final output information (required class information or other relevant information), the convolutional neural network 200 needs to utilize the fully connected layer 230 to generate one or a set of outputs of the required number of classes. Therefore, the fully connected layer 230 may include multiple hidden layers (231, 232 to 23n as shown in FIG. 4) and the output layer 240, and the parameters contained in the multiple hidden layers may be based on specific task types The relevant training data is pre-trained, for example, the task type can include image recognition, image classification, image super-resolution reconstruction and so on.
- the output layer 240 After the multi-layer hidden layers in the fully connected layer 230, that is, the last layer of the entire convolutional neural network 200 is the output layer 240, the output layer 240 has a loss function similar to the classification cross entropy, and is specifically used to calculate the prediction error, Once the forward propagation of the entire convolutional neural network 200 (as shown in Fig. 4, the propagation from the direction 210 to 240 is forward propagation) is completed, the back propagation (as shown in Fig.
- the propagation from the 240 to 210 direction is the back propagation
- the convolutional neural network shown in FIG. 4 is only used as an example of a possible convolutional neural network, and in specific applications, the convolutional neural network may also exist in the form of other network models.
- FIG. 5 is a hardware structure of a chip provided by an embodiment of the application, and the chip includes a neural network processor 50 .
- the chip can be set in the execution device 110 as shown in FIG. 3 to complete the calculation work of the calculation module 111 .
- the chip can also be set in the training device 120 as shown in FIG. 3 to complete the training work of the training device 120 and output the target model/rule 101 .
- the methods in the embodiments of the present application may be implemented in the chip as shown in FIG. 5 .
- the neural network processor NPU 50 is mounted on the main central processing unit (CPU) (host CPU) as a coprocessor, and tasks are allocated by the main CPU.
- the core part of the NPU is the operation circuit 503, and the controller 504 controls the operation circuit 503 to extract the data in the memory (weight memory or input memory) and perform operations.
- the arithmetic circuit 503 includes multiple processing units (process engines, PEs). In some implementations, arithmetic circuit 503 is a two-dimensional systolic array. The arithmetic circuit 503 may also be a one-dimensional systolic array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, arithmetic circuit 503 is a general-purpose matrix processor.
- the operation circuit fetches the data corresponding to the matrix B from the weight memory 502 and buffers it on each PE in the operation circuit.
- the arithmetic circuit fetches the data of matrix A and matrix B from the input memory 501 to perform matrix operation, and stores the partial result or final result of the matrix in an accumulator 508 .
- the vector calculation unit 507 can further process the output of the arithmetic circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison and so on.
- the vector computing unit 507 can be used for network computation of non-convolutional/non-FC layers in the neural network, such as pooling (pooling), batch normalization (BN), local response normalization (local response normalization) )Wait.
- vector computation unit 507 can store the processed output vectors to unified buffer 506 .
- the vector calculation unit 507 may apply a nonlinear function to the output of the arithmetic circuit 503, such as a vector of accumulated values, to generate activation values.
- vector computation unit 507 generates normalized values, merged values, or both.
- the vector of processed outputs can be used as activation input to the arithmetic circuit 503, eg, for use in subsequent layers in a neural network.
- the operation of the perceptual network provided by the embodiment of the present application may be performed by the operation circuit 503 or the vector calculation unit 507 .
- Unified memory 506 is used to store input data and output data.
- the weight data directly transfers the input data in the external memory to the input memory 501 and/or the unified memory 506 through the storage unit access controller 505 (direct memory access controller, DMAC), and stores the weight data in the external memory into the weight memory 502, And the data in the unified memory 506 is stored in the external memory.
- DMAC direct memory access controller
- a bus interface unit (BIU) 510 is used to realize the interaction between the main CPU, the DMAC and the instruction fetch memory 509 through the bus.
- the instruction fetch memory (instruction fetch buffer) 509 connected with the controller 504 is used to store the instructions used by the controller 504;
- the controller 504 is used for invoking the instructions cached in the memory 509 to control the working process of the operation accelerator.
- the unified memory 506, the input memory 501, the weight memory 502 and the instruction fetch memory 509 are all on-chip (On-Chip) memories, and the external memory is the memory outside the NPU, and the external memory can be double data rate synchronous dynamic random access Memory (double data rate synchronous dynamic random access memory, DDR SDRAM), high bandwidth memory (high bandwidth memory, HBM) or other readable and writable memory.
- DDR SDRAM double data rate synchronous dynamic random access Memory
- HBM high bandwidth memory
- the execution device 110 in FIG. 3 or the chip in FIG. 5 described above can execute each step of the object recognition method of the embodiment of the present application.
- the training device 120 in FIG. 3 or the chip in FIG. 5 described above can perform various steps of the training method for the perceptual network according to the embodiment of the present application.
- an embodiment of the present application provides a system architecture 300 .
- the system architecture includes a local device 301, a local device 302, an execution device 310 and a data storage system 350, wherein the local device 301 and the local device 302 are connected with the execution device 310 through a communication network.
- execution device 310 may be implemented by one or more servers.
- the execution device 310 may be used in conjunction with other computing devices, such as data storage, routers, load balancers and other devices.
- the execution device 310 may be arranged on one physical site, or distributed across multiple physical sites.
- the execution device 310 may use the data in the data storage system 350 or call the program code in the data storage system 350 to implement the training method of the perception network in this embodiment of the present application.
- the perception network includes: a candidate region generation network RPN, where the RPN is used to predict the position information of the candidate two-dimensional 2D frame of the target object in the sample image, and the target object includes multiple tasks to be detected. Objects, each of the multiple tasks includes at least one category; the target objects include a first task object and a second task object.
- RPN candidate region generation network
- the execution device 110 may perform the following processes:
- the training data includes the sample image, the label data of the first task object on the sample image, and the pseudo frame of the second task object on the sample image, and the label data includes the class label of the first task object and the first task object.
- the 2D frame is marked, and the pseudo frame of the second task object is the target 2D frame of the second task object obtained by inferring the sample image through other perceptual networks; the perceptual network is trained based on the training data.
- a perception network can be acquired, and the perception network can be used for detection of various tasks.
- a user may operate respective user devices (eg, local device 301 and local device 302 ) to interact with execution device 310 .
- Each local device can represent any computing device, such as a surveillance camera, personal computer, computer workstation, smartphone, tablet, smart camera, smart car or other type of cellular phone, media consumption device, wearable device, set-top box or gaming console, etc. .
- Each user's local device can interact with the execution device 310 through any communication mechanism/standard communication network, which can be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.
- any communication mechanism/standard communication network which can be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.
- the local device 301 and the local device 302 obtain the relevant parameters of the sensory network from the execution device 310, deploy the sensory network on the local device 301 and the local device 302, and use the sensory network to detect objects.
- a perceptual network may be directly deployed on the execution device 310, and the execution device 310 obtains the image to be processed from the local device 301 and the local device 302, and uses the perceptual network to process the image to be processed.
- the above execution device 310 may also be a cloud device, in this case, the execution device 310 may be deployed in the cloud; or, the above execution device 310 may also be a terminal device, in this case, the execution device 310 may be deployed on the user terminal side, the embodiment of the present application This is not limited.
- the perception network can be deployed on a computing node on a vehicle-mounted visual perception device, a safe city perception device, or a security perception device to process the image to be processed to obtain the detection result of the object of interest in the image to be processed.
- the computing node may be the execution device 110 in FIG. 3 , the execution device 310 in FIG. 5 , a local device, or the like.
- the multi-header multi-task perception network includes a backbone network (backbone) and multiple headers, and each header includes a region proposal network (RPN), a Region of interest align (ROI-Align) module and region convolutional neural networks (RCNN).
- backbone backbone
- RPN region proposal network
- ROI-Align Region of interest align
- RCNN region convolutional neural networks
- Chips used in many fields have low computing power, making it difficult to deploy large-scale sensor networks, and even more difficult to deploy multiple sensor networks.
- the embodiments of the present application provide a perception network, which can reduce the amount of parameters and computation in the perception network, reduce the power consumption of hardware, and improve the running speed of the model.
- FIG. 8 shows a schematic diagram of a sensor network in an embodiment of the present application.
- the sensor network 800 in FIG. 8 includes a backbone network (backbone) 810 and a head end (header).
- backbone backbone
- head end head end
- the perception network in the embodiments of the present application may be implemented by hardware, software, or a combination of software and hardware.
- the backbone network 810 is configured to perform convolution processing on the input image to obtain the first feature map of the input image.
- the backbone network 810 can extract basic features through a series of convolution processing to provide corresponding features for subsequent detection.
- the "first feature map” refers to a feature map (feature map) output by the backbone network.
- the feature maps output by the backbone network can all be referred to as first feature maps.
- the backbone network 810 can output feature maps of the input image at different scales.
- Feature maps at different scales can be understood as the first feature maps of the input image, and these feature maps can provide basic features for subsequent detection.
- Feature maps at different scales can be understood as feature maps of different resolutions, or in other words, feature maps of different sizes.
- the backbone network 810 may adopt various forms of networks, for example, the backbone network 810 may adopt a visual geometry group (VGG), a residual neural network (Resnet) or an inception network (inception- net), inception-net is the core structure of GoogleNet, etc.
- VCG visual geometry group
- Resnet residual neural network
- inception- net inception-net is the core structure of GoogleNet, etc.
- the header is used to detect the target object according to the second feature map, and output the target 2-dimensional (2dementional, 2D) frame of the target object and the first indication information.
- the target objects include objects to be detected in multiple tasks.
- the second feature map is determined from the first feature map.
- the first indication information is used to indicate the category to which the target object belongs.
- the header is used to realize target detection according to the second feature map, and output the target 2D frame of the target object and the first indication information.
- the first indication information may include confidence that the target object belongs to each category. That is, the category to which the target object belongs can be indicated by the confidence of the target object belonging to each category. The higher the confidence, the greater the probability that the target object belongs to the category corresponding to the confidence. For example, the category corresponding to the highest confidence is the category to which the target object belongs.
- the first indication information may be a category to which the target object belongs.
- the first indication information may include the confidence level of the category to which the target object belongs.
- Each category includes object categories in multiple tasks. This embodiment of the present application does not limit the specific form of the first indication information.
- a header can complete the detection of objects to be detected in various tasks, that is, it is used to detect whether there are objects to be detected in the various tasks in the input image.
- a broad category includes at least one category.
- a broad category is a collection of at least one category.
- Task division criteria can be set as needed. For example, the objects to be detected are divided into multiple tasks according to the similarity of the objects to be detected.
- the 31 types of objects to be detected are divided into 8 categories, namely 8 tasks, as shown in Table 1.
- a header can be used to complete a variety of object detection tasks. For example, a header can complete the 8 tasks in Table 1 above, and output the target 2D frame of the target object and the confidence that the target object belongs to the 31 types of objects.
- the perception network 800 may further include other processing modules connected to the header.
- Other processing modules are used to obtain other detection information of the target object according to the target 2D frame of the target object output by the header.
- processing modules can extract the features of the area where the target 2D frame is located in the feature map output by the backbone network according to the target 2D frame output by the header, and complete the 3D detection or 3D detection of the target object in the target 2D frame according to the extracted features. Keypoint detection, etc.
- the header is described in detail below.
- the header includes an RPN 820 , a region of interest extraction module 830 and a classification and regression network 840 .
- RPN820 is used to predict the area where the target object is located on the second feature map, and output the position information of the candidate 2D frame matching the area where the target object is located, that is, the position information of the candidate 2D frame of the target object.
- the target object includes objects to be detected in multiple tasks, each of the multiple tasks includes at least one category, and the second feature map is determined according to the first feature map.
- the region of interest extraction module 830 is used to extract the first feature information on the third feature map based on the position information of the candidate 2D frame, the first feature information is the feature of the region where the candidate 2D frame is located, and the third feature map is based on the first feature. Figure is determined.
- the classification and regression network 840 is used to process the first feature information, and output the target 2D frame of the target object and the first indication information, the number of target 2D frames is less than or equal to the number of candidate 2D frames, and the first indication information is used to indicate the target The class to which the object belongs.
- the classification and regression network can output the target 2D box (box) and class label (label) of the object to be detected in multiple tasks.
- the class label of the target object can be used as the first indication information. It should be understood that the use of the class label as the first indication information in FIG. 8 is only an example, and does not constitute a limitation to the solutions of the embodiments of the present application.
- RPN may also be referred to as a single-head multi-task RPN.
- RPN820 can predict the area where the target object may exist on the second feature map, and give boxes that match the area where the target object may exist. These areas can be called candidate areas (proposal), and the boxes that match the candidate area are candidates. 2D box. The box that matches the proposal can also be called the 2D box of the proposal.
- the target object includes objects to be detected in multiple tasks, for example, the objects to be detected in the 8 tasks in Table 1, and the RPN820 is used to predict the regions where the objects to be detected in the 8 tasks may exist.
- the target objects may include objects to be detected in all tasks of the perception network. That is, RPN can be used to predict the region of the object to be detected in all tasks that may exist on the second feature map. In other words, all tasks of the perception network share the same RPN.
- the second feature map may be one or multiple.
- the second feature map may include one or more of the first feature map.
- the perceptual network 800 further includes feature pyramid networks (FPN).
- FPN feature pyramid networks
- the FPN is connected to the backbone 810, and is used to perform feature fusion on the feature map output by the backbone 810, that is, perform feature fusion on the first feature map of the input image, and output the fused feature map.
- the fused feature map is input into the RPN.
- the second feature map may include one or more of the fused feature maps.
- FPN takes the feature maps of different scales output by the backbone 810 as input, and through the internal vertical feature fusion of the FPN and the horizontal feature fusion of the same layer with the backbone 810, a feature map with more expressive ability is generated and provided to the subsequent modules, and then Improve the performance of the model.
- FPN can be used to achieve multi-scale feature fusion.
- the backbone 810 is connected to the RPN 820.
- the region of interest extraction module 830 is configured to deduct the feature of the region where the candidate 2D frame is located from the third feature map according to the candidate 2D frame output by the RPN 820 .
- the third feature map is determined according to the first feature map, including:
- the third feature map may be one of the feature maps output by the backbone (ie, the first feature map) or one of the fused feature maps output by the FPN;
- the third feature map may be one of the feature maps (ie, the first feature map) output by the backbone.
- the region of interest extraction module 830 deducts the features of the region where each proposal is located from a certain feature map output by the backbone or FPN according to the proposal provided by the RPN 820, and adjusts the size (resize) to a fixed size to obtain each characteristics of a proposal.
- the region of interest extraction module 830 may adopt region of interest pooling (ROI-pooling), region of interest extraction (ROI-Align), position sensitive region of interest pooling (position sensitive ROI pooling, PS-ROIPOOLING) ) or position sensitive ROI align (PS-ROIALIGN) and other feature extraction methods.
- ROI-pooling region of interest pooling
- ROI-Align region of interest extraction
- position sensitive region of interest pooling position sensitive ROI pooling
- PS-ROIPOOLING position sensitive ROI align
- PS-ROIALIGN position sensitive ROI align
- the region of interest extraction module 830 adopts the method of difference and sampling in the region where the proposal is located, deducts features of a fixed resolution, and inputs the deducted features into subsequent modules.
- the classification and regression network 840 is specifically configured to: process the first feature information to obtain the confidence that the candidate 2D frame belongs to each category in the multiple tasks; adjust the position information of the candidate 2D frame to obtain the adjusted 2D frame.
- the candidate 2D frame; the target 2D frame is determined according to the adjusted candidate 2D frame; the first indication information is determined according to the confidence that the target 2D frame belongs to each category.
- the position information of the candidate 2D frame is adjusted so that the adjusted candidate 2D frame matches the shape of the actual object more closely than the candidate 2D frame, that is, the adjusted candidate 2D frame is a more compact candidate 2D frame.
- a frame merging operation is performed on the adjusted candidate 2D frame to obtain the target 2D frame.
- the adjusted 2D boxes are merged with non-maximum suppression (NMS) to obtain the target 2D boxes.
- NMS non-maximum suppression
- the classification and regression network 840 refines each proposal provided by the region of interest extraction module 830 to obtain the confidence that each proposal belongs to 31 categories in the 8 tasks, At the same time, the coordinates of the 2D boxes of each proposal are adjusted to obtain the adjusted candidate 2D boxes. Further, after the adjusted candidate 2D frame is merged by NMS, the target 2D frame and the first indication information are obtained. The number of candidate 2D boxes is greater than or equal to the number of target 2D boxes.
- the classification and regression network 840 includes multiple third RCNNs, wherein the multiple third RCNNs correspond to multiple tasks one-to-one. That is, each third RCNN separately completes the detection of objects to be detected in different tasks.
- FIG. 9 shows a schematic block diagram of a cognitive network provided by an embodiment of the present application.
- the perceptual network includes backbone, FPN, RPN, ROI-Align module, and n third RCNNs.
- the third RCNN is used to: process the features of the area where the candidate 2D frame is located to obtain the confidence level of the object category in the task corresponding to the third RCNN; and adjust the position information of the candidate 2D frame so that The adjusted candidate 2D box.
- any third RCNN among the plurality of third RCNNs can predict the confidence that the candidate 2D frame belongs to the object category in the task corresponding to the third RCNN, and obtain the adjusted candidate 2D frame.
- the multiple third RCNNs can obtain the confidence of the candidate 2D frame belonging to each category, and the adjusted candidate 2D frame obtained by each third RCNN.
- the target 2D frame and the first indication information are obtained.
- the task corresponding to the third RCNN1# is the vehicle detection task in Table 1, then the third RCNN1# outputs the confidence that each proposal belongs to the three categories of cars, trucks and buses and the adjusted candidate 2D box .
- the task corresponding to the third RCNN2# is the detection task of wheels and lights in Table 1, then the third RCNN2# outputs the confidence that each proposal belongs to the two categories of wheels and lights and the adjusted candidate 2D frame. In this way, for any proposal, a total of five categories of confidence and adjusted candidate 2D boxes can be obtained after being processed by the third RCNN1# and the third RCNN2#.
- the perceptual network in FIG. 9 is used to implement n tasks, for example, the n tasks include task 0, task 1 . . . task n-1 in FIG. 9 .
- n is an integer greater than 1.
- the n third RCNNs correspond to each of the n tasks one-to-one. Taking task 0 as an example, the third RCNN corresponding to task 0 outputs the confidence that each proposal belongs to each object category in task 0 and the adjusted candidate 2D box.
- the n third RCNNs corresponding to the n tasks obtain the confidence of each object category in each corresponding task, and the classification and regression network can obtain the confidence that each proposal belongs to each category.
- the FPN in FIG. 9 is an optional module.
- the ROI-Align module is used as the region of interest extraction module only as an example, and other methods may also be used to extract corresponding features.
- the ROI-Align module is used as the region of interest extraction module only as an example, and other methods may also be used to extract corresponding features.
- the classification and regression network includes a first RCNN
- the first RCNN includes a hidden layer, multiple sub-classification fully connected layers (classification fully connected layers, cls fc) and multiple sub-regression fully connected layers (regression fully connected layers). connected layers, reg fc), the hidden layer is connected to multiple sub-classification fully connected layers, the hidden layer is connected to multiple sub-regression fully connected layers, multiple sub-classification fully connected layers correspond to multiple tasks one-to-one, and multiple sub-regression fully connected layers are connected to One-to-one correspondence between multiple tasks.
- the first RCNN includes a hidden layer and multiple sub-cls fc and multiple sub-reg fc corresponding to multiple tasks.
- Each task can have an independent sub-classification fc and sub-regression fc.
- FIG. 10 shows a schematic block diagram of another cognitive network provided by an embodiment of the present application.
- the perceptual network includes backbone, FPN, RPN, ROI-Align module and the first RCNN.
- the hidden layer is used to process the first feature information to obtain the second feature information.
- the hidden layer is used to process the features of the region where the candidate 2D box is located, and the processed results are respectively input to multiple sub-classification fully connected layers and multiple sub-regression fully connected layers.
- the hidden layer may include at least one of the following: a convolutional layer or a fully connected layer. Since multiple tasks share the hidden layer, the convolutional layer in the hidden layer can also be called a shared convolutional layer (shared convolutional, shared conv), and the fully connected layer in the hidden layer can also be called a shared fully connected layer (shared fully connected layer). layers, shared fc).
- the sub-category fully-connected layer is used to obtain, according to the second feature information, the confidence level that the candidate 2D frame belongs to the object category in the task corresponding to the sub-category fully-connected layer.
- the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the second feature information to obtain the adjusted candidate 2D frame. Further, the sub-regression fully connected layer can use box merging operations, such as NMS operations, to remove duplicate boxes and output more compact candidate 2D boxes.
- box merging operations such as NMS operations
- the sub-category fully-connected layer and the sub-regression fully-connected layer corresponding to each task can complete the detection of the object to be detected in the task.
- the sub-category fully connected layer can output the confidence level that the candidate 2D frame belongs to the object category in the task
- the sub-regression fully connected layer can output the adjusted candidate 2D box. That is to say, a first RCNN can complete the detection of objects to be detected in multiple tasks.
- the first RCNN can also be called a single-head multi-task RCNN.
- the first RCNN can predict the confidence that the candidate 2D frame belongs to the object category in the multiple tasks corresponding to the first RCNN, and obtain the adjusted candidate frame.
- the multiple tasks corresponding to the first RCNN include 8 tasks in Table 1, then the first RCNN includes 8 sub-cls fc and 8 reg fc, respectively corresponding to the 8 tasks, each sub-cls fc outputs each Each proposal belongs to the confidence level of the object category in the task corresponding to the sub-cls fc, and each reg fc outputs the adjusted candidate 2D frame, so that the first RCNN can obtain that each proposal belongs to the 31 categories in the 8 tasks Object confidence and adjusted candidate 2D boxes.
- the perceptual network in FIG. 10 is used to implement n tasks, for example, the n tasks include task 0, task 1 . . . task n-1 in FIG. 10 .
- n is an integer greater than 1.
- the first RCNN includes a hidden layer and n sub-cls fc and n sub-reg fc corresponding to n tasks, respectively.
- Hidden layers can include Shared fc and/or Shared conv.
- the sub-cls fc corresponding to task 0 in the first RCNN outputs the confidence that each proposal belongs to each object category in task 0, and the sub-reg fc corresponding to task 0 outputs the adjusted candidate 2D frame.
- the n sub-cls fc corresponding to the n tasks obtain the confidence that each proposal belongs to each object category in the corresponding task, and the first RCNN can obtain the confidence that each proposal belongs to each category.
- the FPN in Figure 10 is an optional module.
- the ROI-Align module is used as the region of interest extraction module only as an example, and other methods can also be used to extract corresponding features. For the specific description, refer to the foregoing, which will not be repeated here.
- the classification and regression network includes a second RCNN
- the second RCNN includes a hidden layer, a classification fully connected layer and a regression fully connected layer
- the hidden layer is connected to the classification fully connected layer
- the hidden layer is fully connected to the regression layer layers are connected.
- FIG. 11 shows a schematic block diagram of yet another cognitive network provided by an embodiment of the present application.
- the perceptual network includes backbone, FPN, RPN, ROI-Align module, and a second RCNN.
- the hidden layer is used to process the first feature information to obtain the third feature information.
- the hidden layer is used to process the features of the region where the candidate 2D box is located, and the processed results are input to the classification fully connected layer and the regression fully connected layer respectively.
- the hidden layer may include at least one of the following: a convolutional layer or a fully connected layer.
- a convolutional layer or a fully connected layer.
- the first RCNN which will not be repeated here.
- the classification fully connected layer is used to obtain the confidence that the candidate 2D frame belongs to each category according to the third feature information.
- the regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the third feature information to obtain the adjusted candidate 2D frame. Further, a frame merging operation is performed on the adjusted candidate 2D frame to obtain the target 2D frame.
- a second RCNN completes the detection of objects to be detected in multiple tasks.
- the second RCNN can also be called a single-head multi-task RCNN.
- the classification fully connected layer is obtained by merging multiple sub-classification fully connected layers in the first RCNN.
- the regressive fully connected layer is obtained by merging multiple sub-regressive fully connected layers in the first RCNN.
- the first characteristic information and the third characteristic information are the same.
- Combining multiple sub-category fully-connected layers can be understood as splicing the weight matrices of multiple sub-category fully-connected layers.
- Combining multiple sub-regression fully connected layers can be understood as splicing the weight matrices of multiple sub-regression fully connected layers.
- the first RCNN can use the sigmoid function to normalize the label logits obtained by the sub-category fc, which is equivalent to performing a binary classification process for each category.
- the relationship between sub-categories fc of multiple tasks in the model is merged into one category fc, which will not affect the inference results of the model, that is, the output of multiple sub-categories fc is the same as the output of the category fc obtained by merging multiple sub-categories fc.
- the tasks performed by the second RCNN and the first RCNN can be the same, and the output results are also the same.
- accelerators such as NPU
- only one matrix operation is completed at a time.
- the output of the hidden layer needs to be input to the sub-classification fc and sub-regression fc corresponding to each task for multiple matrix operations.
- the number of matrix multiplications in the RCNN increases with the number of tasks, and the number of matrix multiplications performed in the second RCNN is not affected by the number of tasks. That is to say, in the case where the parameters of the first RCNN and the second RCNN are the same, the time required to execute the second RCNN is less than the time required to execute the first RCNN.
- the classification fully connected layer of the second RCNN is obtained by merging the sub-classification fully connected layers corresponding to multiple tasks in the first RCNN, and the sub-regression fully connected layers corresponding to multiple tasks in the first RCNN are merged to obtain the second RCNN.
- the regression fully connected layer which can reduce the number of operations of matrix multiplication in the neural network accelerator, is more friendly to hardware, and further reduces time-consuming.
- the perceptual network of FIG. 11 is used to implement n tasks, the n tasks include task 0, task 1 . . . task n-1 in FIG. 10 .
- n is an integer greater than 1.
- the second RCNN includes hidden layers and cls fc and reg fc.
- Hidden layers can include Shared fc and/or Shared conv.
- cls fc may be obtained by merging n sub-cls fcs in FIG. 10
- reg fc may be obtained by merging n sub-reg fcs in FIG. 10 .
- cls fc can output the confidence that each proposal belongs to each category, and reg fc can output the adjusted candidate 2D box.
- the FPN in Figure 11 is an optional module.
- the ROI-Align module is used as the region of interest extraction module only as an example, and other methods may also be used to extract corresponding features. For details, refer to the foregoing description, which will not be repeated here.
- the classification and regression network adopts the first RCNN, and after the training is completed, the second RCNN is obtained based on the first RCNN, that is, in the perceptual network used for inference, the classification and regression network can adopt the second RCNN. .
- the perceptual network in FIG. 10 can be applied to the training side, and the first RCNN in the trained perceptual network is merged to obtain the perceptual network shown in FIG. 11 , that is, the model parameters in FIG. model parameters are obtained.
- the perceptual network in Figure 11 can be applied to the inference side to reduce time-consuming.
- one sensing network is used to complete various sensing tasks, multiple tasks share one RPN, and one RPN predicts the area where the objects to be detected in multiple tasks are located, while ensuring the performance of the sensing network, It reduces the amount of parameters and calculation of the perception network, improves the processing efficiency, is conducive to deployment in scenarios with high real-time requirements, reduces the pressure on hardware, and saves costs.
- the first RCNN or the second RCNN is used as the classification and regression network, and multiple tasks share the hidden layer of the RCNN, which further reduces the amount of parameters and calculation of the perception network, and improves the processing efficiency.
- each task corresponds to independent sub-classification fc and sub-regression fc, which improves the scalability of the perception network. Flexibly increase or decrease detection tasks by increasing or decreasing sub-classification fc and sub-regression fc.
- multiple sub-classification fc and sub-regression fc in the first RCNN are combined, and the second RCNN is used as the classification and regression network, which can further reduce the operation of matrix operations, is more friendly to hardware, and further The time-consuming operation is reduced and the processing efficiency is improved.
- the perception network in the embodiment of the present application may be trained by using an existing training method.
- the labeling data is partial labeling data, for example, when only labeling the labeling data of the object to be detected for one task is marked on a sample image, when the labeling data of the object to be detected for the task is used for training, adjustments will be made.
- the parameters of the RPN so that the RPN can more accurately predict the candidate 2D frame of the object to be detected for this task, but cannot accurately predict the candidate 2D frame of the object to be detected for other tasks on the sample image.
- the parameters of the RPN will be adjusted, so the adjusted RPN may not be able to accurately predict the candidate 2D frame of the object to be detected in other tasks. In this way, the training data of different tasks may suppress each other, causing RPN to fail to predict all the target objects in the image.
- the embodiment of the present application provides a training method for a perceptual network, which utilizes sample images in the inference training set of other perceptual networks to provide pseudo boxes (pseudo bounding boxes, Pseudo Bboxes) for objects to be detected that are not marked in the sample images, and then
- the RPN is jointly trained based on pseudo-frames and labeled data, which is beneficial to obtain candidate 2D frames of objects to be detected in multiple tasks.
- FIG. 12 shows a method 1200 for training a perceptual network provided by an embodiment of the present application.
- the method 1200 may be performed by a training device for a neural network model, and the training device may be a cloud service device or a terminal device.
- a device with sufficient computing power to execute the neural network model training method such as a computer and a server, can also be a system composed of cloud service equipment and terminal equipment.
- the method 1200 may be performed by the training device 120 in FIG. 3 , the neural network processor 50 in FIG. 5 , or the execution device 310 in FIG. 6 .
- the perception network includes: RPN, where the RPN is used to predict the position information of the candidate 2D frame of the target object in the sample image, the target object includes objects to be detected for multiple tasks, and each task in the multiple tasks includes at least one category.
- the sensory network may be the sensory network shown in FIG. 8 .
- relevant descriptions are appropriately omitted when describing the training method. During training, just replace the input image with a sample image.
- the method 1200 includes steps S1210 to S1220, and steps S1210 to S1220 are described below.
- the target objects include a first task object and a second task object.
- the training data includes the sample image, the labeling data of the first task object on the sample image, and the pseudo-frame of the second task object on the sample image, and the labeling data includes the class label of the first task object and the labeled 2D frame of the first task object,
- the pseudo frame of the second task object is the target 2D frame of the second task object obtained by inferring the sample image through other perceptual networks.
- Labeled data can also be understood as ground truth.
- Annotated class labels are used to indicate the true class to which the task object belongs.
- the labeled data of the first task object can also be understood as the labeled data of the sample image.
- the fully annotated data of the sample image includes the class labels and annotated 2D boxes of the objects to be detected in all tasks on the sample image.
- the fully annotated data includes the annotation information of all objects of interest.
- Part of the annotation data includes the class label and annotated 2D frame of the object to be detected in some tasks on the sample image.
- Part of the annotation data only includes the annotation information of some objects of interest.
- the first task objects may include objects to be detected in one or more tasks.
- the one or more tasks are the tasks where the first task object is located.
- the first task objects in different sample images in the training set may be the same or different.
- the "first” in the "first task object” in the embodiment of the present application is only used to define the object to be detected that has a true value in the sample image, and has no other limiting role.
- the annotation data of sample image 1# is the annotation data of the car, that is, the first task object in the sample image 1# includes the objects to be detected in the detection task of the car, such as trucks, cars, buses, etc.
- the sample image The labeled data of 2# is the labeled data of wheels and lights, that is, the first task object in sample image 2# includes the objects to be detected in the detection task of wheels and lights, such as wheels, lights, etc.
- sample image The labeling data of 3# includes the labeling data of the car and the labeling data of the wheels and lights, that is, the first task object in the sample image 3# includes the objects in the detection task of the car and the objects to be detected in the detection task of the wheels and lights. object.
- the labeling data of the sample images in the embodiments of the present application may be partial labeling data, so that targeted collection can be carried out, that is, the required sample images are collected for specific tasks, and it is not necessary to mark each sample image in each sample image to be marked for all tasks.
- the detected objects reduce the cost of data collection and labeling.
- the scheme using part of the labeled data has flexible scalability. In the case of adding tasks, it is only necessary to provide the labeled data of the new tasks, and there is no need to label new objects to be detected on the basis of the original training data. .
- the Pseudo Bboxes on the sample image are the target 2D boxes of the second task object obtained by inferring the sample image through other perceptual networks.
- the Pseudo Bboxes on the sample image can also be understood as the Pseudo Bboxes of the second task object.
- Other perceptual networks refer to other perceptual networks than the one to be trained.
- the other perceptual network may be a multi-head multi-tasking perceptual network.
- the perceptual network as shown in FIG. 7 is used to infer the sample images in the training set, and the inference result of the sample image is obtained, and the inference result includes the target 2D frame of the target object on the sample image.
- other perceptual networks may also include multiple single-task perceptual networks.
- multiple single-task perceptual networks are used to infer the sample images in the training set respectively, and the inference results of the sample images are obtained respectively.
- the inference results of each single-task perceptual network include the object to be detected in the task on the sample image.
- the target 2D frames of the objects to be detected in multiple tasks on the sample image can be obtained.
- the second task objects may include objects to be detected in one or more tasks.
- the one or more tasks are the tasks where the second task object is located.
- the same object to be detected may exist in the second task object and the first task object.
- the second task objects in different sample images in the training set can be the same or different.
- the "second" in the "second task object” in the embodiment of the present application is only used to define the object to be detected with a pseudo frame in the sample image, and has no other limiting role.
- the annotation frame in the annotation data is used as the target output of the RPN.
- Labeled data is usually human-labeled data, and the accuracy of labeling data is usually higher than that of pseudo-frames obtained by inference from other perception networks. Using labelled frames as the target output can improve the accuracy of the training model.
- the multiple tasks that the perception network needs to complete include the 8 tasks in Table 1, the labeled data of the sample image 1# is the labeled data of the car, and the first task object in the sample image 1# includes the object to be detected in the car detection task.
- the detected objects such as trucks, cars and buses, that is, the labeled data of sample image 1# are part of the labeled data.
- the sample image 1# is reasoned through other perceptual networks to obtain the target 2D frame of the second task object, that is, the pseudo frame.
- the sample image 1# is inferred by 7 single-task perception networks used to complete the 7 tasks except the car detection task in Table 1, and the target 2D frame of the second task object is obtained, in this case , the second task object may include objects in the seven tasks in Table 1 except for the vehicle detection task.
- the multi-head and multi-task perceptual network shown in Figure 7 can be used to complete the 8 tasks in Table 1.
- the target 2D frame of the second task object can be obtained.
- the second task object may include the objects to be detected in the eight tasks in Table 1. In this way, the regions where the objects to be detected are located in the eight tasks in the sample image 1# can be obtained after the pseudo frame and the annotation frame are combined.
- the RPN predicts the area where the object to be detected is located in all tasks that need to be detected.
- other perceptual networks perform reasoning on the sample image, and can obtain the target 2D frame of the second task object on the sample image and the confidence level of the category to which the second task object belongs.
- the target 2D frame of the second task object on the sample image obtained by other perceptual network inferences is used as the pseudo frame on the sample image. That is, when the confidence level is greater than or equal to the first threshold, the inference results of other perceptual networks are used for training.
- a low threshold may be used for filtering.
- the first threshold is 0.05, that is, the target 2D frame with a confidence level greater than or equal to 0.05 can be used as a pseudo frame on the sample image to participate in the training of the perceptual network together with the labeled data. It should be understood that the first threshold may be set as required, which is not limited in this embodiment of the present application.
- step S1220 may include steps S1221 to S1223.
- S1221 Calculate a first loss function value according to the difference between the marked 2D frame of the first task object and the target 2D frame of the second task object and the candidate 2D frame of the target object in the sample image predicted by the RPN.
- the labeled 2D frame of the first task object and the target 2D frame of the second task object are compared with the candidate 2D frame of the target object predicted by RPN, and the loss function value of the RPN stage is obtained, that is, the first loss function value.
- the forward propagation of the perceptual network is performed based on the sample image, and the candidate 2D frame of the target object on the sample image is predicted by the RPN.
- the specific forward propagation process is shown in FIG. 8 and will not be repeated here.
- S1222 Calculate a second loss function value of the perceptual network according to the labeled data of the sample image.
- the second loss function value of the perceptual network is the second loss function value of the part of the perceptual network that needs to be trained.
- the part to be trained in the perception network includes the part to be trained in the classification and regression network, the region of interest extraction module, the RPN and the backbone network, and the part to be trained in the classification and regression network is determined according to the first task object.
- the part of the perceptual network that needs to be trained refers to the part of the perceptual network that needs to be trained as determined by the sample images.
- the classification and regression network can predict the confidence that the candidate 2D box belongs to each category and the target 2D box of the target object.
- the region of interest extraction module deducts the features of the candidate 2D frame from the feature map, and the features of the candidate 2D frame are input into the part to be trained in the classification and regression network, and the candidate 2D frame is obtained. Confidence that the 2D box belongs to the object category in the task corresponding to the first task object.
- the part of the classification and regression network that needs to be trained is determined according to the first task object. In other words, the part to be trained in the classification and regression network is determined according to the task where the first task object is located.
- the classification and regression network includes a plurality of third RCNNs, and the part to be trained in the classification and regression network includes the third RCNN corresponding to the task where the first task object is located.
- the perception network may be as shown in FIG. 9 .
- the task where the first task object in the sample image 1# (an example of the sample image) is located includes a vehicle detection task, and the first task object includes an object to be detected in the vehicle detection task.
- the features of the candidate 2D box are input into the third RCNN corresponding to the vehicle detection task, and then the confidence level of the candidate 2D box belonging to the three categories of cars, trucks and buses, and the target 2D box are obtained.
- the part to be trained in the classification and regression network is the third RCNN corresponding to the vehicle detection task.
- the classification and regression network includes a first RCNN, and the part to be trained in the classification and regression network includes the hidden layer in the first RCNN and the sub-classification fc and sub-regression fc corresponding to the task where the first task object is located.
- the perception network can be as shown in FIG. 10 .
- the task where the first task object in the sample image 1# is located includes the detection task of the car, and the first task object includes the object to be detected in the detection task of the car.
- the features of the candidate 2D box are input into the sub-classification fc and sub-regression fc corresponding to the vehicle detection task after passing through the hidden layer in the first RCNN, and then the confidence level of the candidate 2D box belonging to the three categories of cars, trucks and buses is obtained. , and the target 2D box.
- the part that needs to be trained in the classification and regression network is the hidden layer in the first RCNN and the sub-classification fc and sub-regression fc corresponding to the car detection task.
- the labeled data of the sample image is compared with the output result of the classification and regression network, and the loss function value of the task where the first task object in the classification and regression network stage is located, that is, the second loss function value is obtained. That is, the loss of other tasks not involved in the annotation data of the sample images is not calculated.
- S1223 Perform backpropagation based on the first loss function value and the second loss function value, and adjust the parameters of the part of the perception network that needs to be trained.
- the gradient of the parameter related to the first loss function value is calculated, and then the parameter related to the first loss function value is adjusted based on the gradient of the parameter, so as to realize the adjustment of the perceptual network, so that the RPN can Predict candidate boxes more comprehensively.
- the parameters related to the first loss function value are the parameters in the perceptual network used in the process of obtaining the first loss function value, for example, the parameters of the backbone and the parameters of the RPN. Further, in the case where the perceptual network includes FPN, the parameter related to the value of the first loss function also includes FPN.
- the gradient of the parameter related to the second loss function value is calculated, and then the parameter related to the second loss function value is adjusted based on the gradient of the parameter to realize the adjustment of the perceptual network, so that the classification regression
- the network can better correct the output 2D box and improve the accuracy of category prediction.
- the parameters related to the second loss function are the parameters in the perceptual network used in the process of calculating the value of the second loss function, for example, the parameters of the backbone, the parameters of the RPN, the parameters of the region of interest extraction module, and the classification and regression network. parameters for the part of the training required. Further, in the case where the perceptual network includes FPN, the parameter related to the value of the second loss function also includes FPN.
- the parameters related to the second loss function are the parameters of the part of the perception network that needs to be trained.
- the training termination condition is met, the training is terminated, and a trained perceptual network is obtained.
- the training is terminated and the weights of the trained perceptual network are output.
- steps S1221 to S1223 are only an implementation manner of step S1220, and step S1220 may also be implemented in other manners.
- step S1220 includes the following steps S1 to S3.
- S1 Calculate a first loss function value according to the difference between the labeled 2D frame of the first task object and the target 2D frame of the second task object and the candidate 2D frame of the target object on the sample image predicted by the RPN.
- the labeled 2D frame of the first task object and the target 2D frame of the second task object are compared with the candidate 2D frame of the target object predicted by RPN, and the loss function value of the RPN stage is obtained, that is, the first loss function value.
- the forward propagation of the perceptual network is performed based on the sample image, and the candidate 2D frame of the target object on the sample image is predicted by the RPN.
- the specific forward propagation process is shown in FIG. 8 and will not be repeated here.
- the second loss function value of the part to be trained in the perceptual network is calculated, and the value of the second loss function of the part to be trained in the perceptual network is calculated.
- the part includes the part that needs to be trained in the classification and regression network, the region of interest extraction module, the RPN and the backbone network.
- the part that needs to be trained in the classification and regression network is determined according to the first task object and the second task object.
- the pseudo-label on the sample image is the class label of the second task object on the sample image obtained by inferring the sample image through other perceptual networks.
- the classification and regression network can predict the confidence that the candidate 2D box belongs to each category and the target 2D box of the target object.
- the region of interest extraction module deducts the features of the candidate 2D frame from the feature map, and the features of the candidate 2D frame are input into the part to be trained in the classification and regression network, and the candidate 2D frame is obtained.
- the part of the classification and regression network that needs to be trained is determined according to the first task object and the second task object. In other words, the part to be trained in the classification and regression network is determined according to the task where the first task object is located and the task where the second task object is located.
- the classification and regression network includes a plurality of third RCNNs, for example, the perceptual network may be as shown in FIG. 9 .
- the task where the first task object in the sample image 1# is located includes the detection task of the car, and the first task object includes the object to be detected in the detection task of the car.
- the features of the candidate 2D box are input into the third RCNN corresponding to the vehicle detection task, and then the confidence level of the candidate 2D box belonging to the three categories of cars, trucks and buses, and the target 2D box are obtained.
- the task where the second task object in the sample image 1# is located includes the detection task of wheels and lights, and the second task object includes objects in the detection task of wheels and lights.
- the features of the candidate 2D frame are input into the third RCNN corresponding to the detection task of wheels and lights, and then the confidence of the candidate 2D frame belonging to the two categories of wheels and lights, and the target 2D frame are obtained.
- the parts to be trained in the classification and regression network are the third RCNN corresponding to the detection task of the car and the third RCNN corresponding to the detection task of the wheels and lights.
- the classification and regression network includes the first RCNN, for example, the perceptual network may be as shown in FIG. 10 .
- the task where the first task object in the sample image 1# is located includes the detection task of the car, and the first task object includes the object to be detected in the detection task of the car.
- the features of the candidate 2D box are input into the sub-classification fc and sub-regression fc corresponding to the vehicle detection task after passing through the hidden layer in the first RCNN, and then the confidence level of the candidate 2D box belonging to the three categories of cars, trucks and buses is obtained. , and the target 2D box.
- the task where the second task object in the sample image 1# is located includes the detection task of wheels and lights, and the second task object includes objects in the detection task of wheels and lights.
- the features of the candidate 2D box are input into the sub-classification fc and sub-regression fc corresponding to the detection task of wheels and lights after passing through the hidden layer in the first RCNN, and then the confidence that the candidate 2D box belongs to the two categories of wheels and lights is obtained. degrees, and the target 2D box.
- the parts that need to be trained in the classification and regression network include the hidden layer in the first RCNN, the sub-classification fc and sub-regression fc corresponding to the detection task of the car, and the sub-classification corresponding to the detection task of wheels and lights fc and subregression fc.
- the gradient of the parameter related to the first loss function value is calculated, and then the parameter related to the first loss function value is adjusted based on the gradient of the parameter, so as to realize the adjustment of the perceptual network, so that the RPN can Predict candidate boxes more comprehensively.
- the parameters related to the first loss function value are the parameters in the perceptual network used in the process of obtaining the first loss function value, for example, the parameters of the backbone and the parameters of the RPN. Further, in the case where the perceptual network includes FPN, the parameter related to the value of the first loss function also includes FPN.
- the gradient of the parameter related to the second loss function value is calculated, and then the parameter related to the second loss function value is adjusted based on the gradient of the parameter to realize the adjustment of the perceptual network, so that the classification regression
- the network can better correct the output 2D box and improve the accuracy of category prediction.
- the parameters related to the second loss function are the parameters in the perceptual network used in the process of calculating the value of the second loss function, for example, the parameters of the backbone, the parameters of the RPN, the parameters of the region of interest extraction module, and the classification and regression network. parameters for the part of the training required. Further, in the case where the perceptual network includes FPN, the parameter related to the value of the second loss function also includes FPN.
- the parameters related to the second loss function are the parameters of the part of the perception network that needs to be trained.
- the training termination condition is met, the training is terminated, and a trained perceptual network is obtained.
- the training is terminated and the weights of the trained perceptual network are output.
- the perception network is jointly trained based on the pseudo frame and the labeled data, and in the case that the labeled data only includes the labeled data of the first task object, that is, in the case of partial labeled data, the information of the second task object is provided.
- Pseudo frame in order to provide a more comprehensive frame of the object to be detected on the same sample image as the target output of the RPN, to adjust the parameters of the RPN so that the output of the RPN is constantly close to the target data, avoiding mutual inhibition between different tasks, which is beneficial to It enables RPN to obtain more comprehensive and accurate candidate 2D boxes, while improving the recall rate.
- the labeling data of the sample images in the embodiments of the present application may be partial labeling data, so that targeted collection can be performed, that is, the required sample images are collected for specific tasks, and there is no need to mark the objects to be detected for all tasks in each sample image. It reduces the cost of data collection and the cost of labeling, which is conducive to balancing the training data of different tasks.
- the scheme using part of the labeled data has flexible scalability. In the case of adding tasks, it is only necessary to provide the labeled data of the new tasks, and there is no need to label new objects to be detected on the basis of the original training data. .
- the parts of the perception network that are shared by different tasks all participate in the training process based on the labeled data of different tasks, so that It enables the parts shared by different tasks in the perceptual network to learn the common features of each task.
- Different parts corresponding to different tasks in the perception network for example, the parts corresponding to each task in the classification and regression network, only participate in the training process based on the labeled data of the respective tasks, which can make different parts corresponding to different tasks in the perception network. Its task-specific features can be learned, improving the accuracy of the model.
- the part of the classification and regression network that needs to be trained is determined according to the task, and different parts of the classification and regression network corresponding to different tasks do not affect each other during the training process, ensuring the independence of each task, making The model has strong flexibility.
- FIG. 13 shows a training method of a perceptual network provided by an embodiment of the present application.
- the method shown in FIG. 13 may be regarded as a specific implementation of the method shown in FIG. 12 .
- appropriate omissions are made when describing the method 1300 .
- the solution of the embodiment of the present application is described in detail below by taking the visual perception system of ADAS/ADS as an example.
- the visual perception system of ADAS/ADS needs to perform target detection for various tasks, such as: dynamic obstacles, static obstacles, traffic signs, traffic lights, road signs (such as left turn signs or straight signs) and zebra crossings.
- the target objects include the first task object and the second task object.
- the training data includes the sample image, the annotation data of the first task object on the sample image, and the pseudo frame of the second task object on the sample image.
- the annotation data includes the class label of the first task object and the labeled 2D frame of the first task object.
- labeled data is provided for each task. For example, provide the labeling data of the car for the training process of task0, mark the 2D frame and class label of Car/Truck/Bus on one or more sample images in the dataset; provide the labeling data of the person for the training of task1, in the data One or more sample images in the set are marked with the 2D frame and class label of Pedestrian/Cyclist/Tricycle; the annotation data of wheels and lights are provided for task2, and Wheel/Car_light is marked on one or more sample images in the dataset The 2D box and class label of TrafficLight_Red/Yellow/Green/Black are marked on one or more sample images in the dataset, and the 2D box and class label of TrafficLight_Red/Yellow/Green/Black are marked for task3, and so on. In this way, each sample image has annotated data for at least one task.
- the sample image includes annotation information of all objects of interest. That is, all objects of interest are annotated in each sample image.
- the object of interest is the object to be detected in the eight categories in Table 1.
- each type of annotation data only needs to annotate a specific type of object. That is, the labeled data of each sample image may be partial labeled data.
- class labels and 2D boxes of objects to be detected in multiple tasks can also be labeled on each sample image, that is, to provide mixed labeled data.
- the training data can be used to train the required training part of the perceptual network corresponding to the two tasks at the same time.
- a task label may be assigned to each sample image, and the task label may be used to indicate that the sample image is used to train the required training portion of the perceptual network.
- the labeled data of the sample image can be obtained in the above manner.
- the annotation data may be stored in an annotation file.
- the annotation file is the ground truth file.
- the sample images are inferred through other perceptual networks, and the inference results are obtained.
- Inference results include Pseudo Bboxes on sample images. Pseudo Bboxes can be used to complement objects to be detected belonging to other tasks that are not labeled in the labeled data of the sample image.
- the inference result may be stored in an inference result file.
- the inference result file is the Pseudo Bboxes file.
- Each sample image can correspond to an annotation file and an inference result file.
- the labeled 2D boxes in the labeled data of the sample image and the Pseudo Bboxes can be combined to obtain the 2D boxes of the objects to be detected in all tasks on the sample image.
- the inference result also includes the confidence level of the category to which the second task object on the sample image belongs.
- a low threshold is used to filter the inference results. That is, inference results whose confidence is less than the first threshold are filtered out.
- the confidence levels corresponding to the Pseudo Bboxes used for training are all greater than or equal to the first threshold.
- the first threshold is 0.05.
- a perceptual network is trained based on partially labeled data and Pseudo Bboxes. Specifically, the method 1300 includes steps S1310 to S1350.
- the training data is input into the perception network, and the training data includes a sample image, annotated data of the first task object on the sample image, and a pseudo frame of the second task object on the sample image.
- Step S1310 corresponds to step S1210 in the method 1200.
- Step S1210 corresponds to step S1210 in the method 1200.
- Step S1210 corresponds to step S1210 in the method 1200.
- the structure of the perceptual network used in the training process is shown in Figure 14.
- the perceptual network includes: backbone, RPN, region of interest extraction module and first RCNN.
- the sensory network shown in FIG. 14 can be regarded as a specific implementation of the sensory network shown in FIG. 10 .
- the perceptual network in Figure 14 can simultaneously complete the object detection of the 8 categories in Table 1.
- the perceptual network in Figure 14 can simultaneously complete the target detection of the eight tasks in Table 1.
- the 8 sub-classifications fc and the sub-regression fc in the first RCNN in Figure 14 simultaneously complete the 2D object detection of the 8 categories in Table 1.
- the perceptual network of the present application can flexibly add or delete the classification fc and regression fc in the first RCNN according to the needs of the business, so as to train to obtain target detection that can achieve different numbers of tasks perception network.
- the labeled data of the sample image includes the labeled 2D box and the class label of the first task object.
- the Pseudo Bboxes on the sample image include the Pseudo Bboxes of the second task object.
- Step S1320 includes: using the labeled 2D box of the first task object and the Pseudo Bboxes of the second task object to calculate the loss in the RPN stage, that is, the first loss function value.
- Step S1320 corresponds to step S1221 in the method 1200. For details, please refer to step S1221.
- the sample image may belong to one or more tasks according to the data type it is annotated. In other words, the sample image may belong to one or more tasks according to the task corresponding to the first task object. For example, if a sample image is only marked with traffic signs, the sample image only belongs to the task of traffic signs. If a sample image is marked with people and cars at the same time, then the sample image belongs to the two tasks of people and cars.
- the loss of the classification and regression network stage only the loss of the part corresponding to the task to which the current sample image belongs is calculated, and the loss of other tasks is not calculated. For example, if the currently input sample image belongs to the task of people and cars, only the loss of the part corresponding to the person and the car is calculated, and the loss of the part corresponding to the other tasks (such as traffic lights and traffic signs) is not calculated.
- the region of interest extraction module deducts features from a feature map according to the candidate 2D frame predicted by RPN, and enters the sub-classification fc and sub-regression corresponding to the task of the sample image after shared fc and shared conv In fc, the prediction result is obtained, that is, the confidence that the candidate 2D frame belongs to the object category in the task, and the target 2D frame. Then, compare the labeled data with the prediction result to obtain the loss, which is the loss in the classification and regression network stage corresponding to the task.
- the labeled data of the current sample image only includes the labeled data of one task
- the sample image is input to the network for training, for the multiple sub-classification fc and sub-regression fc in the first RCNN, only the task in the first RCNN is trained.
- the corresponding subclassification fc and subregression fc do not affect the subclassification fc and subregression fc corresponding to other tasks in the first RCNN.
- Regression fc obtains the prediction result of the traffic light in the sample image, and compares it with the true value to obtain the loss value. That is to say, the sample image of the traffic light only passes through the backbone, RPN, region of interest extraction module, and the sub-classification fc and sub-regression fc corresponding to the traffic light in the first RCNN, and the sub-classification fc and sub-regression fc corresponding to other tasks are not involved. Calculation of loss value.
- the labeled data of the current sample image includes the labeled data of multiple tasks
- the sample image is input to the network for training, for the multiple sub-classification fc and sub-regression fc in the first RCNN, only the multiple sub-classification fc and sub-regression fc in the first RCNN are trained
- the subclassification fc and subregression fc corresponding to each task do not affect the subclassification fc and subregression fc corresponding to other tasks in the first RCNN.
- the task of the traffic light is task 3
- the task of people is task 1.
- the prediction results of the traffic lights in the sample image are obtained through the sub-classification fc and sub-regression fc corresponding to task 3
- the prediction results of the people in the sample image are obtained through the sub-classification fc and sub-regression fc corresponding to task 1
- the The true values are compared to obtain the loss values corresponding to the two tasks.
- the sample image only passes through the backbone, RPN, region of interest extraction module, sub-classification fc and sub-regression fc corresponding to task3 in the first RCNN, and sub-classification fc and sub-regression fc corresponding to task1 in the first RCNN.
- the sub-classification fc and sub-regression fc corresponding to other tasks do not participate in the calculation of the loss value. In this way, the losses of the classification and regression stages corresponding to the two tasks will be obtained, and the overall loss value of the classification and regression stages can be the average of the multiple losses.
- the gradient of the relevant parameters is calculated, and the gradient is returned.
- the part that needs to be trained in the perceptual network is subjected to gradient backhaul.
- the part of the perception network that needs to be trained is determined according to the task to which the sample image belongs, and the part not corresponding to the task to which the sample image belongs does not participate in the gradient backhaul.
- the gradient is passed back along the sub-class fc and sub-regression fc corresponding to the task to which the sample image belongs, without affecting the sub-class fc and sub-regression fc corresponding to other tasks, the shared fc or conv of the first RCNN and the RPN and Backbone participates in gradient return.
- the weight parameters of the part of the perceptual network that need to be trained in the perceptual network are updated using the back-passed gradients.
- the part corresponding to the task to which the sample image belongs in the perceptual network can be adjusted in a targeted manner, so that the part corresponding to the task to which the sample image belongs can better learn the task to which the sample image belongs.
- step S1310 If the perception network does not converge, go to step S1310 to continue the training process.
- the labeling data of the sample images in the embodiments of the present application may be partial labeling data, so that targeted collection can be performed, that is, the required sample images are collected for specific tasks without labeling all objects of interest in each picture. processing, reducing the cost of data collection and labeling.
- the method of preparing training data by using partial labeling data has very flexible scalability. In the case of adding detection tasks, only the part corresponding to the detection task needs to be added to the classification and regression network.
- adding the corresponding part of the detection task The sub-classification fc and sub-regression fc of the sub-category fc and sub-regression fc are provided, and the sample image with the annotation data of the newly added object can be provided, and the newly added object to be detected is not required to be marked on the basis of the original training data.
- the pseudo-frames are used to supplement the unlabeled objects to be detected in the sample images, so as to avoid that when the RPN is trained based on the partial labeled data, the partial labeled data of different tasks will suppress each other, which will affect the training of the RPN, and is conducive to the prediction of the RPN.
- the area where the object to be detected is located in all tasks that need to be detected.
- the part corresponding to each task in the perception network only detects the object to be detected in the task, and during the training process, it can avoid accidental injury to objects of other tasks that are not labeled.
- the shared parts in the perception network such as backbone, RPN, region of interest extraction module, etc., learn the common features of each task, while the parts corresponding to each task in the classification and regression network learn task-specific features, for example, the first The sub-classification fc and sub-regression fc corresponding to each task in an RCNN learn its task-specific features.
- This embodiment of the present application further provides an object recognition method 1500, and the method 1500 can be executed by an object recognition apparatus.
- the object recognition device may be a cloud service device or a terminal device, for example, a vehicle, drone, robot, computer, server or mobile phone and other devices with sufficient computing power to execute the object recognition method, or a cloud service device.
- a system consisting of equipment and terminal equipment.
- the method 1500 may be executed by the execution device 110 in FIG. 3 , the neural network processor 50 in FIG. 5 , or the execution device 310 in FIG. 6 , or a local device.
- the object recognition method may be specifically executed by the execution device 110 shown in FIG. 3 .
- the object recognition method may be processed by the GPU, or may be jointly processed by the CPU and the GPU, or other processors suitable for neural network computing may be used without using the GPU, which is not limited in this application.
- the perceptual network in the embodiment of the present application is used to process the image.
- the repeated description is appropriately omitted when introducing the method 1500 below.
- the method 1500 includes steps S1510 to S1540, which are described below.
- the perception network includes backbone network, RPN, region of interest extraction module and classification regression network.
- the input image may be an image captured by a terminal device (or other device or device such as a computer, server, etc.) through a camera, or the input image may also be an image obtained from the terminal device (or other device or device such as a computer, server, etc.)
- the obtained image for example, an image stored in an album of the terminal device, or an image obtained by the terminal device from the cloud
- the target object includes objects to be detected in multiple tasks, each task in the multiple tasks includes at least one category, and the first The second feature map is determined according to the first feature map.
- S1540 Use a classification and regression network to process the first feature information to obtain a target 2D frame and first indication information of the target object, where the number of target 2D frames is less than or equal to the number of candidate 2D frames, and the first indication information is used to indicate the target object the category to which it belongs.
- using a classification and regression network to process the first feature information to obtain the target 2D frame of the target object and the first indication information including: using a classification and regression network to process the first feature information to obtain a candidate 2D frame belonging to multiple The confidence of each category in the task; use the classification and regression network to adjust the position information of the candidate 2D frame to obtain the adjusted candidate 2D frame; determine the target 2D frame according to the adjusted candidate 2D frame; according to the target 2D frame belongs to each category The confidence of determining the first indication information.
- the classification and regression network includes a first regional convolutional neural network RCNN
- the first RCNN includes a hidden layer, multiple sub-category fully connected layers and multiple sub-regression fully connected layers
- the hidden layer is connected to the multiple sub-category fully connected layers
- the hidden layer is The layer is connected with multiple sub-regression fully-connected layers
- the multiple sub-classification fully-connected layers are in one-to-one correspondence with multiple tasks
- the multiple sub-regression fully-connected layers are in one-to-one correspondence with multiple tasks
- the classification and regression network is used to process the first feature information.
- outputting the target 2D frame of the target object and the first indication information including: using the hidden layer to process the first feature information to obtain the second feature information; using the sub-classification fully connected layer to obtain the candidate 2D frame belonging to the sub-class according to the second feature information. Classify the confidence of the object category in the task corresponding to the fully connected layer; use the sub-regression fully connected layer to adjust the position information of the candidate 2D frame according to the second feature information, and obtain the adjusted candidate 2D frame.
- the classification and regression network includes a second RCNN
- the second RCNN includes a hidden layer, a classification fully connected layer and a regression fully connected layer, the hidden layer is connected to the classification fully connected layer, and the hidden layer is connected to the regression fully connected layer
- the regression network processes the first feature information, and outputs the target 2D frame of the target object and the first indication information, including: using the hidden layer to process the first feature information to obtain third feature information;
- the feature information obtains the confidence that the candidate 2D frame belongs to each category; the position information of the candidate 2D frame is adjusted according to the third feature information by using the regression fully connected layer, and the adjusted candidate 2D frame is obtained.
- the classification fully connected layer is obtained by merging multiple sub-classification fully connected layers in the first RCNN
- the regression fully connected layer is obtained by merging multiple sub-regression fully connected layers in the first RCNN
- the first RCNN includes a hidden layer, multiple sub-category fully-connected layers, and multiple sub-regression fully-connected layers.
- the hidden layer is connected to multiple sub-category fully-connected layers, the hidden layer is connected to multiple sub-regression fully-connected layers, and the multiple sub-category fully-connected layers are connected to Multiple tasks are in one-to-one correspondence, and multiple sub-regression fully-connected layers are in one-to-one correspondence with multiple tasks;
- the sub-classification fully-connected layer is used to obtain the object category of the candidate 2D frame belonging to the task corresponding to the sub-classification fully-connected layer according to the third feature information.
- the confidence of the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the third feature information, and obtain the adjusted candidate 2D frame.
- FIG. 16 shows the processing flow of the object recognition method provided by the embodiment of the present application.
- the processing flow in FIG. 16 can be regarded as a specific implementation of the method shown in FIG. 15 , and the method in FIG.
- the perceptual network shown in the figure is executed.
- the structure of the perception network adopted in this embodiment of the present application is shown in FIG. 17 .
- the perceptual network includes: backbone, RPN, region of interest extraction module and second RCNN.
- the sensory network shown in FIG. 17 can be regarded as a specific implementation of the sensory network shown in FIG. 11 .
- the perceptual network in Figure 17 can simultaneously complete the object detection of the 8 categories in Table 1. In other words, the perceptual network in Figure 17 can simultaneously complete the target detection of the 8 tasks in Table 1.
- the sensory network shown in FIG. 17 may be determined according to the sensory network shown in FIG. 14 . For example, as shown in FIG.
- the classification fc in the second RCNN is obtained by merging multiple sub-classifications fc in the first RCNN, and the regression fc in the second RCNN is obtained after merging the sub-regression fc in the first RCNN.
- the perceptual network of the present application can flexibly add or delete the sub-classification fc and sub-regression fc in the first RCNN according to the needs of the business, so as to achieve target detection of different numbers of tasks.
- the method 1600 includes steps S1610 to S1650.
- step S1620 may be performed by the backbone in FIG. 17 .
- the backbone performs convolution processing on the input image to generate several feature maps of different scales, that is, the first feature map.
- the backbone can adopt various forms of convolutional networks, such as VGG16, Resnet50, or Inception-Net, etc.
- step S1620 may further include: performing feature fusion based on the first feature map, and outputting the fused feature map.
- the feature maps output by the backbone network or FPN can be provided as basic features to subsequent modules.
- step S1630 may be performed by the RPN in FIG. 17 .
- the RPN predicts the region where the target object is located on the second feature map, and outputs a candidate 2D frame matching the region where the target object is located.
- the target object includes objects to be detected in multiple tasks.
- the second feature map may include the feature map output by the backbone network or FPN.
- RPN predicts areas where target objects may exist based on the feature map provided by backbone or FPN, and outputs candidate frames of these areas, or the coordinates of candidate areas (proposal).
- the RPN can predict that there may be candidate frames of objects to be detected in the eight categories in Table 1.
- step S1640 may be performed by the region of interest extraction module in FIG. 17 .
- the region of interest extraction module extracts the features of the region where the candidate 2D frame is located on the third feature map.
- the third feature map can be a feature map provided by backbone or FPN.
- the region of interest extraction module extracts the features of the region where each proposal is located on a feature map provided by the backbone or FPN according to the coordinates of the proposal provided by the RPN, and resize to a fixed size to obtain the value of each proposal. feature.
- step S1650 may be performed by the second RCNN in FIG. 17 .
- the hidden layer in the second RCNN for example, shared fc/conv, further performs feature extraction on the features of each proposal extracted by the region of interest extraction module, and sends them to cls fc and reg fc.
- Classify the proposal to obtain the confidence that each proposal belongs to each category, adjust the coordinates of the 2D frame of the proposal by reg fc to obtain a more compact 2D frame coordinate, and then perform the frame sum operation, such as the NMS operation to merge and adjust After the 2D box, output the target 2D box and the classification result.
- the classification result can be used as the first indication information.
- the weights of the classification fc in the second RCNN in FIG. 17 are obtained by combining the weights of multiple sub-classifications fc of the first RCNN in FIG. 16 .
- the weights of the regression fc in the second RCNN in FIG. 17 are obtained by combining the weights of the multiple sub-regression fcs of the first RCNN in FIG. 16 .
- the first RCNN in Figure 16 uses the sigmoid function to normalize the label logits obtained by the sub-category fc to obtain the confidence of each category, which is equivalent to performing a second classification for each category Processing, the confidence of the current category has no relationship with other categories, so during inference, the sub-categories fc of all tasks of the model can be combined into one category fc. The sub-regressions fc can also be combined into one regression fc.
- the candidate 2D frame is a rectangular frame
- the position information of the candidate 2D frame is represented by 4 values
- the length of the feature output by the hidden layer is 1024
- the number of categories in each task is n
- the number of categories in each task is n.
- the weight of the sub-regression fc is a tensor of 1024*4n
- the weight of the sub-category fc in each task is a tensor of 1024*n.
- the weight of the regression fc formed after merging is the tensor of 1024*124
- the weight of the classification fc is the tensor of 1024*31.
- the second RCNN obtained after merging only includes one classification fc and one regression fc, and its input and output are consistent with the tensor shape of the combined weight, that is, the input of classification fc and regression fc is 1024, the output of classification fc is 31, and the output of regression fc is 124.
- Table 2 shows the parameter amount and calculation amount of 8 tasks implemented by the single-head multi-task network in the embodiment of the present application and the existing multi-head multi-task network when the input image size is 720*1280 (@720p). registration. That is, Table 2 shows the parameter amount and calculation amount of the 8-task single-head-end task network and the multi-head-end multi-task network.
- Table 3 shows the comparison of inference time consumption between the single-head multi-task network in the embodiment of the present application and the existing multi-head multi-task network.
- the single-head-end multi-task network of the embodiment of the present application reduces the latency by 17% and 22% on images with resolutions of 720p and 1080p, respectively, which is significantly The processing efficiency is improved, which is conducive to deployment in scenarios with high real-time requirements.
- the single-head multitasking network in the embodiment of the present application can achieve the same detection performance as the multi-heading multitasking network.
- Table 4 shows the performance comparison of the single-head-end multi-task network and the multi-head-end multi-task network on some categories.
- AP category Multi-Head End Multitasking Network
- AP Single-end multitasking network
- the average precision (average precision, AP) of the single-head multi-task network in the embodiment of the present application and the existing multi-head multi-task network is not much different, that is, the performance of the two is comparable. It can be seen from this that the single-end multitasking network in the embodiment of the present application can save the amount of computation and memory on the premise of ensuring the performance of the model.
- FIG. 19 is a schematic block diagram of an apparatus according to an embodiment of the present application.
- the apparatus 4000 shown in FIG. 19 includes an acquisition unit 4010 and a processing unit 4020 .
- the apparatus 4000 may be used as a training apparatus for a perceptual network, and the acquiring unit 4010 and the processing unit 4020 may be used to perform the training method of the perceptual network of the embodiments of the present application, for example, may be used to perform the method 1200 or Method 1300.
- the perception network includes a candidate region generation network RPN, and the RPN is used to predict the position information of the candidate two-dimensional 2D frame of the target object in the sample image.
- the target object includes objects to be detected for multiple tasks. Each task includes at least one category, and the target objects include a first task object and a second task object.
- the obtaining unit 4010 is used to obtain training data, the training data includes the sample image, the labeling data of the first task object on the sample image, and the pseudo frame of the second task object on the sample image, and the labeling data includes the class label of the first task object and
- the labeled 2D frame of the first task object, and the pseudo frame of the second task object is the target 2D frame of the second task object obtained by inferring the sample image through other perceptual networks.
- the processing unit 4020 is configured to train the perception network based on the training data.
- the perception network further includes a backbone network, a region of interest extraction module, and a classification and regression network
- the processing unit 4020 is specifically configured to: according to the marked 2D frame of the first task object and the target 2D of the second task object.
- the difference between the frame and the candidate 2D frame of the target object in the sample image predicted by RPN calculates the first loss function value; calculates the second loss function value of the perceptual network according to the labeled data;
- the function value is back-propagated, and the parameters of the part to be trained in the perception network are adjusted.
- the part to be trained in the perception network includes the part to be trained in the classification and regression network, the region of interest extraction module, the RPN and the backbone network, and the classification
- the part of the regression network that needs to be trained is determined according to the first task object.
- the backbone network is used to perform convolution processing on the sample image and output the first feature map of the sample image;
- RPN is used to output the position of the candidate 2D frame of the target object based on the second feature map.
- the second feature map is determined according to the first feature map;
- the region of interest extraction module is used to extract the first feature information on the third feature map based on the position information of the candidate 2D frame, and the first feature information is the candidate 2D frame
- the feature of the area, the third feature map is determined according to the first feature map;
- the classification and regression network is used to process the first feature information, output the target 2D frame of the target object and the first indication information, the target 2D of the target object
- the number of boxes is less than or equal to the number of candidate 2D boxes of the target object, and the first indication information is used to indicate the category to which the target object belongs.
- the classification and regression network includes a first regional convolutional neural network RCNN, the first RCNN includes a hidden layer, multiple sub-classification fully connected layers and multiple sub-regression fully connected layers, and the hidden layer and multiple sub-classification fully connected layers.
- connection layer is connected, the hidden layer is connected with multiple sub-regression fully-connected layers, multiple sub-classification fully-connected layers are in one-to-one correspondence with multiple tasks, and multiple sub-regression fully-connected layers are in one-to-one correspondence with multiple tasks;
- One feature information is processed to obtain second feature information;
- the sub-classification fully connected layer is used to obtain the confidence level of the object category in the task corresponding to the sub-classification fully connected layer according to the second feature information;
- the sub-regression fully connected layer It is used to adjust the position information of the candidate 2D frame according to the result of the hidden layer processing to obtain the adjusted candidate 2D frame; and the part to be trained in the classification and regression network includes the hidden layer and the task corresponding to the first task object.
- the sub-classification fully connected layer and the sub-regression fully connected layer is used to obtain the confidence level of the object category in the task corresponding to the sub-classification fully connected layer according to the second feature information;
- the sub-regression fully connected layer It is used to adjust
- the device 4000 may function as an object recognition device.
- the object recognition apparatus includes an acquisition unit 4010 and a processing unit 4020 .
- the perception network includes: backbone network, candidate region generation network, region of interest extraction module and classification regression network.
- the acquiring unit 4010 and the processing unit 4020 may be used to execute the object recognition method of the embodiments of the present application, for example, may be used to execute the method 1500 or the method 1600 .
- the acquisition unit 4010 is used to acquire an input image.
- the processing unit 4020 is configured to use the backbone network to perform convolution processing on the input image to obtain the first feature map of the input image; use the RPN to output the position information of the candidate two-dimensional 2D frame of the target object based on the second feature map, and the target object includes a plurality of The object to be detected in the task, each task in the multiple tasks includes at least one category, and the second feature map is determined according to the first feature map; the region of interest extraction module is used based on the position information of the candidate 2D frame.
- Extract the first feature information from the feature map the first feature information is the feature of the area where the candidate 2D frame is located, and the third feature map is determined according to the first feature map; use the classification and regression network to process the first feature information to obtain the target object
- the target 2D frame of the target object and the first indication information the number of target 2D frames of the target object is less than or equal to the number of candidate 2D frames of the target object, and the first indication information is used to indicate the category to which the target object belongs.
- the processing unit 4020 is specifically configured to: use a classification and regression network to process the first feature information to obtain the confidence that the candidate 2D frame belongs to each category in multiple tasks;
- the position information of the 2D frame is adjusted to obtain an adjusted candidate 2D frame;
- the target 2D frame is determined according to the adjusted candidate 2D frame;
- the first indication information is determined according to the confidence that the target 2D frame belongs to each category.
- the classification and regression network includes a first regional convolutional neural network RCNN, the first RCNN includes a hidden layer, multiple sub-classification fully connected layers and multiple sub-regression fully connected layers, and the hidden layer and multiple sub-classification fully connected layers.
- connection layer is connected, the hidden layer is connected with multiple sub-regression fully-connected layers, the multiple sub-classification fully-connected layers are in one-to-one correspondence with multiple tasks, and the multiple sub-regression fully-connected layers are in one-to-one correspondence with multiple tasks; and the processing unit is specifically used for: Use the hidden layer to process the first feature information to obtain the second feature information; use the sub-classification fully connected layer to obtain the confidence level of the object category in the task corresponding to the sub-classification fully connected layer by using the sub-classification fully connected layer; use The sub-regression fully connected layer adjusts the position information of the candidate 2D frame according to the second feature information, and obtains the adjusted candidate 2D frame.
- the classification and regression network includes a second RCNN
- the second RCNN includes a hidden layer, a classification fully connected layer, and a regression fully connected layer
- the hidden layer is connected to the classification fully connected layer
- the hidden layer is connected to the regression fully connected layer.
- the processing unit 4020 is specifically used for: using the hidden layer to process the first feature information to obtain the third feature information; using the classification fully connected layer to obtain the confidence that the candidate 2D frame belongs to each category according to the third feature information obtained ; Use the regression fully connected layer to adjust the position information of the candidate 2D frame according to the obtained third feature information, and obtain the adjusted candidate 2D frame.
- the classification fully connected layer is obtained by merging multiple sub-classification fully connected layers in the first RCNN, and the regression fully connected layer is obtained by combining multiple sub-regression fully connected layers in the first RCNN.
- the first RCNN includes a hidden layer, multiple sub-classification fully connected layers and multiple sub-regression fully connected layers, the hidden layer is connected with multiple sub-classification fully connected layers, the hidden layer is connected with multiple sub-regression fully connected layers, and multiple sub-regression fully connected layers.
- the classification fully connected layer corresponds to multiple tasks one-to-one, and multiple sub-regression fully connected layers correspond to multiple tasks one-to-one;
- the sub-classification fully connected layer is used to obtain the candidate 2D frame according to the obtained third feature information, which belongs to the sub-classification fully connected layer.
- the confidence of the object category in the task; the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the obtained third feature information, and obtain the adjusted candidate 2D frame.
- apparatus 4000 is embodied in the form of functional units.
- unit here can be implemented in the form of software and/or hardware, which is not specifically limited.
- a "unit” may be a software program, a hardware circuit, or a combination of the two that realizes the above-mentioned functions.
- the hardware circuits may include application specific integrated circuits (ASICs), electronic circuits, processors for executing one or more software or firmware programs (eg, shared processors, proprietary processors, or group processors) etc.) and memory, merge logic and/or other suitable components to support the described functions.
- ASICs application specific integrated circuits
- processors for executing one or more software or firmware programs eg, shared processors, proprietary processors, or group processors
- the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
- FIG. 20 is a schematic diagram of a hardware structure of an apparatus provided by an embodiment of the present application.
- the apparatus 6000 shown in FIG. 20 (the apparatus 6000 may specifically be a computer device) includes a memory 6001 , a processor 6002 , a communication interface 6003 and a bus 6004 .
- the memory 6001 , the processor 6002 , and the communication interface 6003 are connected to each other through the bus 6004 for communication.
- the apparatus 6000 may serve as a training apparatus for a perceptual network.
- the memory 6001 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).
- the memory 6001 may store a program, and when the program stored in the memory 6001 is executed by the processor 6002, the processor 6002 is configured to execute each step of the method for training a perceptual network according to the embodiment of the present application. Specifically, the processor 6002 may perform step S1220 in the method shown in FIG. 12 above.
- the processor 6002 may adopt a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processor (graphics processing unit, GPU), or one or more
- the integrated circuit is used to execute the relevant program to realize the training method of the perceptual network according to the method embodiment of the present application.
- the processor 6002 may also be an integrated circuit chip with signal processing capability, for example, the chip shown in FIG. 5 .
- each step of the training method of the perceptual network of the present application can be completed by the hardware integrated logic circuit in the processor 6002 or the instructions in the form of software.
- the above-mentioned processor 6002 can also be a general-purpose processor, a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, Discrete gate or transistor logic devices, discrete hardware components.
- DSP digital signal processing
- ASIC application specific integrated circuit
- FPGA field programmable gate array
- a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
- the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
- the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
- the storage medium is located in the memory 6001, and the processor 6002 reads the information in the memory 6001 and, in combination with its hardware, completes the functions required to be performed by the units included in the training device in the embodiments of the present application, or executes the diagrams in the method embodiments of the present application. 12 shows the training method of the perceptual network.
- the communication interface 6003 uses a transceiver device such as but not limited to a transceiver to implement communication between the device 6000 and other devices or a communication network. For example, training data can be obtained through the communication interface 6003 .
- the bus 6004 may include a pathway for communicating information between the various components of the device 6000 (eg, the memory 6001, the processor 6002, the communication interface 6003).
- the device 6000 may function as an object recognition device.
- the memory 6001 may be ROM, static storage device and RAM.
- the memory 6001 may store a program.
- the processor 6002 and the communication interface 6003 are used to execute each step of the object recognition method of the embodiment of the present application.
- the processor 6002 may perform steps S1520 to S1540 in the method shown in FIG. 15 above.
- the processor 6002 may adopt a general-purpose CPU, a microprocessor, an ASIC, a GPU, or one or more integrated circuits, and is used to execute a related program, so as to realize the functions required to be performed by the unit in the object recognition apparatus of the embodiment of the present application, Or execute the object recognition method of the method embodiment of the present application.
- the processor 6002 may also be an integrated circuit chip with signal processing capability, for example, the chip shown in FIG. 6 .
- each step of the object recognition method of the embodiment of the present application may be completed by an integrated logic circuit of hardware in the processor 6002 or an instruction in the form of software.
- the above-mentioned processor 6002 may also be a general-purpose processor, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
- the methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed.
- a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
- the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
- the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
- the storage medium is located in the memory 6001, and the processor 6002 reads the information in the memory 6001, and combines its hardware to complete the functions required to be performed by the units included in the object recognition device of the embodiment of the present application, or to perform the object recognition of the method embodiment of the present application. method.
- the communication interface 6003 uses a transceiver device such as but not limited to a transceiver to implement communication between the device 6000 and other devices or a communication network.
- a transceiver device such as but not limited to a transceiver to implement communication between the device 6000 and other devices or a communication network.
- the data to be processed can be acquired through the communication interface 6003 .
- the bus 6004 may include a pathway for communicating information between the various components of the device 6000 (eg, the memory 6001, the processor 6002, the communication interface 6003).
- the apparatus 6000 may also include other devices necessary for normal operation. Meanwhile, according to specific needs, those skilled in the art should understand that the apparatus 6000 may further include hardware devices that implement other additional functions. In addition, those skilled in the art should understand that the apparatus 6000 may only include the necessary devices for implementing the embodiments of the present application, and does not necessarily include all the devices shown in FIG. 20 .
- An embodiment of the present application provides a computer-readable medium, where the computer-readable medium stores program code executed by a device, where the program code includes relevant content for executing the object recognition method shown in FIG. 15 or FIG. 16 .
- An embodiment of the present application provides a computer-readable medium, where the computer-readable medium stores program code executed by a device, where the program code includes relevant content for executing the training method shown in FIG. 12 or FIG. 13 .
- An embodiment of the present application provides a computer program product, which, when the computer program product runs on a computer, enables the computer to execute the relevant content of the object recognition method shown in FIG. 15 or FIG. 16 .
- An embodiment of the present application provides a computer program product, which, when the computer program product runs on a computer, enables the computer to execute the relevant content of the training method shown in FIG. 12 or FIG. 13 .
- An embodiment of the present application provides a chip, where the chip includes a processor and a data interface, the processor reads an instruction on a memory through the data interface, and executes the object recognition method as shown in FIG. 15 or FIG. 16 .
- An embodiment of the present application provides a chip, where the chip includes a processor and a data interface, the processor reads an instruction on a memory through the data interface, and executes the training method as shown in FIG. 12 or FIG. 13 .
- the chip may further include a memory, in which instructions are stored, the processor is configured to execute the instructions stored in the memory, and when the instructions are executed, the The processor is configured to execute the object recognition method of FIG. 15 or FIG. 16 or the training method of FIG. 12 or FIG. 13 .
- the processor in the embodiment of the present application may be a central processing unit (central processing unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (digital signal processors, DSP), application-specific integrated circuits (application specific integrated circuit, ASIC), off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
- a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
- the memory in the embodiments of the present application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
- the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
- Volatile memory may be random access memory (RAM), which acts as an external cache.
- RAM random access memory
- SRAM static random access memory
- DRAM dynamic random access memory
- DRAM synchronous dynamic random access memory
- SDRAM synchronous dynamic random access memory
- DDR SDRAM double data rate synchronous dynamic random access memory
- enhanced SDRAM enhanced synchronous dynamic random access memory
- SLDRAM synchronous connection dynamic random access memory Fetch memory
- direct memory bus random access memory direct rambus RAM, DR RAM
- the above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination.
- the above-described embodiments may be implemented in whole or in part in the form of a computer program product.
- the computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
- the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
- the computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server or data center by wire (eg, infrared, wireless, microwave, etc.).
- the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that contains one or more sets of available media.
- the usable media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media.
- the semiconductor medium may be a solid state drive.
- At least one means one or more, and “plurality” means two or more.
- At least one item(s) below” or similar expressions thereof refer to any combination of these items, including any combination of single item(s) or plural items(s).
- at least one item (a) of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c may be single or multiple .
- the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the embodiments of the present application. implementation constitutes any limitation.
- the disclosed system, apparatus and method may be implemented in other manners.
- the apparatus embodiments described above are only illustrative.
- the division of the units is only a logical function division. In actual implementation, there may be other division methods.
- multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
- the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
- the functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
- the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution.
- the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
- the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Image Analysis (AREA)
Abstract
A cognitive network (800), a training method (1200) for a cognitive network, and an object recognition method (1500) and apparatus. The cognitive network (800) comprises a backbone network (810), a candidate region proposal network (RPN) (820), a region of interest extraction module (830), and a classification regression network (840). A plurality of cognitive tasks share the RPN (820), and one RPN (820) predicts the region in which an object to be detected in the plurality of tasks is located, and the classification regression network obtains a target 2D frame and a classification result. The cognitive network (800) can reduce the number of parameters and calculations in a multi-task cognitive network, reduce the power consumption of hardware, and improve the running speed of a model.
Description
本申请涉及计算机视觉领域,并且更具体地,涉及一种感知网络、感知网络的训练方法、物体识别方法及装置。The present application relates to the field of computer vision, and more particularly, to a perceptual network, a training method for a perceptual network, and an object recognition method and apparatus.
计算机视觉是各个应用领域,如制造业、检验、文档分析和医疗诊断等领域中各种智能/自主系统中不可分割的一部分。形象地说,计算机视觉就是给计算机安装上眼睛(照相机/摄像机)和大脑(算法),从而使计算机能够感知环境。计算机视觉用各种成象系统代替视觉器官获取输入信息,再由计算机来代替大脑对这些输入信息完成处理和解释。Computer vision is an integral part of various intelligent/autonomous systems in various application fields such as manufacturing, inspection, document analysis, and medical diagnostics. To put it figuratively, computer vision is to install eyes (cameras/cameras) and brains (algorithms) on computers, so that computers can perceive the environment. Computer vision uses various imaging systems to replace the visual organ to obtain input information, and then the computer replaces the brain to process and interpret the input information.
随着视觉感知技术的发展,以及实际场景的人工智能(artificial intelligence,AI)感知需求不断增加,越来越多的感知网络被广泛部署于各个领域。例如,高级驾驶辅助系统(advanced driving assistant system,ADAS)和自动驾驶系统(autonomous driving system,ADS)中部署的感知网络可以用于识别道路上的障碍物。目前的感知网络大多只能完成一种检测任务,若要实现多种检测任务,通常需要部署不同的网络来实现不同的检测任务。然而,多个感知网络同时运行会导致硬件的功耗增大,降低模型的运行速度。而且,很多领域中使用的芯片算力较低,难以部署大型的感知网络,更难以部署多个感知网络。With the development of visual perception technology and the increasing demand for artificial intelligence (AI) perception of actual scenes, more and more perception networks are widely deployed in various fields. For example, perception networks deployed in advanced driving assistance systems (ADAS) and autonomous driving systems (ADS) can be used to identify obstacles on the road. Most of the current perception networks can only complete one detection task. To achieve multiple detection tasks, it is usually necessary to deploy different networks to achieve different detection tasks. However, the simultaneous operation of multiple perception networks will increase the power consumption of the hardware and reduce the running speed of the model. Moreover, the computing power of chips used in many fields is low, making it difficult to deploy large-scale sensor networks, and even more difficult to deploy multiple sensor networks.
因此,如何降低多任务感知网络运行时的硬件功耗,成为一个亟待解决的问题。Therefore, how to reduce the hardware power consumption of the multi-task-aware network operation has become an urgent problem to be solved.
发明内容SUMMARY OF THE INVENTION
本申请提供一种感知网络、感知网络的训练方法、物体识别方法及装置,能够减少多任务感知网络中的参数量和计算量,降低硬件的功耗,提高模型的运行速度。The present application provides a perceptual network, a training method for a perceptual network, an object recognition method and a device, which can reduce the amount of parameters and calculations in a multi-task perceptual network, reduce the power consumption of hardware, and improve the running speed of the model.
第一方面,提供了一种感知网络,包括:主干网络、候选区域生成网络(region proposal network,RPN)、感兴趣区域提取模块和分类回归网络;RPN,用于基于第二特征图输出目标物体的候选二维(2 dementional,2D)框的位置信息,目标物体包括多个任务中的待检测的物体,多个任务中的每个任务包括至少一个类别,第二特征图是根据第一特征图确定的;感兴趣区域提取模块,用于基于候选2D框的位置信息在第三特征图上提取第一特征信息,第一特征信息为候选2D框所在区域的特征,第三特征图是根据第一特征图确定的;分类回归网络,用于对第一特征信息进行处理,输出目标物体的目标2D框以及第一指示信息,目标2D框的数量小于或等于候选2D框的数量,第一指示信息用于指示目标物体所属的类别。In a first aspect, a perception network is provided, including: a backbone network, a region proposal network (RPN), a region of interest extraction module, and a classification and regression network; the RPN is used to output a target object based on the second feature map The position information of the candidate two-dimensional (2 dementional, 2D) frame, the target object includes objects to be detected in multiple tasks, each task in the multiple tasks includes at least one category, and the second feature map is based on the first feature. The region of interest extraction module is used to extract the first feature information on the third feature map based on the position information of the candidate 2D frame, the first feature information is the feature of the region where the candidate 2D frame is located, and the third feature map is based on The first feature map is determined; the classification and regression network is used to process the first feature information, output the target 2D frame of the target object and the first indication information, the number of target 2D frames is less than or equal to the number of candidate 2D frames, the first The indication information is used to indicate the category to which the target object belongs.
根据本申请实施例的方案,利用一个感知网络完成多种感知任务,多个任务共享一个RPN,即由一个RPN预测多个任务中的待检测的物体所在的区域,在保证感知网络性能的同时,降低了感知网络的参数量和计算量,提高了处理效率,有利于部署于实时性要求较高的场景中,同时减小了硬件的压力,节约了成本。According to the solution of the embodiment of the present application, a sensing network is used to complete a variety of sensing tasks, and multiple tasks share one RPN, that is, one RPN predicts the area where the object to be detected in multiple tasks is located, while ensuring the performance of the sensing network. , which reduces the amount of parameters and calculation of the perception network, improves the processing efficiency, is conducive to deployment in scenarios with high real-time requirements, reduces the pressure on hardware, and saves costs.
“第一特征图”指的是由主干网络输出的特征图(feature map)。由主干网络输出的特征图均可以称为第一特征图。The "first feature map" refers to the feature map output by the backbone network. The feature maps output by the backbone network can all be referred to as first feature maps.
输入图像的第一特征图可以为一个,也可以为多个。There may be one or more first feature maps of the input image.
多种任务也可以理解为多个大类。一个大类中包括至少一个类别。或者说,一个大类为至少一个类别的集合。任务的划分标准可以根据需要设定。例如,根据需要检测的物体的相似性将需要检测的物体划分至多个任务中。Multiple tasks can also be understood as multiple categories. A broad category includes at least one category. In other words, a broad category is a collection of at least one category. Task division criteria can be set as needed. For example, the objects to be detected are divided into multiple tasks according to the similarity of the objects to be detected.
本申请实施例中的多个任务共用同一个RPN,该RPN也可以称为单头端多任务RPN。Multiple tasks in this embodiment of the present application share the same RPN, and the RPN may also be referred to as a single-head multi-task RPN.
第二特征图可以为一个,也可以为多个。The second feature map may be one or multiple.
示例性地,第二特征图可以包括第一特征图中的一个或多个。Illustratively, the second feature map may include one or more of the first feature map.
示例性地,第三特征图可以为第一特征图中的一个。Exemplarily, the third feature map may be one of the first feature maps.
结合第一方面,在第一方面的某些实现方式中,感知网络还包括特征金字塔网络(feature pyramid networks,FPN),FPN与主干网络相连,用于对第一特征图进行特征融合,输出融合后的特征图。In combination with the first aspect, in some implementations of the first aspect, the perception network further includes feature pyramid networks (FPN), and the FPN is connected to the backbone network for feature fusion on the first feature map and output fusion feature map after.
在该情况下,第二特征图可以包括融合后的特征图中的一个或多个。In this case, the second feature map may include one or more of the fused feature maps.
示例性地,第三特征图可以为第一特征图中的一个或FPN输出的融合后的特征图中的一个。Exemplarily, the third feature map may be one of the first feature maps or one of the fused feature maps output by the FPN.
根据本申请实施例的方案,采用FPN对第一特征图进行特征融合,能够生成更具有表达能力的特征图提供给之后的模块,进而提高模型的性能。According to the solution of the embodiment of the present application, by using FPN to perform feature fusion on the first feature map, a feature map with more expressive ability can be generated and provided to subsequent modules, thereby improving the performance of the model.
结合第一方面,在第一方面的某些实现方式中,分类回归网络具体用于:对第一特征信息进行处理,得到候选2D框属于多个任务中的各个类别的置信度;对候选2D框的位置信息进行调整,得到调整后的候选2D框;根据调整后的候选2D框确定目标2D框;根据目标2D框属于各个类别的置信度确定第一指示信息。With reference to the first aspect, in some implementations of the first aspect, the classification and regression network is specifically used to: process the first feature information to obtain the confidence that the candidate 2D frame belongs to each category in multiple tasks; The position information of the frame is adjusted to obtain an adjusted candidate 2D frame; the target 2D frame is determined according to the adjusted candidate 2D frame; the first indication information is determined according to the confidence that the target 2D frame belongs to each category.
示例性地,对候选2D框的位置信息进行调整,使得调整后的候选2D框比候选2D框与实际物体的形状更加匹配,即调整后的候选2D框为更紧致的候选2D框。Exemplarily, the position information of the candidate 2D frame is adjusted so that the adjusted candidate 2D frame matches the shape of the actual object more closely than the candidate 2D frame, that is, the adjusted candidate 2D frame is a more compact candidate 2D frame.
进一步地,对调整后的候选2D框进行框合并操作,得到目标2D框。例如,对调整后的2D框进行非极大值抑制(non maximum suppression,NMS)合并,得到目标2D框。Further, a frame merging operation is performed on the adjusted candidate 2D frame to obtain the target 2D frame. For example, the adjusted 2D boxes are merged with non-maximum suppression (NMS) to obtain the target 2D boxes.
结合第一方面,在第一方面的某些实现方式中,分类回归网络包括第一区域卷积神经网络(region convolutional neural networks,RCNN),第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,隐层与多个子分类全连接层相连,隐层与多个子回归全连接层相连,多个子分类全连接层与多个任务一一对应,多个子回归全连接层与多个任务一一对应;隐层,用于对第一特征信息进行处理,得到第二特征信息;子分类全连接层用于根据第二特征信息得到候选2D框属于子分类全连接层对应的任务中的物体类别的置信度;子回归全连接层用于根据第二特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。With reference to the first aspect, in some implementations of the first aspect, the classification and regression network includes a first region convolutional neural network (RCNN), and the first RCNN includes a hidden layer, a plurality of sub-classification fully connected layers and Multiple sub-regression fully-connected layers, the hidden layer is connected to multiple sub-classification fully-connected layers, the hidden layer is connected to multiple sub-regression fully-connected layers, multiple sub-classification fully-connected layers correspond to multiple tasks one-to-one, and multiple sub-regression fully connected layers are connected to Multiple tasks are in one-to-one correspondence; the hidden layer is used to process the first feature information to obtain the second feature information; the sub-category fully-connected layer is used to obtain the candidate 2D frame corresponding to the sub-category fully-connected layer according to the second feature information. The confidence of the object category in the task; the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the second feature information, and obtain the adjusted candidate 2D frame.
示例性地,隐层可以包括以下至少一种:卷积层或全连接层。由于多个任务共享隐层,隐层中的卷积层也可以称为共享卷积层(shared convolutional,shared conv),隐层中的全连接层也可以称为共享全连接层(shared fully connected layers,shared fc)。Exemplarily, the hidden layer may include at least one of the following: a convolutional layer or a fully connected layer. Since multiple tasks share the hidden layer, the convolutional layer in the hidden layer can also be called a shared convolutional layer (shared convolutional, shared conv), and the fully connected layer in the hidden layer can also be called a shared fully connected layer (shared fully connected layer). layers, shared fc).
第一RCNN包括隐层以及与多个任务对应的多个子分类全连接层和多个子回归全连接层。每个任务可以具有独立的一个子分类全连接层和子回归全连接层。每个任务对应的 子分类全连接层和子回归全连接层能够完成该任务中的待检测物体的检测,具体地,子分类全连接层能够输出候选2D框属于该任务中的物体类别的置信度,子回归全连接层能够输出调整后的候选2D框。The first RCNN includes hidden layers and multiple sub-classification fully connected layers and multiple sub-regression fully connected layers corresponding to multiple tasks. Each task can have an independent sub-classification fully-connected layer and sub-regression fully-connected layer. The sub-category fully-connected layer and the sub-regression fully-connected layer corresponding to each task can complete the detection of the object to be detected in the task. Specifically, the sub-category fully connected layer can output the confidence level that the candidate 2D frame belongs to the object category in the task , the sub-regression fully connected layer can output the adjusted candidate 2D box.
一个第一RCNN中包括多个子分类全连接层和子回归全连接层,因此,一个第一RCNN能够完成多个任务中的待检测的物体的检测。第一RCNN也可以称为单头端多任务RCNN。A first RCNN includes multiple sub-classification fully-connected layers and sub-regression fully-connected layers. Therefore, a first RCNN can complete the detection of objects to be detected in multiple tasks. The first RCNN can also be called a single-head multi-task RCNN.
根据本申请实施例的方案,多个任务共享第一RCNN的隐层,进一步减少了感知网络的参数量和计算量,提高了处理效率。而且,各个任务对应独立的子分类全连接层(fully connected layers,fc)和子回归fc,提高了感知网络的可扩展性,感知网络可以通过增加或减少子分类fc和子回归fc灵活地实现功能配置。According to the solution of the embodiment of the present application, multiple tasks share the hidden layer of the first RCNN, which further reduces the amount of parameters and computation of the perception network, and improves the processing efficiency. Moreover, each task corresponds to an independent sub-classification fully connected layer (fc) and sub-regression fc, which improves the scalability of the perception network. The perception network can flexibly implement functional configuration by adding or reducing sub-classification fc and sub-regression fc .
结合第一方面,在第一方面的某些实现方式中,分类回归网络包括第二RCNN,第二RCNN包括隐层、分类全连接层和回归全连接层,隐层与分类全连接层相连,隐层与回归全连接层相连;隐层,用于对第一特征信息进行处理,得到第三特征信息;分类全连接层,用于根据第三特征信息得到候选2D框属于各个类别的置信度;回归全连接层,用于根据第三特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。With reference to the first aspect, in some implementations of the first aspect, the classification and regression network includes a second RCNN, the second RCNN includes a hidden layer, a classification fully connected layer and a regression fully connected layer, and the hidden layer is connected with the classification fully connected layer, The hidden layer is connected to the regression fully connected layer; the hidden layer is used to process the first feature information to obtain the third feature information; the classification fully connected layer is used to obtain the confidence that the candidate 2D frame belongs to each category according to the third feature information ; The regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the third feature information to obtain the adjusted candidate 2D frame.
一个第二RCNN能够完成多个任务中的待检测的物体的检测。第二RCNN也可以称为单头端多任务RCNN。A second RCNN can complete the detection of objects to be detected in multiple tasks. The second RCNN can also be called a single-head multi-task RCNN.
在本申请实施例的方案中,采用第二RCNN作为分类回归网络,多个任务共享第二RCNN的隐层,进一步减少了感知网络的参数量和计算量,提高了处理效率。此外,第一RCNN中的隐层的输出结果需要输入到所有子分类全连接层和子回归全连接层中进行多次矩阵运算,而第二RCNN中的隐层的输出只需要输入到分类全连接层和回归全连接层中进行矩阵运算,这样,能够进一步减少矩阵运算的操作,对硬件更加友好,进一步减少了运算耗时,提高了处理效率。In the solution of the embodiment of the present application, the second RCNN is used as the classification and regression network, and multiple tasks share the hidden layer of the second RCNN, which further reduces the amount of parameters and calculation of the perception network, and improves the processing efficiency. In addition, the output of the hidden layer in the first RCNN needs to be input to all sub-classification fully connected layers and sub-regression fully connected layers for multiple matrix operations, while the output of the hidden layer in the second RCNN only needs to be input to the classification fully connected layer. The matrix operation is performed in the layer and the regression fully connected layer. In this way, the operation of the matrix operation can be further reduced, which is more friendly to the hardware, further reduces the time consumption of the operation, and improves the processing efficiency.
结合第一方面,在第一方面的某些实现方式中,分类全连接层是通过将第一RCNN中的多个子分类全连接层进行合并得到的,回归全连接层是通过将第一RCNN中的多个子回归全连接层进行合并得到的,第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,隐层与多个子分类全连接层相连,隐层与多个子回归全连接层相连,多个子分类全连接层与多个任务一一对应,多个子回归全连接层与多个任务一一对应;子分类全连接层用于根据第三特征信息得到候选2D框属于子分类全连接层对应的任务中的物体类别的置信度;子回归全连接层用于根据第三特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。In combination with the first aspect, in some implementations of the first aspect, the classification fully connected layer is obtained by merging multiple sub-classification fully connected layers in the first RCNN, and the regression fully connected layer is obtained by merging the first RCNN into the fully connected layer. The first RCNN includes a hidden layer, multiple sub-category fully-connected layers and multiple sub-regression fully-connected layers, the hidden layer is connected with multiple sub-category fully-connected layers, and the hidden layer is connected with multiple sub-regression layers. The fully-connected layers are connected, the sub-classification fully-connected layers are in one-to-one correspondence with multiple tasks, and the sub-regression fully-connected layers are in one-to-one correspondence with multiple tasks; the sub-classification fully connected layer is used to obtain the candidate 2D frame belonging to the The confidence of the object category in the task corresponding to the sub-classification fully connected layer; the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the third feature information to obtain the adjusted candidate 2D frame.
在本申请实施例的方案中,对第一RCNN中的多个子分类fc和子回归fc进行合并,采用第二RCNN作为分类回归网络,能够进一步减少矩阵运算的操作,对硬件更加友好,进一步减少了运算耗时,提高了处理效率。In the solution of the embodiment of the present application, multiple sub-classification fc and sub-regression fc in the first RCNN are combined, and the second RCNN is used as the classification and regression network, which can further reduce the operation of matrix operations, is more friendly to hardware, and further reduces the The operation is time-consuming and the processing efficiency is improved.
第二方面,提供了一种感知网络的训练方法,感知网络包括:候选区域生成网络RPN,RPN用于预测样本图像中的目标物体的候选二维2D框的位置信息,目标物体包括多个任务的待检测的物体,多个任务中的每个任务包括至少一个类别;目标物体包括第一任务物体和第二任务物体;方法包括:获取训练数据,训练数据包括样本图像、样本图像上的第一任务物体的标注数据以及样本图像上的第二任务物体的伪框,标注数据包括第一任务物 体的类标签和第一任务物体的标注2D框,第二任务物体的伪框是通过其他感知网络对样本图像进行推理得到的第二任务物体的目标2D框;基于训练数据对感知网络进行训练。In a second aspect, a training method for a perceptual network is provided. The perceptual network includes: a candidate region generation network RPN, where the RPN is used to predict the position information of a candidate two-dimensional 2D frame of a target object in a sample image, and the target object includes multiple tasks the object to be detected, each task in the multiple tasks includes at least one category; the target object includes a first task object and a second task object; the method includes: acquiring training data, the training data includes sample images, first task objects on the sample images Annotation data of a task object and a pseudo frame of the second task object on the sample image. The annotation data includes the class label of the first task object and the annotated 2D frame of the first task object. The pseudo frame of the second task object is obtained by other perception The target 2D frame of the second task object obtained by the network inferring the sample image; the perception network is trained based on the training data.
在标注数据为部分标注数据的情况下,即标注数据仅包括第一任务物体的标注数据的情况下,仅基于标注数据训练感知网络时,由于多个任务共用一个RPN,在训练RPN时,不同任务的训练数据可能会互相抑制。具体地,由于标注数据为部分标注数据,例如,一个样本图像上仅标注了一个任务的待检测物体的标注数据,那么在采用该任务的待检测的物体的标注数据进行训练时,会调整RPN的参数,以使RPN能够更准确地预测出该任务的待检测的物体的候选2D框,但无法准确预测该样本图像上其他任务的待检测的物体的候选2D框。在采用另一任务的待检测的物体的标注数据进行训练时,会调整该RPN的参数,这样,调整后的RPN可能无法准确预测出其他任务的待检测的物体的候选2D框。这样,不同的任务的训练数据可能会相互抑制,导致RPN无法预测出图像中所有的目标物体。In the case where the labeled data is partially labeled data, that is, when the labeled data only includes the labeled data of the first task object, when training the perception network based on the labeled data only, since multiple tasks share one RPN, when training the RPN, different The training data for tasks may inhibit each other. Specifically, since the labeled data is part of the labeled data, for example, only the labeled data of the object to be detected for one task is labeled on a sample image, when the labeled data of the object to be detected for the task is used for training, the RPN will be adjusted. , so that RPN can more accurately predict the candidate 2D frame of the object to be detected for this task, but cannot accurately predict the candidate 2D frame of the object to be detected for other tasks on the sample image. When using the labeled data of the object to be detected in another task for training, the parameters of the RPN will be adjusted, so the adjusted RPN may not be able to accurately predict the candidate 2D frame of the object to be detected in other tasks. In this way, the training data of different tasks may suppress each other, causing RPN to fail to predict all the target objects in the image.
根据本申请实施例中的方案,基于伪框和标注数据共同训练感知网络,在标注数据仅包括第一任务物体的标注数据的情况下,即部分标注数据的情况下,提供第二任务物体的伪框,以便在同一个样本图像上提供更全面的待检测的物体的框作为RPN的目标输出,以调整RPN的参数使得RPN的输出不断接近目标数据,避免不同任务之间相互抑制,有利于使RPN得到更全面更准确的候选2D框,同时提高召回率。本申请实施例中的样本图像的标注数据可以为部分标注数据,这样可以进行针对性采集,即针对具体任务采集所需样本图像,无需在每一个样本图像中标出所有任务的待检测的物体,降低了数据的采集成本以及标注成本,有利于均衡不同任务的训练数据。此外,采用部分标注数据的方案具有灵活的扩展性,在增加任务的情况下,只需要提供新增任务的标注数据即可,无需在原有的训练数据的基础上标注出新的待检测的物体。According to the solution in the embodiment of the present application, the perception network is jointly trained based on the pseudo frame and the labeled data, and in the case that the labeled data only includes the labeled data of the first task object, that is, in the case of partial labeled data, the information of the second task object is provided. Pseudo frame, in order to provide a more comprehensive frame of the object to be detected on the same sample image as the target output of the RPN, to adjust the parameters of the RPN so that the output of the RPN is constantly close to the target data, avoiding mutual inhibition between different tasks, which is beneficial to It enables RPN to obtain more comprehensive and accurate candidate 2D boxes, while improving the recall rate. The labeling data of the sample images in the embodiments of the present application may be partial labeling data, so that targeted collection can be performed, that is, the required sample images are collected for specific tasks, and there is no need to mark the objects to be detected for all tasks in each sample image. It reduces the cost of data collection and the cost of labeling, which is conducive to balancing the training data of different tasks. In addition, the scheme using part of the labeled data has flexible scalability. In the case of adding tasks, it is only necessary to provide the labeled data of the new tasks, and there is no need to label new objects to be detected on the basis of the original training data. .
第一任务物体可以包括一个或多个任务中的待检测的物体。该一个或多个任务即为第一任务物体所在的任务。训练集中的不同样本图像中的第一任务物体可以是相同的,也可以是不同的。The first task objects may include objects to be detected in one or more tasks. The one or more tasks are the tasks where the first task object is located. The first task objects in different sample images in the training set may be the same or different.
第二任务物体可以包括一个或多个任务中的待检测的物体。该一个或多个任务即为第二任务物体所在的任务。第二任务物体和第一任务物体中可能存在相同的待检测的物体。也就是说,第一任务物体和第二任务物体可以存在重合的待检测的物体,第一任务物体和第二任务物体也可以完全不同。训练集中的不同样本图像中的第二任务物体可以是相同的,也可以是不同的。The second task objects may include objects to be detected in one or more tasks. The one or more tasks are the tasks where the second task object is located. The same object to be detected may exist in the second task object and the first task object. That is to say, the first task object and the second task object may have overlapping objects to be detected, and the first task object and the second task object may also be completely different. The second task objects in different sample images in the training set can be the same or different.
其他感知网络指的是待训练的感知网络以外的其他感知网络。示例性地,其他感知网络可以为多头端多任务的感知网络或多个单任务的感知网络等。Other perceptual networks refer to other perceptual networks than the one to be trained. Exemplarily, the other sensing networks may be a multi-head multi-tasking sensing network or multiple single-tasking sensing networks, or the like.
结合第二方面,在第二方面的某些实现方式中,感知网络还包括主干网络、感兴趣区域提取模块和分类回归网络,基于训练数据对感知网络进行训练,包括:根据第一任务物体的标注2D框和第二任务物体的目标2D框与RPN预测得到的样本图像中的目标物体的候选2D框之间的差异计算第一损失函数值;根据标注数据计算感知网络的第二损失函数值;将第一损失函数值和第二损失函数值进行反向传播,调整感知网络中所需训练的部分的参数,感知网络中所需训练的部分包括分类回归网络中所需训练的部分、感兴趣区域提取模块、RPN和主干网络,分类回归网络中所需训练的部分是根据第一任务物体确定的。With reference to the second aspect, in some implementations of the second aspect, the perceptual network further includes a backbone network, a region of interest extraction module, and a classification and regression network, and the perceptual network is trained based on the training data, including: according to the first task object The difference between the marked 2D frame and the target 2D frame of the second task object and the candidate 2D frame of the target object in the sample image predicted by RPN calculates the first loss function value; calculates the second loss function value of the perception network according to the marked data ; Backpropagate the value of the first loss function and the value of the second loss function, adjust the parameters of the part that needs to be trained in the perception network, and the part that needs to be trained in the perception network includes the part to be trained in the classification and regression network, the sensor The region of interest extraction module, RPN and backbone network, and the part to be trained in the classification and regression network is determined according to the first task object.
第一任务物体的标注2D框和第二任务物体的目标2D框与RPN预测得到的目标物体的候选2D框进行比较,得到RPN阶段的损失函数值,即第一损失函数值。The labeled 2D frame of the first task object and the target 2D frame of the second task object are compared with the candidate 2D frame of the target object predicted by RPN, and the loss function value of the RPN stage is obtained, that is, the first loss function value.
将样本图像的标注数据与分类回归网络的输出结果进行比较,得到分类回归网络阶段的第一任务物体所在的任务的损失函数值,即第二损失函数值。The labeled data of the sample image is compared with the output result of the classification and regression network, and the loss function value of the task where the first task object in the classification and regression network stage is located, that is, the second loss function value is obtained.
计算与第一损失函数值相关的参数的梯度,基于第一损失函数值反向传播,即基于参数的梯度调整与第一损失函数值相关的参数,实现对感知网络的调整,以使RPN能够更全面地预测候选框。Calculate the gradient of the parameter related to the value of the first loss function, and backpropagate based on the value of the first loss function, that is, adjust the parameters related to the value of the first loss function based on the gradient of the parameter, and realize the adjustment of the perceptual network, so that the RPN can Predict candidate boxes more comprehensively.
与第一损失函数值相关的参数即为计算得到第一损失函数值的过程中所利用的感知网络中的参数,例如,backbone的参数以及RPN的参数。进一步地,在感知网络包括FPN的情况下,与第一损失函数值相关的参数还包括FPN。The parameters related to the first loss function value are the parameters in the perceptual network used in the process of obtaining the first loss function value, for example, the parameters of the backbone and the parameters of the RPN. Further, in the case where the perceptual network includes FPN, the parameter related to the value of the first loss function also includes FPN.
基于第二损失函数值反向传播,计算与第二损失函数值相关的参数的梯度,进而基于参数的梯度调整与第二损失函数值相关的参数,实现对感知网络的调整,以使分类回归网络能够更好地修正输出的2D框,提高类别预测的准确性。Based on the back-propagation of the second loss function value, the gradient of the parameter related to the second loss function value is calculated, and then the parameter related to the second loss function value is adjusted based on the gradient of the parameter to realize the adjustment of the perceptual network, so that the classification regression The network can better correct the output 2D box and improve the accuracy of category prediction.
与第二损失函数相关的参数即为计算得到第二损失函数值的过程中所利用的感知网络中的参数,例如,backbone的参数、RPN的参数、感兴趣区域提取模块的参数以及分类回归网络中所需训练的部分的参数。进一步地,在感知网络包括FPN的情况下,与第二损失函数值相关的参数还包括FPN。与第二损失函数相关的参数即为感知网络中所需训练的部分的参数。The parameters related to the second loss function are the parameters in the perceptual network used in the process of calculating the value of the second loss function, for example, the parameters of the backbone, the parameters of the RPN, the parameters of the region of interest extraction module, and the classification and regression network. parameters for the part of the training required. Further, in the case where the perceptual network includes FPN, the parameter related to the value of the second loss function also includes FPN. The parameters related to the second loss function are the parameters of the part of the perception network that needs to be trained.
根据本申请实施例中的方案,感知网络中不同任务共享的部分,例如主干网络、RPN、感兴趣区域提取模块等,在基于不同任务的标注数据进行训练的过程中均参与训练,这样能够使得感知网络中不同任务共享的部分学习到各个任务的共有特征。感知网络中不同任务对应的不同部分,例如,分类回归网络中各个任务对应的部分,仅在基于各自的任务的标注数据进行训练的过程中参与训练,能够使得感知网络中不同任务对应的不同部分可以学习到其任务特定的特征,提高了模型的准确性。同时,在训练过程中,分类回归网络中所需训练的部分是根据任务确定的,不同任务对应的分类回归网络中的不同部分在训练过程中互不影响,保证了各个任务的独立性,使得模型具有较强的灵活性。According to the solution in this embodiment of the present application, the parts shared by different tasks in the perception network, such as the backbone network, RPN, and region of interest extraction module, etc., all participate in the training process based on the labeled data of different tasks, which can make The parts of the perceptual network shared by different tasks learn common features of each task. Different parts corresponding to different tasks in the perception network, for example, the parts corresponding to each task in the classification and regression network, only participate in the training process based on the labeled data of the respective tasks, which can make different parts corresponding to different tasks in the perception network. Its task-specific features can be learned, improving the accuracy of the model. At the same time, in the training process, the part of the classification and regression network that needs to be trained is determined according to the task, and different parts of the classification and regression network corresponding to different tasks do not affect each other during the training process, ensuring the independence of each task, making The model has strong flexibility.
结合第二方面,在第二方面的某些实现方式中,主干网络,用于对样本图像进行卷积处理,输出样本图像的第一特征图;RPN,用于基于第二特征图输出目标物体的候选2D框的位置信息,第二特征图是根据第一特征图确定的;感兴趣区域提取模块,用于基于候选2D框的位置信息在第三特征图上提取第一特征信息,第一特征信息为候选2D框所在区域的特征,第三特征图是根据第一特征图确定的;分类回归网络,用于对第一特征信息进行处理,输出目标物体的目标2D框以及第一指示信息,目标2D框的数量小于或等于候选2D框的数量,第一指示信息用于指示目标物体所属的类别。With reference to the second aspect, in some implementations of the second aspect, the backbone network is used to perform convolution processing on the sample image and output the first feature map of the sample image; the RPN is used to output the target object based on the second feature map The position information of the candidate 2D frame of the The feature information is the feature of the area where the candidate 2D frame is located, and the third feature map is determined according to the first feature map; the classification and regression network is used to process the first feature information, and output the target 2D frame of the target object and the first indication information , the number of target 2D boxes is less than or equal to the number of candidate 2D boxes, and the first indication information is used to indicate the category to which the target object belongs.
结合第二方面,在第二方面的某些实现方式中,分类回归网络包括第一区域卷积神经网络RCNN,第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,隐层与多个子分类全连接层相连,隐层与多个子回归全连接层相连,多个子分类全连接层与多个任务一一对应,多个子回归全连接层与多个任务一一对应;隐层,用于对第一特征信息进行处理,得到第二特征信息;子分类全连接层用于根据第二特征信息得到候选2D框属于子分类全连接层对应的任务中的物体类别的置信度;子回归全连接层用于根据第二特征 信息对候选2D框的位置信息进行调整,得到调整后的候选2D框;以及分类回归网络中所需训练的部分包括隐层和与第一任务物体所在的任务对应的子分类全连接层和子回归全连接层。With reference to the second aspect, in some implementations of the second aspect, the classification and regression network includes a first regional convolutional neural network RCNN, and the first RCNN includes a hidden layer, multiple sub-classification fully connected layers and multiple sub-regression fully connected layers, The hidden layer is connected with multiple sub-classification fully connected layers, the hidden layer is connected with multiple sub-regression fully connected layers, multiple sub-classification fully connected layers are in one-to-one correspondence with multiple tasks, and multiple sub-regression fully connected layers are in one-to-one correspondence with multiple tasks; The hidden layer is used to process the first feature information to obtain the second feature information; the sub-class fully connected layer is used to obtain the confidence of the object category in the task corresponding to the sub-class fully connected layer of the candidate 2D frame according to the second feature information. degree; the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the second feature information to obtain the adjusted candidate 2D frame; and the part to be trained in the classification and regression network includes the hidden layer and the first task. The sub-classification fully connected layer and the sub-regression fully connected layer corresponding to the task where the object is located.
根据本申请实施例的方法,感知网络中不同任务共享的部分,即主干网络、RPN、感兴趣区域提取模块以及分类回归网络的隐层,在基于不同任务的标注数据进行训练的过程中均参与训练,这样能够使得感知网络中不同任务共享的部分学习到各个任务的共有特征。感知网络中不同任务对应的不同部分,即分类回归网络中各个任务对应的子分类全连接层和子回归全连接层,仅在基于各自的任务的标注数据进行训练的过程中参与训练,能够使得感知网络中不同任务对应的不同部分可以学习到其任务特定的特征,提高了模型的准确性。According to the method of the embodiment of the present application, the parts shared by different tasks in the perception network, that is, the backbone network, the RPN, the region of interest extraction module, and the hidden layer of the classification and regression network, all participate in the process of training based on the labeled data of different tasks. Training, so that the parts shared by different tasks in the perceptual network can learn the common features of each task. The different parts corresponding to different tasks in the perception network, that is, the sub-classification fully connected layer and the sub-regression fully connected layer corresponding to each task in the classification and regression network, only participate in the training process based on the labeled data of the respective tasks, which can make the perception Different parts of the network corresponding to different tasks can learn their task-specific features, which improves the accuracy of the model.
第三方面,提供了一种物体识别方法,感知网络包括:主干网络、候选区域生成网络RPN、感兴趣区域提取模块和分类回归网络,方法包括:利用主干网络对输入图像进行卷积处理,得到输入图像的第一特征图;利用RPN基于第二特征图上输出目标物体的候选二维2D框的位置信息,目标物体包括多个任务中的待检测的物体,多个任务中的每个任务至少包括一个类别,第二特征图是根据第一特征图确定的;利用感兴趣区域提取模块基于候选2D框的位置信息在第三特征图上提取第一特征信息,第一特征信息为候选2D框所在区域的特征,第三特征图是根据第一特征图确定的;利用分类回归网络对第一特征信息进行处理,得到目标物体的目标2D框以及第一指示信息,目标2D框的数量小于或等于候选2D框的数量,第一指示信息用于指示目标物体所属的类别。In a third aspect, an object recognition method is provided. The perception network includes: a backbone network, a candidate region generation network RPN, a region of interest extraction module, and a classification and regression network. The method includes: using the backbone network to perform convolution processing on an input image to obtain The first feature map of the input image; using RPN to output the position information of the candidate two-dimensional 2D frame of the target object based on the second feature map, the target object includes the objects to be detected in multiple tasks, each task in multiple tasks At least one category is included, and the second feature map is determined according to the first feature map; the region of interest extraction module is used to extract the first feature information on the third feature map based on the position information of the candidate 2D frame, and the first feature information is the candidate 2D The feature of the area where the frame is located, and the third feature map is determined according to the first feature map; the first feature information is processed by the classification and regression network to obtain the target 2D frame of the target object and the first indication information, and the number of target 2D frames is less than or equal to the number of candidate 2D boxes, the first indication information is used to indicate the category to which the target object belongs.
根据本申请实施例的方案,利用一个感知网络完成多种感知任务,多个任务共享一个RPN,即由一个RPN预测多个任务中的待检测的物体所在的区域,在保证感知网络性能的同时,降低了感知网络的参数量和计算量,提高了处理效率,有利于部署于实时性要求较高的场景中,同时减小了硬件的压力,节约了成本。According to the solution of the embodiment of the present application, a sensing network is used to complete a variety of sensing tasks, and multiple tasks share one RPN, that is, one RPN predicts the area where the object to be detected in multiple tasks is located, while ensuring the performance of the sensing network. , which reduces the amount of parameters and calculation of the perception network, improves the processing efficiency, is conducive to deployment in scenarios with high real-time requirements, reduces the pressure on hardware, and saves costs.
结合第三方面,在第三方面的某些实现方式中,利用分类回归网络对第一特征信息进行处理,得到目标物体的目标2D框以及第一指示信息,包括:利用分类回归网络对第一特征信息进行处理,得到候选2D框属于多个任务中的各个类别的置信度;利用分类回归网络对候选2D框的位置信息进行调整,得到调整后的候选2D框;根据调整后的候选2D框确定目标2D框;根据目标2D框属于各个类别的置信度确定第一指示信息。With reference to the third aspect, in some implementations of the third aspect, the classification and regression network is used to process the first feature information to obtain the target 2D frame of the target object and the first indication information, including: using the classification and regression network to process the first feature information. The feature information is processed to obtain the confidence that the candidate 2D frame belongs to each category in multiple tasks; the position information of the candidate 2D frame is adjusted by the classification and regression network, and the adjusted candidate 2D frame is obtained; according to the adjusted candidate 2D frame Determine the target 2D frame; determine the first indication information according to the confidence that the target 2D frame belongs to each category.
结合第三方面,在第三方面的某些实现方式中,分类回归网络包括第一区域卷积神经网络RCNN,第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,隐层与多个子分类全连接层相连,隐层与多个子回归全连接层相连,多个子分类全连接层与多个任务一一对应,多个子回归全连接层与多个任务一一对应;以及利用分类回归网络对第一特征信息进行处理,输出目标物体的目标2D框以及第一指示信息,包括:利用隐层对第一特征信息进行处理,得到第二特征信息;利用子分类全连接层根据第二特征信息得到候选2D框属于子分类全连接层对应的任务中的物体类别的置信度;利用子回归全连接层根据第二特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。With reference to the third aspect, in some implementations of the third aspect, the classification and regression network includes a first regional convolutional neural network RCNN, and the first RCNN includes a hidden layer, multiple sub-classification fully connected layers and multiple sub-regression fully connected layers, The hidden layer is connected with multiple sub-classification fully connected layers, the hidden layer is connected with multiple sub-regression fully connected layers, multiple sub-classification fully connected layers are in one-to-one correspondence with multiple tasks, and multiple sub-regression fully connected layers are in one-to-one correspondence with multiple tasks; and using a classification and regression network to process the first feature information, and output the target 2D frame of the target object and the first indication information, including: using the hidden layer to process the first feature information to obtain the second feature information; using the sub-category full connection According to the second feature information, the layer obtains the confidence of the candidate 2D frame belonging to the object category in the task corresponding to the sub-classification fully connected layer; the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the second feature information, and the adjustment is obtained. The candidate 2D box after.
结合第三方面,在第三方面的某些实现方式中,分类回归网络包括第二RCNN,第二RCNN包括隐层、分类全连接层和回归全连接层,隐层与分类全连接层相连,隐层与回归全连接层相连;以及利用分类回归网络对第一特征信息进行处理,输出目标物体的目标 2D框以及第一指示信息,包括:利用隐层对第一特征信息进行处理,得到第三特征信息;利用分类全连接层根据第三特征信息得到候选2D框属于各个类别的置信度;利用回归全连接层根据第三特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。In combination with the third aspect, in some implementations of the third aspect, the classification and regression network includes a second RCNN, the second RCNN includes a hidden layer, a classification fully connected layer and a regression fully connected layer, and the hidden layer is connected with the classification fully connected layer, The hidden layer is connected with the regression fully connected layer; and the classification and regression network is used to process the first feature information, and output the target 2D frame of the target object and the first indication information, including: using the hidden layer to process the first feature information to obtain the first feature information. Three feature information; use the classification fully connected layer to obtain the confidence that the candidate 2D frame belongs to each category according to the third feature information; use the regression fully connected layer to adjust the position information of the candidate 2D frame according to the third feature information to obtain the adjusted candidate 2D frame 2D box.
结合第三方面,在第三方面的某些实现方式中,分类全连接层是通过将第一RCNN中的多个子分类全连接层进行合并得到的,回归全连接层是通过将第一RCNN中的多个子回归全连接层进行合并得到的,第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,隐层与多个子分类全连接层相连,隐层与多个子回归全连接层相连,多个子分类全连接层与多个任务一一对应,多个子回归全连接层与多个任务一一对应;子分类全连接层用于根据第三特征信息得到候选2D框属于子分类全连接层对应的任务中的物体类别的置信度;子回归全连接层用于根据第三特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。In combination with the third aspect, in some implementations of the third aspect, the classification fully connected layer is obtained by merging multiple sub-classification fully connected layers in the first RCNN, and the regression fully connected layer is obtained by combining the first RCNN. The first RCNN includes a hidden layer, multiple sub-category fully-connected layers and multiple sub-regression fully-connected layers, the hidden layer is connected with multiple sub-category fully-connected layers, and the hidden layer is connected with multiple sub-regression layers. The fully-connected layers are connected, the sub-classification fully-connected layers are in one-to-one correspondence with multiple tasks, and the sub-regression fully-connected layers are in one-to-one correspondence with multiple tasks; the sub-classification fully connected layer is used to obtain the candidate 2D frame belonging to the The confidence of the object category in the task corresponding to the sub-classification fully connected layer; the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the third feature information to obtain the adjusted candidate 2D frame.
可以采用第二方面中的感知网络的训练方法得到目标感知网络,该目标感知网络可以是已经训练好的图像识别模型,可以利用该训练好的感知网络对待处理图像进行处理。The target-aware network can be obtained by using the training method of the perception network in the second aspect. The target-aware network can be a trained image recognition model, and the trained image recognition model can be used to process the image to be processed.
第四方面,提供了一种感知网络的训练装置,装置包括用于执行上述第二方面以及第二方面中的任意一种实现方式中的方法的模块或单元。In a fourth aspect, an apparatus for training a perceptual network is provided. The apparatus includes a module or unit for performing the method in the second aspect and any one of the implementation manners of the second aspect.
第五方面,提供了一种物体识别装置,装置包括用于执行上述第三方面以及第三方面中的任意一种实现方式中的方法的模块或单元。In a fifth aspect, an object recognition device is provided, the device comprising a module or unit for executing the method in the third aspect and any one of the implementation manners of the third aspect.
应理解,在上述第一方面和第二方面中对相关内容的扩展、限定、解释和说明也适用于第三方面、第四方面和第五方面中相同的内容。It should be understood that the extensions, definitions, explanations and descriptions of related matters in the above-mentioned first and second aspects also apply to the same matters in the third, fourth and fifth aspects.
第六方面,提供了一种感知网络的训练装置,该装置包括:处理器和传输接口,处理器通过传输接口接收或发送数据,处理器被配置为调用存储在存储器中的程序指令,以执行第二方面以及第二方面中的任意一种实现方式中的方法。In a sixth aspect, there is provided an apparatus for training a cognitive network, the apparatus comprising: a processor and a transmission interface, the processor receives or sends data through the transmission interface, and the processor is configured to call program instructions stored in the memory to execute The second aspect and the method in any one of the implementation manners of the second aspect.
上述第六方面中的处理器既可以是中央处理器(central processing unit,CPU),也可以是CPU与神经网络运算处理器的组合,这里的神经网络运算处理器可以包括图形处理器(graphics processing unit,GPU)、神经网络处理器(neural-network processing unit,NPU)和张量处理器(tensor processing unit,TPU)等等。其中,TPU是谷歌(google)为机器学习全定制的人工智能加速器专用集成电路。The processor in the sixth aspect above may be either a central processing unit (CPU), or a combination of a CPU and a neural network computing processor, where the neural network computing processor may include a graphics processor (graphics processing unit). unit, GPU), neural network processor (neural-network processing unit, NPU) and tensor processor (tensor processing unit, TPU) and so on. Among them, TPU is Google's fully customized artificial intelligence accelerator application-specific integrated circuit for machine learning.
第七方面,提供了一种物体识别装置,该装置包括:处理器和传输接口,处理器通过传输接口接收或发送数据,处理器被配置为调用存储在存储器中的程序指令,以执行第三方面以及第三方面中的任意一种实现方式中的方法。In a seventh aspect, an object recognition device is provided, the device comprising: a processor and a transmission interface, the processor receives or sends data through the transmission interface, and the processor is configured to call program instructions stored in the memory to execute a third A method in any one implementation manner of the aspect and the third aspect.
上述第七方面中的处理器既可以是中央处理器,也可以是CPU与神经网络运算处理器的组合,这里的神经网络运算处理器可以包括图形处理器、神经网络处理器和张量处理器等等。其中,TPU是谷歌为机器学习全定制的人工智能加速器专用集成电路。The processor in the above seventh aspect can be either a central processing unit, or a combination of a CPU and a neural network computing processor, where the neural network computing processor can include a graphics processor, a neural network processor, and a tensor processor. and many more. Among them, TPU is Google's fully customized artificial intelligence accelerator application-specific integrated circuit for machine learning.
第八方面,提供一种计算机可读存储介质,该计算机可读存储介质存储用于设备执行的程序代码,当程序代码在计算机或处理器上运行时,使得计算机或处理器执行第二方面或第三方面中的任意一种实现方式中的方法。In an eighth aspect, a computer-readable storage medium is provided, the computer-readable storage medium stores program code for execution by a device, and when the program code is run on a computer or a processor, causes the computer or processor to execute the second aspect or The method in any one of the implementation manners of the third aspect.
第九方面,提供一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述第二方面或第三方面中的任意一种实现方式中的方法。A ninth aspect provides a computer program product comprising instructions, when the computer program product runs on a computer, the computer causes the computer to execute the method in any one of the implementation manners of the second aspect or the third aspect.
第十方面,提供一种芯片,所述芯片包括处理器与数据接口,所述处理器通过所述数 据接口读取存储器上存储的指令,执行上述第二方面或第三方面中的任意一种实现方式中的方法。A tenth aspect provides a chip, the chip includes a processor and a data interface, the processor reads an instruction stored in a memory through the data interface, and executes any one of the second aspect or the third aspect above method in the implementation.
可选地,作为一种实现方式,所述芯片还可以包括存储器,所述存储器中存储有指令,所述处理器用于执行所述存储器上存储的指令,当所述指令被执行时,所述处理器用于执行第一方面或第二方面中的任意一种实现方式中的方法。Optionally, as an implementation manner, the chip may further include a memory, in which instructions are stored, the processor is configured to execute the instructions stored in the memory, and when the instructions are executed, the The processor is configured to execute the method in any one of the implementations of the first aspect or the second aspect.
上述芯片具体可以是现场可编程门阵列(field-programmable gate array,FPGA)或者专用集成电路(application-specific integrated circuit,ASIC)。The above chip may specifically be a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC).
第十一方面,提供一种电子设备,该电子设备包括上述第四方面至第七方面中任意一个方面中的装置。In an eleventh aspect, an electronic device is provided, and the electronic device includes the apparatus in any one of the above-mentioned fourth to seventh aspects.
图1为本申请实施例提供的一种应用场景的示意图;FIG. 1 is a schematic diagram of an application scenario provided by an embodiment of the present application;
图2为本申请实施例提供的另一种应用场景的示意图;FIG. 2 is a schematic diagram of another application scenario provided by an embodiment of the present application;
图3为本申请实施例提供的一种系统架构的结构示意图;FIG. 3 is a schematic structural diagram of a system architecture provided by an embodiment of the present application;
图4为本申请实施例提供的一种卷积神经网络的结构示意图;4 is a schematic structural diagram of a convolutional neural network provided by an embodiment of the present application;
图5为本申请实施例提供的一种芯片的硬件结构示意图;FIG. 5 is a schematic diagram of the hardware structure of a chip according to an embodiment of the present application;
图6为本申请实施例提供的一种系统架构的示意图;FIG. 6 is a schematic diagram of a system architecture provided by an embodiment of the present application;
图7为多头端多任务感知网络的示意性框图;FIG. 7 is a schematic block diagram of a multi-head end multi-task perception network;
图8为本申请实施例提供的一种感知网络的示意性结构图;FIG. 8 is a schematic structural diagram of a perception network according to an embodiment of the present application;
图9为本申请实施例提供的另一种感知网络的示意性结构图;FIG. 9 is a schematic structural diagram of another sensing network provided by an embodiment of the present application;
图10为本申请实施例提供的另一种感知网络的示意性结构图;FIG. 10 is a schematic structural diagram of another sensing network provided by an embodiment of the present application;
图11为本申请实施例提供的另一种感知网络的示意性结构图;FIG. 11 is a schematic structural diagram of another cognitive network provided by an embodiment of the present application;
图12为本申请实施例提供的感知网络的训练方法的示意性流程图;12 is a schematic flowchart of a training method for a perceptual network provided by an embodiment of the present application;
图13为本申请实施例提供的一种感知网络的训练流程的示意图;13 is a schematic diagram of a training process of a perception network provided by an embodiment of the present application;
图14为本申请实施例提供的训练过程中的感知网络的示意性框图;14 is a schematic block diagram of a perceptual network in a training process provided by an embodiment of the present application;
图15为本申请实施例提供的一种物体识别方法的示意性流程图;15 is a schematic flowchart of an object recognition method provided by an embodiment of the present application;
图16为本申请实施例提供的一种物体识别流程的示意图;16 is a schematic diagram of an object recognition process provided by an embodiment of the present application;
图17为本申请实施例提供的推理过程中的感知网络的示意性框图;17 is a schematic block diagram of a perceptual network in a reasoning process provided by an embodiment of the present application;
图18为本申请实施例提供的感知网络的转换过程的示意图;18 is a schematic diagram of a conversion process of a sensory network provided by an embodiment of the present application;
图19为本申请实施例提供的一种装置的示意性框图;FIG. 19 is a schematic block diagram of an apparatus provided by an embodiment of the present application;
图20为本申请实施例提供的另一种装置的示意性框图。FIG. 20 is a schematic block diagram of another apparatus provided by an embodiment of the present application.
下面将结合附图,对本申请中的技术方案进行描述。The technical solutions in the present application will be described below with reference to the accompanying drawings.
本申请实施例可以应用在驾驶辅助、自动驾驶、手机终端、监控、安防等需要完成多种感知任务的领域。将图像输入至本申请的感知网络中,得到图像中感兴趣物体的检测结果。检测结果可以输入到后处理模块中进行处理,例如,在自动驾驶系统中送入规划控制单元进行决策,或者,送入安防系统中进行异常情况检测。The embodiments of the present application can be applied to fields that need to complete various sensing tasks, such as driving assistance, automatic driving, mobile phone terminals, monitoring, and security. The image is input into the perception network of the present application, and the detection result of the object of interest in the image is obtained. The detection results can be input to the post-processing module for processing, for example, sent to the planning control unit for decision-making in the autonomous driving system, or sent to the security system for abnormal situation detection.
下面对高级辅助驾驶系统(advanced driving assistant system,ADAS)/自动驾驶系统 (autonomous driving system,ADS)视觉感知系统、相册图片分类和监控这三种应用场景进行简单的介绍。The following is a brief introduction to the three application scenarios of advanced driving assistant system (ADAS)/autonomous driving system (ADS) visual perception system, album picture classification and monitoring.
ADAS/ADS视觉感知系统:ADAS/ADS visual perception system:
如图1所示,在ADAS和ADS中,需要实时进行多种类型的目标检测,检测目标包括动态障碍物、静态障碍物和交通标志,例如,行人(pedestrian)、骑行者(cyclist)、三轮车(tricycle)、轿车(car)、卡车(truck)、公交车(bus)、车轮(wheel)、车灯(car light)、交通锥标(traffic cone)、交通棍标(traffic stick)、消防栓(fire hydrant)、摩托车(motorcycle)和自行车(bicycle)、交通标志(traffic sign)、导向标志(guide sign)、广告牌(billboard)、路标(roadsign)、路杆(pole)、交通灯(traffic light)和路面标志等。交通灯包括红色交通灯(trafficlight_red)、黄色交通灯(trafficlight_yellow)、绿色交通灯(trafficlight_green)以及黑色交通灯(trafficlight_black)等。路面标志包括Around/直行(straight)、左转(left)/右转(right)、直行和左转(straight and left)、直行和右转(straight and right)/直行掉头(straight and around)/左转掉头(left and around)/左右转(left and right)/左弯道(left bend)/右弯道(right bend)/人行道标志(pavement sign)等。As shown in Figure 1, in ADAS and ADS, multiple types of target detection need to be performed in real time, and the detection targets include dynamic obstacles, static obstacles and traffic signs, such as pedestrians (pedestrians), cyclists (cyclists), tricycles (tricycle), car (car), truck (truck), bus (bus), wheel (wheel), car light (car light), traffic cone (traffic cone), traffic stick (traffic stick), fire hydrant (fire hydrant), motorcycle (motorcycle) and bicycle (bicycle), traffic sign (traffic sign), guide sign (guide sign), billboard (billboard), road sign (roadsign), road pole (pole), traffic light ( traffic light) and road signs, etc. Traffic lights include red traffic lights (trafficlight_red), yellow traffic lights (trafficlight_yellow), green traffic lights (trafficlight_green), and black traffic lights (trafficlight_black). Pavement signs include Around/straight, left/right, straight and left, straight and right/straight and around/ Turn left and around/left and right/left bend/right bend/pavement sign, etc.
利用本申请实施例的方案,能够在一个感知网络中实现上述多种目标的检测任务,即能够在一个感知网络中检测多个任务的待检测的物体,检测结果经过处理后可以送入规划控制单元进行决策,例如,障碍物躲避、交通灯决策或交通标志决策等。Using the solution of the embodiment of the present application, the detection tasks of the above-mentioned various targets can be realized in one sensing network, that is, objects to be detected for multiple tasks can be detected in one sensing network, and the detection results can be sent to planning control after processing. The unit makes decisions, such as obstacle avoidance, traffic light decisions, or traffic sign decisions.
相册图片分类:Album picture classification:
当用户在终端设备(例如,手机)或者云盘上存储了大量的图片时,通过对相册中图像进行识别可以方便用户或者系统对相册进行分类管理,提升用户体验。When a user stores a large number of pictures on a terminal device (eg, a mobile phone) or a cloud disk, identifying the images in the album can facilitate the user or the system to classify and manage the album and improve user experience.
利用本申请实施例的方案,能够获得或者优化适用于相册图片分类的感知网络。并利用该感知网络对图片进行分类,例如,将图片分为包含动物的照片、包含人物的照片等不同类别,从而为不同的类别的图片打上标签,便于用户查看和查找。另外,这些图片的分类标签也可以提供给相册管理系统进行分类管理,节省用户的管理时间,提高相册管理的效率,提升用户体验。Using the solutions of the embodiments of the present application, it is possible to obtain or optimize a perceptual network suitable for album picture classification. And use the perception network to classify pictures, for example, classify pictures into different categories such as photos containing animals, photos containing people, etc., so as to label pictures of different categories, which is convenient for users to view and find. In addition, the classification tags of these pictures can also be provided to the album management system for classification management, which saves the user's management time, improves the efficiency of album management, and enhances the user experience.
监控:monitor:
监控场景包括:智慧城市、野外监控、室内监控、室外监控以及车内监控等。Monitoring scenarios include: smart city, field monitoring, indoor monitoring, outdoor monitoring, and in-vehicle monitoring.
如图2所示,智慧城市感知系统中需要完成多种检测任务,例如,需要检测车辆、车牌、人以及人脸等,检测结果进行处理后可以用于判断交通违章行为、预测交通拥挤程度等。As shown in Figure 2, a variety of detection tasks need to be completed in the smart city perception system. For example, vehicles, license plates, people, and faces need to be detected. After processing, the detection results can be used to judge traffic violations, predict traffic congestion, etc. .
采用本申请实施例的方案,能够在一个感知网络对输入的道路画面进行处理,完成上述多种目标的检测任务。另外,还可以根据实际情况增加或减少该感知网络的检测任务。例如,当前的感知网络的检测任务包括车的检测任务和人的检测任务,若需要感知网络的检测任务中增加交通标志的检测任务,则调整该感知网络的结构,增加该检测任务即可。具体描述可以参见后文,例如图14。By adopting the solution of the embodiment of the present application, the input road picture can be processed in a perception network, and the detection tasks of the above-mentioned various targets can be completed. In addition, the detection tasks of the perception network can also be increased or decreased according to the actual situation. For example, the current detection tasks of the perception network include vehicle detection tasks and human detection tasks. If the detection task of traffic signs needs to be added to the detection tasks of the perception network, the structure of the perception network can be adjusted to add the detection task. The specific description can be found later, for example, FIG. 14 .
由于本申请实施例涉及大量神经网络的应用,为了便于理解,下面先对本申请实施例可能涉及的神经网络的相关术语和概念进行介绍。Since the embodiments of the present application involve a large number of neural network applications, for ease of understanding, related terms and concepts of the neural networks that may be involved in the embodiments of the present application are first introduced below.
(1)神经网络(1) Neural network
神经网络可以是由神经单元组成的,神经单元可以是指以x
s和截距1为输入的运算单元,该运算单元的输出可以为:
A neural network can be composed of neural units, and a neural unit can refer to an operation unit that takes x s and an intercept 1 as input, and the output of the operation unit can be:
其中,s=1、2、……n,n为大于1的自然数,W
s为x
s的权重,b为神经单元的偏置。f为神经单元的激活函数(activation functions),用于将非线性特性引入神经网络中,来将神经单元中的输入信号转换为输出信号。该激活函数的输出信号可以作为下一层卷积层的输入,激活函数可以是sigmoid函数。神经网络是将多个上述单一的神经单元联结在一起形成的网络,即一个神经单元的输出可以是另一个神经单元的输入。每个神经单元的输入可以与前一层的局部接受域相连,来提取局部接受域的特征,局部接受域可以是由若干个神经单元组成的区域。
Among them, s=1, 2, ... n, n is a natural number greater than 1, W s is the weight of x s , and b is the bias of the neural unit. f is an activation function of the neural unit, which is used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of the activation function can be used as the input of the next convolutional layer, and the activation function can be a sigmoid function. A neural network is a network formed by connecting a plurality of the above single neural units together, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected with the local receptive field of the previous layer to extract the features of the local receptive field, and the local receptive field can be an area composed of several neural units.
(2)深度神经网络(2) Deep neural network
深度神经网络(deep neural network,DNN),也称多层神经网络,可以理解为具有多层隐含层的神经网络。按照不同层的位置对DNN进行划分,DNN内部的神经网络可以分为三类:输入层,隐含层,输出层。一般来说第一层是输入层,最后一层是输出层,中间的层数都是隐含层。层与层之间是全连接的,也就是说,第i层的任意一个神经元一定与第i+1层的任意一个神经元相连。A deep neural network (DNN), also known as a multi-layer neural network, can be understood as a neural network with multiple hidden layers. The DNN is divided according to the positions of different layers. The neural network inside the DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the middle layers are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer.
虽然DNN看起来很复杂,但是就每一层的工作来说,其实并不复杂,简单来说就是如下线性关系表达式:
其中,
是输入向量,
是输出向量,
是偏移向量,W是权重矩阵(也称系数),α()是激活函数。每一层仅仅是对输入向量
经过如此简单的操作得到输出向量
由于DNN层数多,系数W和偏移向量
的数量也比较多。这些参数在DNN中的定义如下所述:以系数W为例:假设在一个三层的DNN中,第二层的第4个神经元到第三层的第2个神经元的线性系数定义为
上标3代表系数W所在的层数,而下标对应的是输出的第三层索引2和输入的第二层索引4。
Although DNN looks complicated, in terms of the work of each layer, it is not complicated. In short, it is the following linear relationship expression: in, is the input vector, is the output vector, is the offset vector, W is the weight matrix (also called coefficients), and α() is the activation function. Each layer is just an input vector After such a simple operation to get the output vector Due to the large number of DNN layers, the coefficient W and offset vector The number is also higher. These parameters are defined in the DNN as follows: Take the coefficient W as an example: Suppose that in a three-layer DNN, the linear coefficient from the fourth neuron in the second layer to the second neuron in the third layer is defined as The superscript 3 represents the number of layers where the coefficient W is located, and the subscript corresponds to the output third layer index 2 and the input second layer index 4.
综上,第L-1层的第k个神经元到第L层的第j个神经元的系数定义为
To sum up, the coefficient from the kth neuron in the L-1 layer to the jth neuron in the Lth layer is defined as
需要注意的是,输入层是没有W参数的。在深度神经网络中,更多的隐含层让网络更能够刻画现实世界中的复杂情形。理论上而言,参数越多的模型复杂度越高,“容量”也就越大,也就意味着它能完成更复杂的学习任务。训练深度神经网络的也就是学习权重矩阵的过程,其最终目的是得到训练好的深度神经网络的所有层的权重矩阵(由很多层的向量W形成的权重矩阵)。It should be noted that the input layer does not have a W parameter. In a deep neural network, more hidden layers allow the network to better capture the complexities of the real world. In theory, a model with more parameters is more complex and has a larger "capacity", which means that it can complete more complex learning tasks. Training the deep neural network is the process of learning the weight matrix, and its ultimate goal is to obtain the weight matrix of all layers of the trained deep neural network (the weight matrix formed by the vectors W of many layers).
(3)卷积神经网络(3) Convolutional Neural Network
卷积神经网络(convolutional neuron network,CNN)是一种带有卷积结构的深度神经网络。卷积神经网络包含了一个由卷积层和子采样层构成的特征抽取器。该特征抽取器可以看作是滤波器,卷积过程可以看作是使用一个可训练的滤波器与一个输入的图像或者卷积特征平面(feature map)做卷积。卷积层是指卷积神经网络中对输入信号进行卷积处理的神经元层。在卷积神经网络的卷积层中,一个神经元可以只与部分邻层神经元连接。一个卷积层中,通常包含若干个特征平面,每个特征平面可以由一些矩形排列的神经单元组成。同一特征平面的神经单元共享权重,这里共享的权重就是卷积核。共享权重可以理解为提取图像信息的方式与位置无关。这其中隐含的原理是:图像的某一部分的统计信息与其他部分是一样的。即意味着在某一部分学习的图像信息也能用在另一部分上。所以对于图像 上的所有位置,都能使用同样的学习得到的图像信息。在同一卷积层中,可以使用多个卷积核来提取不同的图像信息,一般地,卷积核数量越多,卷积操作反映的图像信息越丰富。Convolutional neural network (CNN) is a deep neural network with a convolutional structure. A convolutional neural network consists of a feature extractor consisting of convolutional and subsampling layers. The feature extractor can be viewed as a filter, and the convolution process can be viewed as convolution with an input image or a convolutional feature map using a trainable filter. The convolutional layer refers to the neuron layer in the convolutional neural network that convolves the input signal. In a convolutional layer of a convolutional neural network, a neuron can only be connected to some of its neighbors. A convolutional layer usually contains several feature planes, and each feature plane can be composed of some neural units arranged in a rectangle. Neural units in the same feature plane share weights, and the shared weights here are convolution kernels. Shared weights can be understood as the way to extract image information is independent of location. The underlying principle is that the statistics of one part of the image are the same as the other parts. This means that image information learned in one part can also be used in another part. So for all positions on the image, the same learned image information can be used. In the same convolution layer, multiple convolution kernels can be used to extract different image information. Generally, the more convolution kernels, the richer the image information reflected by the convolution operation.
卷积核可以以随机大小的矩阵的形式初始化,在卷积神经网络的训练过程中卷积核可以通过学习得到合理的权重。另外,共享权重带来的直接好处是减少卷积神经网络各层之间的连接,同时又降低了过拟合的风险。The convolution kernel can be initialized in the form of a matrix of random size, and the convolution kernel can obtain reasonable weights by learning during the training process of the convolutional neural network. In addition, the immediate benefit of sharing weights is to reduce the connections between the layers of the convolutional neural network, while reducing the risk of overfitting.
(4)损失函数(4) Loss function
在训练深度神经网络的过程中,因为希望深度神经网络的输出尽可能的接近真正想要预测的值,所以可以通过比较当前网络的预测值和真正想要的目标值,再根据两者之间的差异情况来更新每一层神经网络的权重向量(当然,在第一次更新之前通常会有化的过程,即为深度神经网络中的各层预先配置参数),比如,如果网络的预测值高了,就调整权重向量让它预测低一些,不断地调整,直到深度神经网络能够预测出真正想要的目标值或与真正想要的目标值非常接近的值。因此,就需要预先定义“如何比较预测值和目标值之间的差异”,这便是损失函数(loss function)或目标函数(objective function),它们是用于衡量预测值和目标值的差异的重要方程。其中,以损失函数举例,损失函数的输出值(loss)越高表示差异越大,那么深度神经网络的训练就变成了尽可能缩小这个loss的过程。通常地,loss越小,该深度神经网络的训练质量越高,loss越大,深度神经网络的训练质量越低。类似的,loss波动越小,训练越稳定;loss波动越大,训练越不稳定。In the process of training a deep neural network, because it is hoped that the output of the deep neural network is as close as possible to the value you really want to predict, you can compare the predicted value of the current network with the target value you really want, and then based on the difference between the two to update the weight vector of each layer of the neural network (of course, there is usually a process of transformation before the first update, that is, pre-configuring parameters for each layer in the deep neural network), for example, if the predicted value of the network If it is high, adjust the weight vector to make the prediction lower, and keep adjusting until the deep neural network can predict the real desired target value or a value very close to the real desired target value. Therefore, it is necessary to pre-define "how to compare the difference between the predicted value and the target value", which is the loss function (loss function) or objective function (objective function), which are used to measure the difference between the predicted value and the target value. important equation. Among them, taking the loss function as an example, the higher the output value of the loss function (loss), the greater the difference, then the training of the deep neural network becomes the process of reducing the loss as much as possible. Generally, the smaller the loss, the higher the training quality of the deep neural network, and the larger the loss, the lower the training quality of the deep neural network. Similarly, the smaller the loss fluctuation, the more stable the training; the larger the loss fluctuation, the more unstable the training.
(5)反向传播算法(5) Back propagation algorithm
神经网络可以采用误差反向传播(back propagation,BP)算法在训练过程中修正初始模型中参数的大小,使得模型的重建误差损失越来越小。具体地,前向传递输入信号直至输出会产生误差损失,通过反向传播误差损失信息来更新初始的超分辨率模型中参数,从而使误差损失收敛。反向传播算法是以误差损失为主导的反向传播运动,旨在得到最优的超分辨率模型的参数,例如权重矩阵。The neural network can use the error back propagation (BP) algorithm to correct the size of the parameters in the initial model during the training process, so that the reconstruction error loss of the model becomes smaller and smaller. Specifically, forwarding the input signal until the output will generate an error loss, and updating the parameters in the initial super-resolution model by back-propagating the error loss information, so that the error loss converges. The back-propagation algorithm is a back-propagation motion dominated by the error loss, aiming to obtain the parameters of the optimal super-resolution model, such as the weight matrix.
下面从模型训练侧和模型应用侧对本申请提供的方法进行描述。The method provided by the present application will be described below from the model training side and the model application side.
本申请实施例提供的感知网络的训练方法,涉及计算机视觉的处理,具体可以应用数据训练、机器学习、深度学习等数据处理方法,对训练数据进行符号化和形式化的智能信息建模、抽取、预处理、训练等,最终得到训练好的感知网络;并且,本申请实施例提供的物体识别方法可以运用上述训练好的感知网络,将输入数据(如本申请中的待处理图像)输入到所述训练好的感知网络中,得到输出数据(如本申请中的第一指示信息和目标物体的目标2D框)。需要说明的是,本申请实施例提供的感知网络的训练方法和物体识别方法基于同一个构思,也可以理解为一个系统中的两个部分,或一个整体流程的两个阶段:如模型训练阶段和模型应用阶段。The training method for a perceptual network provided by the embodiment of the present application involves the processing of computer vision. Specifically, data processing methods such as data training, machine learning, and deep learning can be used to perform symbolic and formalized intelligent information modeling and extraction on the training data. , preprocessing, training, etc., to finally obtain a trained perceptual network; and, the object recognition method provided by the embodiment of the application can use the above-mentioned trained perceptual network to input the input data (such as the image to be processed in the application) into the In the trained perception network, output data (such as the first indication information and the target 2D frame of the target object in this application) are obtained. It should be noted that the perceptual network training method and the object recognition method provided by the embodiments of the present application are based on the same concept, and can also be understood as two parts in a system, or two stages of an overall process: such as the model training stage and model application stage.
如图3所示,本申请实施例提供了一种系统架构100。在图3中,数据采集设备160用于采集训练数据。针对本申请实施例的感知网络的训练方法来说,训练数据可以包括样本图像、样本图像的标注数据和样本图像上的伪框。As shown in FIG. 3 , an embodiment of the present application provides a system architecture 100 . In Figure 3, a data collection device 160 is used to collect training data. For the training method of the perceptual network according to the embodiment of the present application, the training data may include sample images, labeled data of the sample images, and pseudo frames on the sample images.
在采集到训练数据之后,数据采集设备160将这些训练数据存入数据库130,训练设备120基于数据库130中维护的训练数据训练得到目标模型/规则101。After collecting the training data, the data collection device 160 stores the training data in the database 130 , and the training device 120 obtains the target model/rule 101 by training based on the training data maintained in the database 130 .
后文中将对训练设备120基于训练数据得到目标模型/规则101的具体方式进行详细描述。目标模型/规则101能够用于实现本申请实施例的物体识别方法,即将待处理的图 像输入目标模型/规则101中,即可得到待处理的图像中感兴趣物体的检测结果。需要说明的是,在实际的应用中,所述数据库130中维护的训练数据不一定都来自于数据采集设备160的采集,也有可能是从其他设备接收得到的。另外需要说明的是,训练设备120也不一定完全基于数据库130维护的训练数据进行目标模型/规则101的训练,也有可能从云端或其他地方获取训练数据进行模型训练,上述描述不应该作为对本申请实施例的限定。The specific manner in which the training device 120 obtains the target model/rule 101 based on the training data will be described in detail later. The target model/rule 101 can be used to realize the object recognition method of the embodiment of the present application, that is, the image to be processed is input into the target model/rule 101, and the detection result of the object of interest in the image to be processed can be obtained. It should be noted that, in practical applications, the training data maintained in the database 130 may not necessarily come from the collection of the data collection device 160, and may also be received from other devices. In addition, it should be noted that the training device 120 may not necessarily train the target model/rule 101 completely based on the training data maintained by the database 130, and may also obtain training data from the cloud or other places for model training. The above description should not be used as a reference to this application Limitations of Examples.
根据训练设备120训练得到的目标模型/规则101可以应用于不同的系统或设备中,如应用于图3所示的执行设备110,执行设备110可以是终端,如手机终端,平板电脑,笔记本电脑,增强现实(augmented reality,AR)AR/虚拟现实(virtual reality,VR),车载终端等,还可以是服务器或者云端等。在图3中,执行设备110配置输入/输出(input/output,I/O)接口112,用于与外部设备进行数据交互,用户可以通过客户设备140向I/O接口112输入数据,输入数据在本申请实施例中可以包括:待处理的图像。The target model/rule 101 trained according to the training device 120 can be applied to different systems or devices, such as the execution device 110 shown in FIG. 3 , the execution device 110 can be a terminal, such as a mobile phone terminal, a tablet computer, a laptop computer , Augmented reality (AR) AR/virtual reality (VR), vehicle terminal, etc., it can also be a server or cloud. In FIG. 3 , the execution device 110 is configured with an input/output (I/O) interface 112 for data interaction with external devices. The user can input data to the I/O interface 112 through the client device 140, and input data In this embodiment of the present application, the image to be processed may be included.
在执行设备110对输入数据进行预处理,或者在执行设备110的计算模块111执行计算等相关的处理过程中,执行设备110可以调用数据存储系统150中的数据、代码等以用于相应的处理,也可以将相应处理得到的数据、指令等存入数据存储系统150中。When the execution device 110 preprocesses the input data, or the calculation module 111 of the execution device 110 performs calculations and other related processing, the execution device 110 can call the data, codes, etc. in the data storage system 150 for corresponding processing , the data and instructions obtained by corresponding processing may also be stored in the data storage system 150 .
最后,I/O接口112将处理结果,如上述得到的检测结果返回给客户设备140,从而提供给用户。Finally, the I/O interface 112 returns the processing result, such as the detection result obtained above, to the client device 140, thereby providing it to the user.
例如,客户设备140可以为自动驾驶系统中的规划控制单元。For example, client device 140 may be a planning control unit in an automated driving system.
值得说明的是,训练设备120可以针对不同的目标或不同的任务,基于不同的训练数据生成相应的目标模型/规则101,该相应的目标模型/规则101即可以用于实现上述目标或完成上述任务,从而为用户提供所需的结果。It is worth noting that the training device 120 can generate corresponding target models/rules 101 based on different training data for different goals or different tasks, and the corresponding target models/rules 101 can be used to achieve the above-mentioned goals or complete the above-mentioned goals. tasks to provide the user with the desired result.
在图3中所示情况下,用户可以手动给定输入数据,该手动给定可以通过I/O接口112提供的界面进行操作。另一种情况下,客户设备140可以自动地向I/O接口112发送输入数据,如果要求客户设备140自动发送输入数据需要获得用户的授权,则用户可以在客户设备140中设置相应权限。用户可以在客户设备140查看执行设备110输出的结果,具体的呈现形式可以是显示、声音、动作等具体方式。客户设备140也可以作为数据采集端,采集如图所示输入I/O接口112的输入数据及输出I/O接口112的输出结果作为新的样本数据,并存入数据库130。当然,也可以不经过客户设备140进行采集,而是由I/O接口112直接将如图所示输入I/O接口112的输入数据及输出I/O接口112的输出结果,作为新的样本数据存入数据库130。In the case shown in FIG. 3 , the user can manually specify input data, which can be operated through the interface provided by the I/O interface 112 . In another case, the client device 140 can automatically send the input data to the I/O interface 112 . If the user's authorization is required to request the client device 140 to automatically send the input data, the user can set the corresponding permission in the client device 140 . The user can view the result output by the execution device 110 on the client device 140, and the specific presentation form can be a specific manner such as display, sound, and action. The client device 140 can also be used as a data collection terminal to collect the input data of the input I/O interface 112 and the output result of the output I/O interface 112 as new sample data as shown in the figure, and store them in the database 130 . Of course, it is also possible not to collect through the client device 140, but the I/O interface 112 directly uses the input data input into the I/O interface 112 and the output result of the output I/O interface 112 as shown in the figure as a new sample The data is stored in database 130 .
值得注意的是,图3仅是本申请实施例提供的一种系统架构的示意图,图中所示设备、器件、模块等之间的位置关系不构成任何限制,例如,在图3中,数据存储系统150相对执行设备110是外部存储器,在其它情况下,也可以将数据存储系统150置于执行设备110中。It is worth noting that FIG. 3 is only a schematic diagram of a system architecture provided by an embodiment of the present application, and the positional relationship among the devices, devices, modules, etc. shown in the figure does not constitute any limitation. For example, in FIG. 3 , the data The storage system 150 is an external memory relative to the execution device 110 , and in other cases, the data storage system 150 may also be placed in the execution device 110 .
如图3所示,根据训练设备120训练得到目标模型/规则101,该目标模型/规则101在本申请实施例中可以是感知网络。As shown in FIG. 3 , a target model/rule 101 is obtained by training according to the training device 120 , and the target model/rule 101 may be a perceptual network in this embodiment of the present application.
由于CNN是一种非常常见的神经网络,下面结合图4重点对CNN的结构进行详细的介绍。如上文的基础概念介绍所述,卷积神经网络是一种带有卷积结构的深度神经网络,是一种深度学习(deep learning)架构,深度学习架构是指通过神经网络模型更新的算法, 在不同的抽象层级上进行多个层次的学习。作为一种深度学习架构,CNN是一种前馈(feed-forward)人工神经网络,该前馈人工神经网络中的各个神经元可以对输入其中的图像作出响应。Since CNN is a very common neural network, the structure of CNN will be introduced in detail in conjunction with Figure 4 below. As mentioned in the introduction to the basic concepts above, a convolutional neural network is a deep neural network with a convolutional structure. It is a deep learning architecture. A deep learning architecture refers to an algorithm updated through a neural network model. Multiple levels of learning at different levels of abstraction. As a deep learning architecture, CNN is a feed-forward artificial neural network in which individual neurons can respond to images fed into it.
本申请实施例的图像识别方法具体采用的神经网络的结构可以如图4所示。在图4中,卷积神经网络(CNN)200可以包括输入层210,卷积层/池化层220(其中池化层为可选的),以及全连接层(fully connected layer)230。其中,输入层210可以获取待处理图像,并将获取到的待处理图像交由卷积层/池化层220以及后面的全连接层230进行处理,可以得到图像的处理结果。下面对图4中的CNN200中内部的层结构进行详细的介绍。The structure of the neural network specifically adopted by the image recognition method of the embodiment of the present application may be as shown in FIG. 4 . In FIG. 4 , a convolutional neural network (CNN) 200 may include an input layer 210 , a convolutional/pooling layer 220 (where the pooling layer is optional), and a fully connected layer 230 . The input layer 210 can obtain the image to be processed, and submit the obtained image to be processed by the convolutional layer/pooling layer 220 and the fully connected layer 230 for processing, and the processing result of the image can be obtained. The internal layer structure of CNN200 in Figure 4 is described in detail below.
卷积层/池化层220:Convolutional layer/pooling layer 220:
卷积层:Convolutional layer:
如图4所示卷积层/池化层220可以包括如示例221-226层,举例来说:在一种实现中,221层为卷积层,222层为池化层,223层为卷积层,224层为池化层,225为卷积层,226为池化层;在另一种实现方式中,221、222为卷积层,223为池化层,224、225为卷积层,226为池化层。即卷积层的输出可以作为随后的池化层的输入,也可以作为另一个卷积层的输入以继续进行卷积操作。As shown in FIG. 4, the convolutional/pooling layer 220 may include layers 221-226 as examples, for example: in one implementation, layer 221 is a convolutional layer, layer 222 is a pooling layer, and layer 223 is a convolutional layer Layer 224 is a pooling layer, 225 is a convolutional layer, and 226 is a pooling layer; in another implementation, 221 and 222 are convolutional layers, 223 are pooling layers, and 224 and 225 are convolutional layers. layer, 226 is the pooling layer. That is, the output of a convolutional layer can be used as the input of a subsequent pooling layer, or it can be used as the input of another convolutional layer to continue the convolution operation.
下面将以卷积层221为例,介绍一层卷积层的内部工作原理。The following will take the convolutional layer 221 as an example to introduce the inner working principle of a convolutional layer.
卷积层221可以包括很多个卷积算子,卷积算子也称为核,其在图像处理中的作用相当于一个从输入图像矩阵中提取特定信息的过滤器,卷积算子本质上可以是一个权重矩阵,这个权重矩阵通常被预先定义,在对图像进行卷积操作的过程中,权重矩阵通常在输入图像上沿着水平方向一个像素接着一个像素(或两个像素接着两个像素……这取决于步长stride的取值)的进行处理,从而完成从图像中提取特定特征的工作。该权重矩阵的大小应该与图像的大小相关,需要注意的是,权重矩阵的纵深维度(depth dimension)和输入图像的纵深维度是相同的,在进行卷积运算的过程中,权重矩阵会延伸到输入图像的整个深度。因此,和一个单一的权重矩阵进行卷积会产生一个单一纵深维度的卷积化输出,但是大多数情况下不使用单一权重矩阵,而是应用多个尺寸(行×列)相同的权重矩阵,即多个同型矩阵。每个权重矩阵的输出被堆叠起来形成卷积图像的纵深维度,这里的维度可以理解为由上面所述的“多个”来决定。不同的权重矩阵可以用来提取图像中不同的特征,例如一个权重矩阵用来提取图像边缘信息,另一个权重矩阵用来提取图像的特定颜色,又一个权重矩阵用来对图像中不需要的噪点进行模糊化等。该多个权重矩阵尺寸(行×列)相同,经过该多个尺寸相同的权重矩阵提取后的卷积特征图的尺寸也相同,再将提取到的多个尺寸相同的卷积特征图合并形成卷积运算的输出。The convolution layer 221 may include many convolution operators. The convolution operator is also called a kernel. Its role in image processing is equivalent to a filter that extracts specific information from the input image matrix. The convolution operator is essentially Can be a weight matrix, which is usually pre-defined, usually one pixel by one pixel (or two pixels by two pixels) along the horizontal direction on the input image during the convolution operation on the image. ...It depends on the value of the stride step) to process, so as to complete the work of extracting specific features from the image. The size of the weight matrix should be related to the size of the image. It should be noted that the depth dimension of the weight matrix is the same as the depth dimension of the input image. During the convolution operation, the weight matrix will be extended to Enter the entire depth of the image. Therefore, convolution with a single weight matrix will result in a single depth dimension of the convolutional output, but in most cases a single weight matrix is not used, but multiple weight matrices of the same size (row × column) are applied, That is, multiple isotype matrices. The output of each weight matrix is stacked to form the depth dimension of the convolutional image, where the dimension can be understood as determined by the "multiple" described above. Different weight matrices can be used to extract different features in the image. For example, one weight matrix is used to extract image edge information, another weight matrix is used to extract specific colors of the image, and another weight matrix is used to extract unwanted noise in the image. Blur, etc. The multiple weight matrices have the same size (row×column), and the size of the convolution feature maps extracted from the multiple weight matrices with the same size is also the same, and then the multiple extracted convolution feature maps with the same size are combined to form The output of the convolution operation.
这些权重矩阵中的权重值在实际应用中需要经过大量的训练得到,通过训练得到的权重值形成的各个权重矩阵可以用来从输入图像中提取信息,从而使得卷积神经网络200进行正确的预测。The weight values in these weight matrices need to be obtained through a lot of training in practical applications, and each weight matrix formed by the weight values obtained by training can be used to extract information from the input image, so that the convolutional neural network 200 can make correct predictions .
当卷积神经网络200有多个卷积层的时候,浅层的卷积层(例如221)往往提取较多的一般特征,该一般特征也可以称之为低级别的特征;随着卷积神经网络200深度的加深,越往后的卷积层(例如226)提取到的特征越来越复杂,比如高级别的语义之类的特征,语义越高的特征越适用于待解决的问题。When the convolutional neural network 200 has multiple convolutional layers, the shallow convolutional layers (such as 221) often extract more general features, which can also be called low-level features; As the depth of the neural network 200 deepens, the features extracted by the later convolutional layers (eg, 226) become more and more complex, such as features such as high-level semantics. Features with higher semantics are more suitable for the problem to be solved.
池化层:Pooling layer:
由于常常需要减少训练参数的数量,因此卷积层之后常常需要周期性的引入池化层,在如图4中220所示例的221-226各层,可以是一层卷积层后面跟一层池化层,也可以是多层卷积层后面接一层或多层池化层。在图像处理过程中,池化层的唯一目的就是减少图像的空间大小。池化层可以包括平均池化算子和/或最大池化算子,以用于对输入图像进行采样得到较小尺寸的图像。平均池化算子可以在特定范围内对图像中的像素值进行计算产生平均值作为平均池化的结果。最大池化算子可以在特定范围内取该范围内值最大的像素作为最大池化的结果。另外,就像卷积层中用权重矩阵的大小应该与图像尺寸相关一样,池化层中的运算符也应该与图像的大小相关。通过池化层处理后输出的图像尺寸可以小于输入池化层的图像的尺寸,池化层输出的图像中每个像素点表示输入池化层的图像的对应子区域的平均值或最大值。Since it is often necessary to reduce the number of training parameters, it is often necessary to periodically introduce a pooling layer after the convolutional layer. In the layers 221-226 exemplified by 220 in Figure 4, it can be a convolutional layer followed by a layer. The pooling layer can also be a multi-layer convolutional layer followed by one or more pooling layers. During image processing, the only purpose of pooling layers is to reduce the spatial size of the image. The pooling layer may include an average pooling operator and/or a max pooling operator for sampling the input image to obtain a smaller size image. The average pooling operator can calculate the pixel values in the image within a certain range to produce an average value as the result of average pooling. The max pooling operator can take the pixel with the largest value within a specific range as the result of max pooling. Also, just as the size of the weight matrix used in the convolutional layer should be related to the size of the image, the operators in the pooling layer should also be related to the size of the image. The size of the output image after processing by the pooling layer can be smaller than the size of the image input to the pooling layer, and each pixel in the image output by the pooling layer represents the average or maximum value of the corresponding sub-region of the image input to the pooling layer.
全连接层230:Fully connected layer 230:
在经过卷积层/池化层220的处理后,卷积神经网络200还不足以输出所需要的输出信息。因为如前所述,卷积层/池化层220只会提取特征,并减少输入图像带来的参数。然而为了生成最终的输出信息(所需要的类信息或其他相关信息),卷积神经网络200需要利用全连接层230来生成一个或者一组所需要的类的数量的输出。因此,在全连接层230中可以包括多层隐含层(如图4所示的231、232至23n)以及输出层240,该多层隐含层中所包含的参数可以根据具体的任务类型的相关训练数据进行预先训练得到,例如该任务类型可以包括图像识别,图像分类,图像超分辨率重建等等。After being processed by the convolutional layer/pooling layer 220, the convolutional neural network 200 is not sufficient to output the required output information. Because as mentioned before, the convolutional layer/pooling layer 220 only extracts features and reduces the parameters brought by the input image. However, in order to generate the final output information (required class information or other relevant information), the convolutional neural network 200 needs to utilize the fully connected layer 230 to generate one or a set of outputs of the required number of classes. Therefore, the fully connected layer 230 may include multiple hidden layers (231, 232 to 23n as shown in FIG. 4) and the output layer 240, and the parameters contained in the multiple hidden layers may be based on specific task types The relevant training data is pre-trained, for example, the task type can include image recognition, image classification, image super-resolution reconstruction and so on.
在全连接层230中的多层隐含层之后,也就是整个卷积神经网络200的最后层为输出层240,该输出层240具有类似分类交叉熵的损失函数,具体用于计算预测误差,一旦整个卷积神经网络200的前向传播(如图4由210至240方向的传播为前向传播)完成,反向传播(如图4由240至210方向的传播为反向传播)就会开始更新前面提到的各层的权重值以及偏差,以减少卷积神经网络200的损失,即卷积神经网络200通过输出层输出的结果和理想结果之间的误差。After the multi-layer hidden layers in the fully connected layer 230, that is, the last layer of the entire convolutional neural network 200 is the output layer 240, the output layer 240 has a loss function similar to the classification cross entropy, and is specifically used to calculate the prediction error, Once the forward propagation of the entire convolutional neural network 200 (as shown in Fig. 4, the propagation from the direction 210 to 240 is forward propagation) is completed, the back propagation (as shown in Fig. 4, the propagation from the 240 to 210 direction is the back propagation) will be Start to update the weight values and biases of the aforementioned layers to reduce the loss of the convolutional neural network 200, that is, the error between the result output by the convolutional neural network 200 through the output layer and the ideal result.
需要说明的是,图4所示的卷积神经网络仅作为一种可能的卷积神经网络的示例,在具体的应用中,卷积神经网络还可以以其他网络模型的形式存在。It should be noted that the convolutional neural network shown in FIG. 4 is only used as an example of a possible convolutional neural network, and in specific applications, the convolutional neural network may also exist in the form of other network models.
图5为本申请实施例提供的一种芯片的硬件结构,该芯片包括神经网络处理器50。该芯片可以被设置在如图3所示的执行设备110中,用以完成计算模块111的计算工作。该芯片也可以被设置在如图3所示的训练设备120中,用以完成训练设备120的训练工作并输出目标模型/规则101。本申请实施例中的方法可在如图5所示的芯片中得以实现。FIG. 5 is a hardware structure of a chip provided by an embodiment of the application, and the chip includes a neural network processor 50 . The chip can be set in the execution device 110 as shown in FIG. 3 to complete the calculation work of the calculation module 111 . The chip can also be set in the training device 120 as shown in FIG. 3 to complete the training work of the training device 120 and output the target model/rule 101 . The methods in the embodiments of the present application may be implemented in the chip as shown in FIG. 5 .
神经网络处理器NPU 50作为协处理器挂载到主中央处理器(central processing unit,CPU)(host CPU)上,由主CPU分配任务。NPU的核心部分为运算电路503,控制器504控制运算电路503提取存储器(权重存储器或输入存储器)中的数据并进行运算。The neural network processor NPU 50 is mounted on the main central processing unit (CPU) (host CPU) as a coprocessor, and tasks are allocated by the main CPU. The core part of the NPU is the operation circuit 503, and the controller 504 controls the operation circuit 503 to extract the data in the memory (weight memory or input memory) and perform operations.
在一些实现中,运算电路503内部包括多个处理单元(process engine,PE)。在一些实现中,运算电路503是二维脉动阵列。运算电路503还可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路503是通用的矩阵处理器。In some implementations, the arithmetic circuit 503 includes multiple processing units (process engines, PEs). In some implementations, arithmetic circuit 503 is a two-dimensional systolic array. The arithmetic circuit 503 may also be a one-dimensional systolic array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, arithmetic circuit 503 is a general-purpose matrix processor.
举例来说,假设有输入矩阵A,权重矩阵B,输出矩阵C。运算电路从权重存储器502中取矩阵B相应的数据,并缓存在运算电路中每一个PE上。运算电路从输入存储器501 中取矩阵A数据与矩阵B进行矩阵运算,得到的矩阵的部分结果或最终结果,保存在累加器(accumulator)508中。For example, suppose there is an input matrix A, a weight matrix B, and an output matrix C. The operation circuit fetches the data corresponding to the matrix B from the weight memory 502 and buffers it on each PE in the operation circuit. The arithmetic circuit fetches the data of matrix A and matrix B from the input memory 501 to perform matrix operation, and stores the partial result or final result of the matrix in an accumulator 508 .
向量计算单元507可以对运算电路的输出做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。例如,向量计算单元507可以用于神经网络中非卷积/非FC层的网络计算,如池化(pooling),批归一化(batch normalization,BN),局部响应归一化(local response normalization)等。The vector calculation unit 507 can further process the output of the arithmetic circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison and so on. For example, the vector computing unit 507 can be used for network computation of non-convolutional/non-FC layers in the neural network, such as pooling (pooling), batch normalization (BN), local response normalization (local response normalization) )Wait.
在一些实现种,向量计算单元能507将经处理的输出的向量存储到统一缓存器506。例如,向量计算单元507可以将非线性函数应用到运算电路503的输出,例如累加值的向量,用以生成激活值。在一些实现中,向量计算单元507生成归一化的值、合并值,或二者均有。在一些实现中,处理过的输出的向量能够用作到运算电路503的激活输入,例如用于在神经网络中的后续层中的使用。In some implementations, vector computation unit 507 can store the processed output vectors to unified buffer 506 . For example, the vector calculation unit 507 may apply a nonlinear function to the output of the arithmetic circuit 503, such as a vector of accumulated values, to generate activation values. In some implementations, vector computation unit 507 generates normalized values, merged values, or both. In some implementations, the vector of processed outputs can be used as activation input to the arithmetic circuit 503, eg, for use in subsequent layers in a neural network.
本申请实施例提供的感知网络的运算可以由运算电路503或向量计算单元507执行。The operation of the perceptual network provided by the embodiment of the present application may be performed by the operation circuit 503 or the vector calculation unit 507 .
统一存储器506用于存放输入数据以及输出数据。Unified memory 506 is used to store input data and output data.
权重数据直接通过存储单元访问控制器505(direct memory access controller,DMAC)将外部存储器中的输入数据搬运到输入存储器501和/或统一存储器506、将外部存储器中的权重数据存入权重存储器502,以及将统一存储器506中的数据存入外部存储器。The weight data directly transfers the input data in the external memory to the input memory 501 and/or the unified memory 506 through the storage unit access controller 505 (direct memory access controller, DMAC), and stores the weight data in the external memory into the weight memory 502, And the data in the unified memory 506 is stored in the external memory.
总线接口单元(bus interface unit,BIU)510,用于通过总线实现主CPU、DMAC和取指存储器509之间进行交互。A bus interface unit (BIU) 510 is used to realize the interaction between the main CPU, the DMAC and the instruction fetch memory 509 through the bus.
与控制器504连接的取指存储器(instruction fetch buffer)509,用于存储控制器504使用的指令;The instruction fetch memory (instruction fetch buffer) 509 connected with the controller 504 is used to store the instructions used by the controller 504;
控制器504,用于调用指存储器509中缓存的指令,实现控制该运算加速器的工作过程。The controller 504 is used for invoking the instructions cached in the memory 509 to control the working process of the operation accelerator.
一般地,统一存储器506,输入存储器501,权重存储器502以及取指存储器509均为片上(On-Chip)存储器,外部存储器为该NPU外部的存储器,该外部存储器可以为双倍数据率同步动态随机存储器(double data rate synchronous dynamic random access memory,DDR SDRAM)、高带宽存储器(high bandwidth memory,HBM)或其他可读可写的存储器。Generally, the unified memory 506, the input memory 501, the weight memory 502 and the instruction fetch memory 509 are all on-chip (On-Chip) memories, and the external memory is the memory outside the NPU, and the external memory can be double data rate synchronous dynamic random access Memory (double data rate synchronous dynamic random access memory, DDR SDRAM), high bandwidth memory (high bandwidth memory, HBM) or other readable and writable memory.
上文中介绍的图3中的执行设备110或图5中的芯片能够执行本申请实施例的物体识别方法的各个步骤。上文中介绍的图3中的训练设备120或图5中的芯片能够执行本申请实施例的感知网络的训练方法的各个步骤。The execution device 110 in FIG. 3 or the chip in FIG. 5 described above can execute each step of the object recognition method of the embodiment of the present application. The training device 120 in FIG. 3 or the chip in FIG. 5 described above can perform various steps of the training method for the perceptual network according to the embodiment of the present application.
如图6所示,本申请实施例提供了一种系统架构300。该系统架构包括本地设备301、本地设备302以及执行设备310和数据存储系统350,其中,本地设备301和本地设备302通过通信网络与执行设备310连接。As shown in FIG. 6 , an embodiment of the present application provides a system architecture 300 . The system architecture includes a local device 301, a local device 302, an execution device 310 and a data storage system 350, wherein the local device 301 and the local device 302 are connected with the execution device 310 through a communication network.
在一种实现方式中,执行设备310可以由一个或多个服务器实现。可选的,执行设备310可以与其它计算设备配合使用,例如:数据存储器、路由器、负载均衡器等设备。执行设备310可以布置在一个物理站点上,或者分布在多个物理站点上。执行设备310可以使用数据存储系统350中的数据,或者调用数据存储系统350中的程序代码来实现本申请实施例的感知网络的训练方法。In one implementation, execution device 310 may be implemented by one or more servers. Optionally, the execution device 310 may be used in conjunction with other computing devices, such as data storage, routers, load balancers and other devices. The execution device 310 may be arranged on one physical site, or distributed across multiple physical sites. The execution device 310 may use the data in the data storage system 350 or call the program code in the data storage system 350 to implement the training method of the perception network in this embodiment of the present application.
具体地,在一种实现方式中,感知网络包括:候选区域生成网络RPN,RPN用于预 测样本图像中的目标物体的候选二维2D框的位置信息,目标物体包括多个任务的待检测的物体,多个任务中的每个任务包括至少一个类别;目标物体包括第一任务物体和第二任务物体。Specifically, in an implementation manner, the perception network includes: a candidate region generation network RPN, where the RPN is used to predict the position information of the candidate two-dimensional 2D frame of the target object in the sample image, and the target object includes multiple tasks to be detected. Objects, each of the multiple tasks includes at least one category; the target objects include a first task object and a second task object.
执行设备110可以执行以下过程:The execution device 110 may perform the following processes:
获取训练数据,训练数据包括样本图像、样本图像上的第一任务物体的标注数据以及样本图像上的第二任务物体的伪框,标注数据包括第一任务物体的类标签和第一任务物体的标注2D框,第二任务物体的伪框是通过其他感知网络对样本图像进行推理得到的第二任务物体的目标2D框;基于训练数据对感知网络进行训练。Acquire training data, the training data includes the sample image, the label data of the first task object on the sample image, and the pseudo frame of the second task object on the sample image, and the label data includes the class label of the first task object and the first task object. The 2D frame is marked, and the pseudo frame of the second task object is the target 2D frame of the second task object obtained by inferring the sample image through other perceptual networks; the perceptual network is trained based on the training data.
通过上述过程执行设备110能够获取一个感知网络,该感知网络可以用于多种任务的检测。Through the above process execution device 110, a perception network can be acquired, and the perception network can be used for detection of various tasks.
用户可以操作各自的用户设备(例如本地设备301和本地设备302)与执行设备310进行交互。每个本地设备可以表示任何计算设备,例如监控摄像头、个人计算机、计算机工作站、智能手机、平板电脑、智能摄像头、智能汽车或其他类型蜂窝电话、媒体消费设备、可穿戴设备、机顶盒或游戏机等。A user may operate respective user devices (eg, local device 301 and local device 302 ) to interact with execution device 310 . Each local device can represent any computing device, such as a surveillance camera, personal computer, computer workstation, smartphone, tablet, smart camera, smart car or other type of cellular phone, media consumption device, wearable device, set-top box or gaming console, etc. .
每个用户的本地设备可以通过任何通信机制/通信标准的通信网络与执行设备310进行交互,通信网络可以是广域网、局域网、点对点连接等方式,或它们的任意组合。Each user's local device can interact with the execution device 310 through any communication mechanism/standard communication network, which can be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.
在一种实现方式中,本地设备301、本地设备302从执行设备310获取到感知网络的相关参数,将感知网络部署在本地设备301、本地设备302上,利用该感知网络进行目标检测。In an implementation manner, the local device 301 and the local device 302 obtain the relevant parameters of the sensory network from the execution device 310, deploy the sensory network on the local device 301 and the local device 302, and use the sensory network to detect objects.
在另一种实现中,执行设备310上可以直接部署感知网络,执行设备310通过从本地设备301和本地设备302获取待处理的图像,并采用感知网络对待处理的图像进行处理。In another implementation, a perceptual network may be directly deployed on the execution device 310, and the execution device 310 obtains the image to be processed from the local device 301 and the local device 302, and uses the perceptual network to process the image to be processed.
上述执行设备310也可以为云端设备,此时,执行设备310可以部署在云端;或者,上述执行设备310也可以为终端设备,此时,执行设备310可以部署在用户终端侧,本申请实施例对此并不限定。The above execution device 310 may also be a cloud device, in this case, the execution device 310 may be deployed in the cloud; or, the above execution device 310 may also be a terminal device, in this case, the execution device 310 may be deployed on the user terminal side, the embodiment of the present application This is not limited.
示例性地,感知网络可以部署于车载视觉感知设备、平安城市感知设备或安防感知设备上的计算节点上,对待处理的图像进行处理,得到待处理的图像中感兴趣物体的检测结果。例如,计算节点可以为图3中的执行设备110、图5中的执行设备310或本地设备等。Exemplarily, the perception network can be deployed on a computing node on a vehicle-mounted visual perception device, a safe city perception device, or a security perception device to process the image to be processed to obtain the detection result of the object of interest in the image to be processed. For example, the computing node may be the execution device 110 in FIG. 3 , the execution device 310 in FIG. 5 , a local device, or the like.
目前的感知网络大多只能完成一种检测任务,若要实现多种检测任务,通常需要部署不同的网络来实现不同的检测任务。然而,多个感知网络同时运行会导致硬件的功耗增大,降低模型的运行速度。现有的能够完成多种检测任务的感知网络同样存在运行时间较长等问题。例如,如图7所示的多头端(header)多任务的感知网络,该感知网络包括主干网络(backbone)和多个header,每个header包括候选区域生成网络(region proposal network,RPN)、感兴趣区域提取(region of interest align,ROI-Align)模块以及区域卷积神经网络(region convolutional neural networks,RCNN)。RPN生成候选区域(generate proposal)的时间较长,难以应用于对实时性的要求较高的场景中;而且,header的数量随着检测任务的数量的增加而增加,内存消耗、算力以及运算时间均随之迅速增加。很多领域中使用的芯片算力较低,难以部署大型的感知网络,更难以部署多个感知网络。Most of the current perception networks can only complete one detection task. To achieve multiple detection tasks, it is usually necessary to deploy different networks to achieve different detection tasks. However, the simultaneous operation of multiple perception networks will increase the power consumption of the hardware and reduce the running speed of the model. Existing perception networks that can complete a variety of detection tasks also have problems such as long running time. For example, as shown in Figure 7, the multi-header multi-task perception network includes a backbone network (backbone) and multiple headers, and each header includes a region proposal network (RPN), a Region of interest align (ROI-Align) module and region convolutional neural networks (RCNN). It takes a long time for RPN to generate proposals, which is difficult to apply to scenarios with high real-time requirements; moreover, the number of headers increases with the number of detection tasks, and the memory consumption, computing power and computing power increase. time increased rapidly. Chips used in many fields have low computing power, making it difficult to deploy large-scale sensor networks, and even more difficult to deploy multiple sensor networks.
本申请实施例提供一种感知网络,能够减少感知网络中的参数量和计算量,降低硬件的功耗,提高模型的运行速度。The embodiments of the present application provide a perception network, which can reduce the amount of parameters and computation in the perception network, reduce the power consumption of hardware, and improve the running speed of the model.
图8示出了本申请实施例中的一种感知网络的示意图,图8中的感知网络800包括主干网络(backbone)810和头端(header)。FIG. 8 shows a schematic diagram of a sensor network in an embodiment of the present application. The sensor network 800 in FIG. 8 includes a backbone network (backbone) 810 and a head end (header).
本申请实施例中的感知网络既可以由硬件实现,也可以由软件实现,也可以由软硬件结合实现。The perception network in the embodiments of the present application may be implemented by hardware, software, or a combination of software and hardware.
主干网络810,用于对输入图像进行卷积处理,得到输入图像的第一特征图。The backbone network 810 is configured to perform convolution processing on the input image to obtain the first feature map of the input image.
主干网络810可以通过一系列的卷积处理提取基础特征,为后续的检测提供相应的特征。The backbone network 810 can extract basic features through a series of convolution processing to provide corresponding features for subsequent detection.
本申请实施例中,“第一特征图”指的是由主干网络输出的特征图(feature map)。由主干网络输出的特征图均可以称为第一特征图。In this embodiment of the present application, the "first feature map" refers to a feature map (feature map) output by the backbone network. The feature maps output by the backbone network can all be referred to as first feature maps.
输入图像的第一特征图可以为一个,也可以为多个。There may be one or more first feature maps of the input image.
示例性地,主干网络810可以输出输入图像在不同尺度下的特征图。不同尺度下的特征图均可以理解为输入图像的第一特征图,这些特征图可以为后续的检测提供基础特征。Exemplarily, the backbone network 810 can output feature maps of the input image at different scales. Feature maps at different scales can be understood as the first feature maps of the input image, and these feature maps can provide basic features for subsequent detection.
不同尺度下的特征图可以理解为不同分辨率的特征图,或者说,不同大小的特征图。Feature maps at different scales can be understood as feature maps of different resolutions, or in other words, feature maps of different sizes.
示例性地,主干网络810可以采用多种形式的网络,例如,主干网络810可以采用视觉几何组(visual geometry group,VGG)、残差神经网络(residual neural network,Resnet)或inception网络(inception-net),inception-net即为GoogleNet的核心结构等。Illustratively, the backbone network 810 may adopt various forms of networks, for example, the backbone network 810 may adopt a visual geometry group (VGG), a residual neural network (Resnet) or an inception network (inception- net), inception-net is the core structure of GoogleNet, etc.
header用于根据第二特征图对目标物体进行检测,输出目标物体的目标2维(2dementional,2D)框以及第一指示信息。目标物体包括多个任务中的待检测的物体。第二特征图是根据第一特征图确定的。第一指示信息用于指示目标物体所属类别。The header is used to detect the target object according to the second feature map, and output the target 2-dimensional (2dementional, 2D) frame of the target object and the first indication information. The target objects include objects to be detected in multiple tasks. The second feature map is determined from the first feature map. The first indication information is used to indicate the category to which the target object belongs.
也就是说,header用于根据第二特征图实现目标检测,输出目标物体的目标2D框以及该第一指示信息。That is to say, the header is used to realize target detection according to the second feature map, and output the target 2D frame of the target object and the first indication information.
示例性地,第一指示信息可以包括目标物体属于各个类别的置信度。即目标物体所属的类别可以由目标物体属于各个类别的置信度指示。置信度越高,目标物体属于该置信度对应的类别的概率越大。例如,最高置信度对应的类别即为目标物体所属的类别。可替换地,第一指示信息可以为目标物体所属类别。或者,第一指示信息可以包括目标物体所属类别的置信度。各个类别包括多个任务中的物体类别。本申请实施例对第一指示信息的具体形式不做限定。Exemplarily, the first indication information may include confidence that the target object belongs to each category. That is, the category to which the target object belongs can be indicated by the confidence of the target object belonging to each category. The higher the confidence, the greater the probability that the target object belongs to the category corresponding to the confidence. For example, the category corresponding to the highest confidence is the category to which the target object belongs. Alternatively, the first indication information may be a category to which the target object belongs. Alternatively, the first indication information may include the confidence level of the category to which the target object belongs. Each category includes object categories in multiple tasks. This embodiment of the present application does not limit the specific form of the first indication information.
一个header可以完成多种任务中的待检测的物体的检测,即用于检测输入图像中是否存在该多种任务中的待检测的物体。A header can complete the detection of objects to be detected in various tasks, that is, it is used to detect whether there are objects to be detected in the various tasks in the input image.
多种任务也可以理解为多个大类。一个大类包括至少一个类别。或者说,一个大类为至少一个类别的集合。任务的划分标准可以根据需要设定。例如,根据需要检测的物体的相似性将需要检测的物体划分至多个任务中。Multiple tasks can also be understood as multiple categories. A broad category includes at least one category. In other words, a broad category is a collection of at least one category. Task division criteria can be set as needed. For example, the objects to be detected are divided into multiple tasks according to the similarity of the objects to be detected.
将需要检测的物体划分为多个任务。也可以理解为,将需要检测的物体划分为多个大类。各个任务中的物体类别可以是相同的,也可以是不同的。Divide the objects to be detected into multiple tasks. It can also be understood that the objects to be detected are divided into multiple categories. Object categories in each task can be the same or different.
示例性地,根据需要检测的物体的相似性以及训练样本的丰富和稀缺程度,将需要检测的31类物体划分为8个大类,即8个任务,如表1所示。Exemplarily, according to the similarity of the objects to be detected and the richness and scarcity of training samples, the 31 types of objects to be detected are divided into 8 categories, namely 8 tasks, as shown in Table 1.
表1Table 1
需要说明的是,表1中的划分方式仅为示例,在其他实施例中可以采用与表1不同的任务划分方式,本申请实施例对此不做限定。It should be noted that the division manner in Table 1 is only an example, and in other embodiments, a task division manner different from that in Table 1 may be adopted, which is not limited in this embodiment of the present application.
一个header可以用于完成多种目标检测任务。例如,一个header可以完成上述表1中的8个任务,输出目标物体的目标2D框以及目标物体属于该31类物体的置信度。A header can be used to complete a variety of object detection tasks. For example, a header can complete the 8 tasks in Table 1 above, and output the target 2D frame of the target object and the confidence that the target object belongs to the 31 types of objects.
可选地,感知网络800还可以包括与header相连的其他处理模块。其他处理模块用于根据header输出的目标物体的目标2D框得到目标物体的其他检测信息。Optionally, the perception network 800 may further include other processing modules connected to the header. Other processing modules are used to obtain other detection information of the target object according to the target 2D frame of the target object output by the header.
例如,其他处理模块可以根据header输出的目标2D框,在主干网络输出的特征图中提取该目标2D框所在区域的特征,根据提取到的特征完成该目标2D框内的目标物体的3D检测或关键点检测等。For example, other processing modules can extract the features of the area where the target 2D frame is located in the feature map output by the backbone network according to the target 2D frame output by the header, and complete the 3D detection or 3D detection of the target object in the target 2D frame according to the extracted features. Keypoint detection, etc.
应理解,以上仅为示意,其他处理模块为可选模块,可以根据实际需要设置,本申请实施例对此不做限定。It should be understood that the above is only for illustration, and other processing modules are optional modules, which may be set according to actual needs, which are not limited in this embodiment of the present application.
下面对header进行详细描述。The header is described in detail below.
具体地,header包括RPN820、感兴趣区域提取模块830和分类回归网络840。Specifically, the header includes an RPN 820 , a region of interest extraction module 830 and a classification and regression network 840 .
RPN820,用于在第二特征图上预测目标物体所在的区域,并输出与目标物体所在的区域匹配的候选2D框的位置信息,即目标物体的候选2D框的位置信息。目标物体包括多个任务中的待检测的物体,多个任务中的每个任务包括至少一个类别,第二特征图是根据所述第一特征图确定的。RPN820 is used to predict the area where the target object is located on the second feature map, and output the position information of the candidate 2D frame matching the area where the target object is located, that is, the position information of the candidate 2D frame of the target object. The target object includes objects to be detected in multiple tasks, each of the multiple tasks includes at least one category, and the second feature map is determined according to the first feature map.
感兴趣区域提取模块830,用于基于候选2D框的位置信息在第三特征图上提取第一特征信息,第一特征信息为候选2D框所在区域的特征,第三特征图是根据第一特征图确定的。The region of interest extraction module 830 is used to extract the first feature information on the third feature map based on the position information of the candidate 2D frame, the first feature information is the feature of the region where the candidate 2D frame is located, and the third feature map is based on the first feature. Figure is determined.
分类回归网络840,用于对第一特征信息进行处理,输出目标物体的目标2D框以及第一指示信息,目标2D框的数量小于或等于候选2D框的数量,第一指示信息用于指示目标物体所属的类别。The classification and regression network 840 is used to process the first feature information, and output the target 2D frame of the target object and the first indication information, the number of target 2D frames is less than or equal to the number of candidate 2D frames, and the first indication information is used to indicate the target The class to which the object belongs.
例如,如图8所示,分类回归网络可以输出多个任务中的待检测的物体的目标2D框(box)以及类标签(label)。目标物体的类标签可以作为第一指示信息。应理解,图8 中以类标签作为第一指示信息仅为示例,不对本申请实施例的方案构成限定。For example, as shown in Figure 8, the classification and regression network can output the target 2D box (box) and class label (label) of the object to be detected in multiple tasks. The class label of the target object can be used as the first indication information. It should be understood that the use of the class label as the first indication information in FIG. 8 is only an example, and does not constitute a limitation to the solutions of the embodiments of the present application.
本申请实施例中的多个任务共用同一个RPN,该RPN也可以称为单头端多任务RPN。Multiple tasks in this embodiment of the present application share the same RPN, and the RPN may also be referred to as a single-head multi-task RPN.
RPN820可以在第二特征图上预测可能存在目标物体的区域,并给出与可能存在目标物体的区域匹配的框,这些区域可以称为候选区域(proposal),与候选区域匹配的框即为候选2D框。与proposal匹配的框也可以称为proposal的2D框。RPN820 can predict the area where the target object may exist on the second feature map, and give boxes that match the area where the target object may exist. These areas can be called candidate areas (proposal), and the boxes that match the candidate area are candidates. 2D box. The box that matches the proposal can also be called the 2D box of the proposal.
目标物体包括多个任务中的待检测的物体,例如,表1中的8个任务中的待检测的物体,RPN820即用于预测可能存在该8个任务中的待检测的物体的区域。The target object includes objects to be detected in multiple tasks, for example, the objects to be detected in the 8 tasks in Table 1, and the RPN820 is used to predict the regions where the objects to be detected in the 8 tasks may exist.
示例性地,目标物体可以包括感知网络的所有任务中的待检测的物体。也就是说,RPN可以用于预测第二特征图上可能存在的所有任务中的待检测的物体的区域。或者说,该感知网络的所有任务共用同一个RPN。Exemplarily, the target objects may include objects to be detected in all tasks of the perception network. That is, RPN can be used to predict the region of the object to be detected in all tasks that may exist on the second feature map. In other words, all tasks of the perception network share the same RPN.
第二特征图可以为一个,也可以为多个。The second feature map may be one or multiple.
示例性地,第二特征图可以包括第一特征图中的一个或多个。Illustratively, the second feature map may include one or more of the first feature map.
可选地,感知网络800还包括特征金字塔网络(feature pyramid networks,FPN)。Optionally, the perceptual network 800 further includes feature pyramid networks (FPN).
FPN与backbone 810相连,用于对backbone 810输出的特征图进行特征融合,即对输入图像的第一特征图进行特征融合,输出融合后的特征图。融合后的特征图输入至RPN中。在该情况下,第二特征图可以包括融合后的特征图中的一个或多个。The FPN is connected to the backbone 810, and is used to perform feature fusion on the feature map output by the backbone 810, that is, perform feature fusion on the first feature map of the input image, and output the fused feature map. The fused feature map is input into the RPN. In this case, the second feature map may include one or more of the fused feature maps.
具体地,FPN以backbone 810输出的不同尺度的特征图作为输入,通过FPN内部纵向的特征融合以及与backbone 810同层横向的特征融合,生成更具有表达能力的特征图提供给之后的模块,进而提高模型的性能。Specifically, FPN takes the feature maps of different scales output by the backbone 810 as input, and through the internal vertical feature fusion of the FPN and the horizontal feature fusion of the same layer with the backbone 810, a feature map with more expressive ability is generated and provided to the subsequent modules, and then Improve the performance of the model.
也就是说,FPN可以用于实现多尺度的特征融合。That is, FPN can be used to achieve multi-scale feature fusion.
在感知网络不包括FPN的情况下,如图8所示,backbone 810与RPN820连接。In the case where the perception network does not include the FPN, as shown in Figure 8, the backbone 810 is connected to the RPN 820.
感兴趣区域提取模块830用于根据RPN820输出的候选2D框,在第三特征图上扣取候选2D框所在区域的特征。The region of interest extraction module 830 is configured to deduct the feature of the region where the candidate 2D frame is located from the third feature map according to the candidate 2D frame output by the RPN 820 .
示例性地,第三特征图是根据第一特征图确定的,包括:Exemplarily, the third feature map is determined according to the first feature map, including:
在感知网络包括FPN的情况下,第三特征图可以为backbone输出的特征图(即第一特征图)中的一个或FPN输出的融合后的特征图中的一个;In the case where the perceptual network includes FPN, the third feature map may be one of the feature maps output by the backbone (ie, the first feature map) or one of the fused feature maps output by the FPN;
在感知网络不包括FPN的情况下,第三特征图可以为backbone输出的特征图(即第一特征图)中的一个。In the case where the perceptual network does not include the FPN, the third feature map may be one of the feature maps (ie, the first feature map) output by the backbone.
例如,感兴趣区域提取模块830根据RPN820提供的proposal,在backbone或FPN输出的某个特征图上将每个proposal所在区域的特征扣取出来,并且调整大小(resize)到固定的大小,得到每个proposal的特征。For example, the region of interest extraction module 830 deducts the features of the region where each proposal is located from a certain feature map output by the backbone or FPN according to the proposal provided by the RPN 820, and adjusts the size (resize) to a fixed size to obtain each characteristics of a proposal.
示例性地,感兴趣区域提取模块830可以采用感兴趣区域池化(ROI-pooling)、感兴趣区域提取(ROI-Align)、位置敏感的感兴趣区域池化(position sensitive ROI pooling,PS-ROIPOOLING)或位置敏感的感兴趣区域提取(position sensitive ROI align,PS-ROIALIGN)等特征抽取方法。Exemplarily, the region of interest extraction module 830 may adopt region of interest pooling (ROI-pooling), region of interest extraction (ROI-Align), position sensitive region of interest pooling (position sensitive ROI pooling, PS-ROIPOOLING) ) or position sensitive ROI align (PS-ROIALIGN) and other feature extraction methods.
例如,感兴趣区域提取模块830在proposal所在区域采用差值和抽样的方法,扣取出固定分辨率的特征,将扣取出的特征输入后续的模块。For example, the region of interest extraction module 830 adopts the method of difference and sampling in the region where the proposal is located, deducts features of a fixed resolution, and inputs the deducted features into subsequent modules.
可选地,分类回归网络840具体用于:对第一特征信息进行处理,得到候选2D框属于多个任务中的各个类别的置信度;对候选2D框的位置信息进行调整,得到调整后的候 选2D框;根据调整后的候选2D框确定目标2D框;根据目标2D框属于各个类别的置信度确定第一指示信息。Optionally, the classification and regression network 840 is specifically configured to: process the first feature information to obtain the confidence that the candidate 2D frame belongs to each category in the multiple tasks; adjust the position information of the candidate 2D frame to obtain the adjusted 2D frame. The candidate 2D frame; the target 2D frame is determined according to the adjusted candidate 2D frame; the first indication information is determined according to the confidence that the target 2D frame belongs to each category.
示例性地,对候选2D框的位置信息进行调整,使得调整后的候选2D框比候选2D框与实际物体的形状更加匹配,即调整后的候选2D框为更紧致的候选2D框。Exemplarily, the position information of the candidate 2D frame is adjusted so that the adjusted candidate 2D frame matches the shape of the actual object more closely than the candidate 2D frame, that is, the adjusted candidate 2D frame is a more compact candidate 2D frame.
进一步地,对调整后的候选2D框进行框合并操作,得到目标2D框。例如,对调整后的2D框进行非极大值抑制(non maximum suppression,NMS)合并,得到目标2D框。Further, a frame merging operation is performed on the adjusted candidate 2D frame to obtain the target 2D frame. For example, the adjusted 2D boxes are merged with non-maximum suppression (NMS) to obtain the target 2D boxes.
例如,对于表1中的8个任务,分类回归网络840对感兴趣区域提取模块830提供的每个proposal进行细化处理,得到每个proposal属于该8个任务中的31个类别的置信度,同时对每个proposal的2D框的坐标进行调整,得到调整后的候选2D框。进一步地,调整后的候选2D框经过NMS合并后,得到目标2D框以及第一指示信息。候选2D框的数量大于或等于目标2D框的数量。For example, for the 8 tasks in Table 1, the classification and regression network 840 refines each proposal provided by the region of interest extraction module 830 to obtain the confidence that each proposal belongs to 31 categories in the 8 tasks, At the same time, the coordinates of the 2D boxes of each proposal are adjusted to obtain the adjusted candidate 2D boxes. Further, after the adjusted candidate 2D frame is merged by NMS, the target 2D frame and the first indication information are obtained. The number of candidate 2D boxes is greater than or equal to the number of target 2D boxes.
在一种可能的实现方式中,分类回归网络840包括多个第三RCNN,其中,该多个第三RCNN与多个任务一一对应。即每个第三RCNN分别完成不同任务中的待检测的物体的检测。In a possible implementation manner, the classification and regression network 840 includes multiple third RCNNs, wherein the multiple third RCNNs correspond to multiple tasks one-to-one. That is, each third RCNN separately completes the detection of objects to be detected in different tasks.
图9示出了本申请实施例提供的一种感知网络的示意性框图。例如,如图9所示,感知网络包括backbone、FPN、RPN、ROI-Align模块以及n个第三RCNN。FIG. 9 shows a schematic block diagram of a cognitive network provided by an embodiment of the present application. For example, as shown in Figure 9, the perceptual network includes backbone, FPN, RPN, ROI-Align module, and n third RCNNs.
具体地,第三RCNN用于:对候选2D框所在区域的特征进行处理,得到候选2D框属于第三RCNN对应的任务中的物体类别的置信度;对候选2D框的位置信息进行调整,使得调整后的候选2D框。Specifically, the third RCNN is used to: process the features of the area where the candidate 2D frame is located to obtain the confidence level of the object category in the task corresponding to the third RCNN; and adjust the position information of the candidate 2D frame so that The adjusted candidate 2D box.
即该多个第三RCNN中的任一个第三RCNN,可以预测得到候选2D框属于该第三RCNN对应的任务中的物体类别的置信度以及得到调整后的候选2D框。该多个第三RCNN即可得到候选2D框属于各个类别的置信度,以及由各个第三RCNN得到的调整后的候选2D框。That is, any third RCNN among the plurality of third RCNNs can predict the confidence that the candidate 2D frame belongs to the object category in the task corresponding to the third RCNN, and obtain the adjusted candidate 2D frame. The multiple third RCNNs can obtain the confidence of the candidate 2D frame belonging to each category, and the adjusted candidate 2D frame obtained by each third RCNN.
进一步地,调整后的候选2D框经过NMS合并后,得到目标2D框以及第一指示信息。Further, after the adjusted candidate 2D frame is merged by NMS, the target 2D frame and the first indication information are obtained.
例如,第三RCNN1#对应的任务为表1中的车的检测任务,则该第三RCNN1#输出每个proposal属于轿车、卡车和公交车这三个类别的置信度以及调整后的候选2D框。第三RCNN2#对应的任务为表1中的车轮及车灯的检测任务,则该第三RCNN2#输出每个proposal属于车轮和车灯这两个类别的置信度以及调整后的候选2D框。这样,对于任一proposal,由第三RCNN1#和第三RCNN2#处理后一共可以得到五个类别的置信度以及调整后的候选2D框。For example, the task corresponding to the third RCNN1# is the vehicle detection task in Table 1, then the third RCNN1# outputs the confidence that each proposal belongs to the three categories of cars, trucks and buses and the adjusted candidate 2D box . The task corresponding to the third RCNN2# is the detection task of wheels and lights in Table 1, then the third RCNN2# outputs the confidence that each proposal belongs to the two categories of wheels and lights and the adjusted candidate 2D frame. In this way, for any proposal, a total of five categories of confidence and adjusted candidate 2D boxes can be obtained after being processed by the third RCNN1# and the third RCNN2#.
图9中的感知网络用于实现n个任务(task),例如,该n个任务包括图9中的任务0、任务1…任务n-1。n为大于1的整数。n个第三RCNN分别与n个任务一一对应。以任务0为例,任务0对应的第三RCNN输出每个proposal属于任务0中的各个物体类别的置信度以及调整后的候选2D框。n个任务对应的n个第三RCNN分别得到每个proposal属于各自对应的任务中的各个物体类别的置信度,分类回归网络即可得到每个proposal属于各个类别的置信度。The perceptual network in FIG. 9 is used to implement n tasks, for example, the n tasks include task 0, task 1 . . . task n-1 in FIG. 9 . n is an integer greater than 1. The n third RCNNs correspond to each of the n tasks one-to-one. Taking task 0 as an example, the third RCNN corresponding to task 0 outputs the confidence that each proposal belongs to each object category in task 0 and the adjusted candidate 2D box. The n third RCNNs corresponding to the n tasks obtain the confidence of each object category in each corresponding task, and the classification and regression network can obtain the confidence that each proposal belongs to each category.
需要说明的是,图9中的FPN为可选模块。图9中以ROI-Align模块作为感兴趣区域提取模块仅为示例,还可以采用其他方式提取相应特征,具体描述参见前文,此处不再赘述。It should be noted that the FPN in FIG. 9 is an optional module. In FIG. 9 , the ROI-Align module is used as the region of interest extraction module only as an example, and other methods may also be used to extract corresponding features. For a detailed description, please refer to the foregoing description, which will not be repeated here.
在另一种可能的实现方式中,分类回归网络包括第一RCNN,第一RCNN包括隐层、多个子分类全连接层(classification fully connected layers,cls fc)和多个子回归全连接层(regression fully connected layers,reg fc),隐层与多个子分类全连接层相连,隐层与多个子回归全连接层相连,多个子分类全连接层与多个任务一一对应,多个子回归全连接层与多个任务一一对应。In another possible implementation manner, the classification and regression network includes a first RCNN, and the first RCNN includes a hidden layer, multiple sub-classification fully connected layers (classification fully connected layers, cls fc) and multiple sub-regression fully connected layers (regression fully connected layers). connected layers, reg fc), the hidden layer is connected to multiple sub-classification fully connected layers, the hidden layer is connected to multiple sub-regression fully connected layers, multiple sub-classification fully connected layers correspond to multiple tasks one-to-one, and multiple sub-regression fully connected layers are connected to One-to-one correspondence between multiple tasks.
或者说,第一RCNN包括隐层以及与多个任务对应的多个子cls fc和多个子reg fc。每个任务可以具有独立的一个子分类fc和子回归fc。In other words, the first RCNN includes a hidden layer and multiple sub-cls fc and multiple sub-reg fc corresponding to multiple tasks. Each task can have an independent sub-classification fc and sub-regression fc.
图10示出了本申请实施例提供的另一种感知网络的示意性框图。例如,如图10所示,感知网络包括backbone、FPN、RPN、ROI-Align模块以及第一RCNN。FIG. 10 shows a schematic block diagram of another cognitive network provided by an embodiment of the present application. For example, as shown in Figure 10, the perceptual network includes backbone, FPN, RPN, ROI-Align module and the first RCNN.
隐层,用于对第一特征信息进行处理,得到第二特征信息。The hidden layer is used to process the first feature information to obtain the second feature information.
也就是说,隐层用于对候选2D框所在区域的特征进行处理,并将处理后的结果分别输入至多个子分类全连接层和多个子回归全连接层。That is to say, the hidden layer is used to process the features of the region where the candidate 2D box is located, and the processed results are respectively input to multiple sub-classification fully connected layers and multiple sub-regression fully connected layers.
示例性地,隐层可以包括以下至少一种:卷积层或全连接层。由于多个任务共享隐层,隐层中的卷积层也可以称为共享卷积层(shared convolutional,shared conv),隐层中的全连接层也可以称为共享全连接层(shared fully connected layers,shared fc)。Exemplarily, the hidden layer may include at least one of the following: a convolutional layer or a fully connected layer. Since multiple tasks share the hidden layer, the convolutional layer in the hidden layer can also be called a shared convolutional layer (shared convolutional, shared conv), and the fully connected layer in the hidden layer can also be called a shared fully connected layer (shared fully connected layer). layers, shared fc).
子分类全连接层用于根据第二特征信息得到候选2D框属于子分类全连接层对应的任务中的物体类别的置信度。The sub-category fully-connected layer is used to obtain, according to the second feature information, the confidence level that the candidate 2D frame belongs to the object category in the task corresponding to the sub-category fully-connected layer.
子回归全连接层用于根据第二特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。进一步地,子回归全连接层可以通过框合并操作,例如,通过NMS操作去除重复的框,输出更紧致的候选2D框。The sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the second feature information to obtain the adjusted candidate 2D frame. Further, the sub-regression fully connected layer can use box merging operations, such as NMS operations, to remove duplicate boxes and output more compact candidate 2D boxes.
每个任务对应的子分类全连接层和子回归全连接层能够完成该任务中的待检测物体的检测,具体地,子分类全连接层能够输出候选2D框属于该任务中的物体类别的置信度,子回归全连接层能够输出调整后的候选2D框。也就是说一个第一RCNN可以完成多个任务中的待检测的物体的检测。第一RCNN也可以称为单头端多任务RCNN。The sub-category fully-connected layer and the sub-regression fully-connected layer corresponding to each task can complete the detection of the object to be detected in the task. Specifically, the sub-category fully connected layer can output the confidence level that the candidate 2D frame belongs to the object category in the task , the sub-regression fully connected layer can output the adjusted candidate 2D box. That is to say, a first RCNN can complete the detection of objects to be detected in multiple tasks. The first RCNN can also be called a single-head multi-task RCNN.
第一RCNN可以预测得到候选2D框属于该第一RCNN对应的多个任务中的物体类别的置信度以及得到调整后的候选框。The first RCNN can predict the confidence that the candidate 2D frame belongs to the object category in the multiple tasks corresponding to the first RCNN, and obtain the adjusted candidate frame.
例如,第一RCNN对应的多个任务包括表1中的8个任务,则该第一RCNN中包括8个子cls fc和8个reg fc,分别对应于该8个任务,每个子cls fc输出每个proposal属于该子cls fc对应的任务中的物体类别的置信度,每个reg fc输出调整后的候选2D框,这样,第一RCNN即可得到每个proposal属于该8个任务中的31类物体的置信度以及调整后的候选2D框。For example, the multiple tasks corresponding to the first RCNN include 8 tasks in Table 1, then the first RCNN includes 8 sub-cls fc and 8 reg fc, respectively corresponding to the 8 tasks, each sub-cls fc outputs each Each proposal belongs to the confidence level of the object category in the task corresponding to the sub-cls fc, and each reg fc outputs the adjusted candidate 2D frame, so that the first RCNN can obtain that each proposal belongs to the 31 categories in the 8 tasks Object confidence and adjusted candidate 2D boxes.
图10中的感知网络用于实现n个任务(task),例如,该n个任务包括图10中的任务0、任务1…任务n-1。n为大于1的整数。第一RCNN包括隐层以及分别与n个任务对应的n个子cls fc和n个子reg fc。隐层可以包括Shared fc和/或Shared conv。The perceptual network in FIG. 10 is used to implement n tasks, for example, the n tasks include task 0, task 1 . . . task n-1 in FIG. 10 . n is an integer greater than 1. The first RCNN includes a hidden layer and n sub-cls fc and n sub-reg fc corresponding to n tasks, respectively. Hidden layers can include Shared fc and/or Shared conv.
以任务0为例,第一RCNN中任务0对应的子cls fc,输出每个proposal属于任务0中的各个物体类别的置信度,任务0对应的子reg fc输出调整后的候选2D框。这样,n个任务对应的n个子cls fc分别得到每个proposal属于各自对应的任务中的各个物体类别的置信度,第一RCNN即可得到每个proposal属于各个类别的置信度。Taking task 0 as an example, the sub-cls fc corresponding to task 0 in the first RCNN outputs the confidence that each proposal belongs to each object category in task 0, and the sub-reg fc corresponding to task 0 outputs the adjusted candidate 2D frame. In this way, the n sub-cls fc corresponding to the n tasks obtain the confidence that each proposal belongs to each object category in the corresponding task, and the first RCNN can obtain the confidence that each proposal belongs to each category.
需要说明的是,图10中的FPN为可选模块。图10中以ROI-Align模块作为感兴趣区 域提取模块仅为示例,还可以采用其他方式提取相应特征,具体描述参见前文,此处不再赘述。It should be noted that the FPN in Figure 10 is an optional module. In Fig. 10, the ROI-Align module is used as the region of interest extraction module only as an example, and other methods can also be used to extract corresponding features. For the specific description, refer to the foregoing, which will not be repeated here.
在另一种可能的实现方式中,分类回归网络包括第二RCNN,第二RCNN包括隐层、分类全连接层和回归全连接层,隐层与分类全连接层相连,隐层与回归全连接层相连。In another possible implementation manner, the classification and regression network includes a second RCNN, the second RCNN includes a hidden layer, a classification fully connected layer and a regression fully connected layer, the hidden layer is connected to the classification fully connected layer, and the hidden layer is fully connected to the regression layer layers are connected.
图11示出了本申请实施例提供的又一种感知网络的示意性框图。例如,如图11所示,感知网络包括backbone、FPN、RPN、ROI-Align模块以及第二RCNN。FIG. 11 shows a schematic block diagram of yet another cognitive network provided by an embodiment of the present application. For example, as shown in Figure 11, the perceptual network includes backbone, FPN, RPN, ROI-Align module, and a second RCNN.
隐层,用于对第一特征信息进行处理,得到第三特征信息。The hidden layer is used to process the first feature information to obtain the third feature information.
也就是说,隐层用于对候选2D框所在区域的特征进行处理,并将处理后的结果分别输入至分类全连接层和回归全连接层。That is to say, the hidden layer is used to process the features of the region where the candidate 2D box is located, and the processed results are input to the classification fully connected layer and the regression fully connected layer respectively.
示例性地,隐层可以包括以下至少一种:卷积层或全连接层。详细描述可以参见第一RCNN,此处不再赘述。Exemplarily, the hidden layer may include at least one of the following: a convolutional layer or a fully connected layer. For a detailed description, please refer to the first RCNN, which will not be repeated here.
分类全连接层,用于根据第三特征信息得到候选2D框属于各个类别的置信度。The classification fully connected layer is used to obtain the confidence that the candidate 2D frame belongs to each category according to the third feature information.
回归全连接层,用于根据第三特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。进一步地,对调整后的候选2D框进行框合并操作,得到目标2D框。The regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the third feature information to obtain the adjusted candidate 2D frame. Further, a frame merging operation is performed on the adjusted candidate 2D frame to obtain the target 2D frame.
也就是说,一个第二RCNN完成多个任务中的待检测的物体的检测。第二RCNN也可以称为单头端多任务RCNN。That is, a second RCNN completes the detection of objects to be detected in multiple tasks. The second RCNN can also be called a single-head multi-task RCNN.
具体地,分类全连接层是通过将第一RCNN中的多个子分类全连接层进行合并得到的。回归全连接层是通过将第一RCNN中的多个子回归全连接层进行合并得到的。在该情况下,第一特征信息和第三特征信息相同。Specifically, the classification fully connected layer is obtained by merging multiple sub-classification fully connected layers in the first RCNN. The regressive fully connected layer is obtained by merging multiple sub-regressive fully connected layers in the first RCNN. In this case, the first characteristic information and the third characteristic information are the same.
将多个子分类全连接层进行合并可以理解为将多个子分类全连接层的权重矩阵进行拼接。将多个子回归全连接层进行合并可以理解为将多个子回归全连接层的权重矩阵进行拼接。Combining multiple sub-category fully-connected layers can be understood as splicing the weight matrices of multiple sub-category fully-connected layers. Combining multiple sub-regression fully connected layers can be understood as splicing the weight matrices of multiple sub-regression fully connected layers.
第一RCNN可以采用sigmoid函数对子分类fc得到的标签逻辑值(lable logits)进行归一化,相当于对每个类别均进行一次二分类处理,目标物体属于一个类别的置信度与其他类别没有关系,将模型中多个任务的子分类fc合并为一个分类fc,不会影响模型的推理结果,即多个子分类fc的输出和由多个子分类fc合并得到的分类fc的输出是相同的。The first RCNN can use the sigmoid function to normalize the label logits obtained by the sub-category fc, which is equivalent to performing a binary classification process for each category. The relationship between sub-categories fc of multiple tasks in the model is merged into one category fc, which will not affect the inference results of the model, that is, the output of multiple sub-categories fc is the same as the output of the category fc obtained by merging multiple sub-categories fc.
也就是说,第二RCNN和第一RCNN所完成的任务可以是相同的,输出的结果也是相同的。但是,对于NPU等加速器而言,一次仅完成一个矩阵运算,在第一RCNN中,隐层的输出结果需要输入至每个任务对应的子分类fc和子回归fc中进行多次矩阵运算,第一RCNN中的矩阵乘法的次数随着任务数量的增加而增大,执行第二RCNN中的矩阵乘法的次数不受任务数量的影响。也就是说,在第一RCNN和第二RCNN的参数量相同的情况下,执行第二RCNN所需的时间少于执行第一RCNN所需的时间。That is to say, the tasks performed by the second RCNN and the first RCNN can be the same, and the output results are also the same. However, for accelerators such as NPU, only one matrix operation is completed at a time. In the first RCNN, the output of the hidden layer needs to be input to the sub-classification fc and sub-regression fc corresponding to each task for multiple matrix operations. The number of matrix multiplications in the RCNN increases with the number of tasks, and the number of matrix multiplications performed in the second RCNN is not affected by the number of tasks. That is to say, in the case where the parameters of the first RCNN and the second RCNN are the same, the time required to execute the second RCNN is less than the time required to execute the first RCNN.
因此,通过将第一RCNN中多个任务对应的子分类全连接层进行合并得到第二RCNN的分类全连接层,将第一RCNN中多个任务对应的子回归全连接层合并得到第二RCNN的回归全连接层,这样可以减少神经网络加速器中的矩阵乘法的操作次数,对硬件更加友好,进一步减少耗时。Therefore, the classification fully connected layer of the second RCNN is obtained by merging the sub-classification fully connected layers corresponding to multiple tasks in the first RCNN, and the sub-regression fully connected layers corresponding to multiple tasks in the first RCNN are merged to obtain the second RCNN. The regression fully connected layer, which can reduce the number of operations of matrix multiplication in the neural network accelerator, is more friendly to hardware, and further reduces time-consuming.
图11的感知网络用于实现n个任务(task),该n个任务包括图10中的任务0、任务1…任务n-1。n为大于1的整数。第二RCNN包括隐层以及cls fc和reg fc。隐层可以包括Shared fc和/或Shared conv。cls fc可以是由图10中的n个子cls fc合并得到的,reg fc 可以是由图10中的n个子reg fc合并得到的。The perceptual network of FIG. 11 is used to implement n tasks, the n tasks include task 0, task 1 . . . task n-1 in FIG. 10 . n is an integer greater than 1. The second RCNN includes hidden layers and cls fc and reg fc. Hidden layers can include Shared fc and/or Shared conv. cls fc may be obtained by merging n sub-cls fcs in FIG. 10 , and reg fc may be obtained by merging n sub-reg fcs in FIG. 10 .
这样,cls fc可以输出每个proposal属于各个类别的置信度,reg fc可以输出调整后的候选2D框。In this way, cls fc can output the confidence that each proposal belongs to each category, and reg fc can output the adjusted candidate 2D box.
需要说明的是,图11中的FPN为可选模块。图11中以ROI-Align模块作为感兴趣区域提取模块仅为示例,还可以采用其他方式提取相应特征,具体描述参见前文,此处不再赘述。It should be noted that the FPN in Figure 11 is an optional module. In FIG. 11 , the ROI-Align module is used as the region of interest extraction module only as an example, and other methods may also be used to extract corresponding features. For details, refer to the foregoing description, which will not be repeated here.
示例性地,在感知网络的训练过程中,分类回归网络采用第一RCNN,训练完成后,基于第一RCNN得到第二RCNN,即用于推理的感知网络中,分类回归网络可以采用第二RCNN。Exemplarily, in the training process of the perceptual network, the classification and regression network adopts the first RCNN, and after the training is completed, the second RCNN is obtained based on the first RCNN, that is, in the perceptual network used for inference, the classification and regression network can adopt the second RCNN. .
示例性地,图10中的感知网络可以应用于训练侧,训练好的感知网络中的第一RCNN合并后得到图11所示的感知网络,即图11中的模型参数是根据图10中的模型参数得到的。图11中的感知网络可以应用于推理侧,以减少耗时。Exemplarily, the perceptual network in FIG. 10 can be applied to the training side, and the first RCNN in the trained perceptual network is merged to obtain the perceptual network shown in FIG. 11 , that is, the model parameters in FIG. model parameters are obtained. The perceptual network in Figure 11 can be applied to the inference side to reduce time-consuming.
根据本申请实施例的方案,利用一个感知网络完成多种感知任务,多个任务共享一个RPN,由一个RPN预测多个任务中的待检测的物体所在的区域,在保证感知网络性能的同时,降低了感知网络的参数量和计算量,提高了处理效率,有利于部署于实时性要求较高的场景中,同时减小了硬件的压力,节约了成本。According to the solution of the embodiment of the present application, one sensing network is used to complete various sensing tasks, multiple tasks share one RPN, and one RPN predicts the area where the objects to be detected in multiple tasks are located, while ensuring the performance of the sensing network, It reduces the amount of parameters and calculation of the perception network, improves the processing efficiency, is conducive to deployment in scenarios with high real-time requirements, reduces the pressure on hardware, and saves costs.
此外,在本申请实施例的方案中,采用第一RCNN或第二RCNN作为分类回归网络,多个任务共享RCNN的隐层,进一步减少了感知网络的参数量和计算量,提高了处理效率。而且,采用第一RCNN训练时,各个任务对应独立的子分类fc和子回归fc,提高了感知网络的可扩展性,感知网络可以通过增加或减少子分类fc和子回归fc灵活地实现功能配置,即通过增加或减少子分类fc和子回归fc灵活地增加检测任务或减少检测任务。In addition, in the solution of the embodiment of the present application, the first RCNN or the second RCNN is used as the classification and regression network, and multiple tasks share the hidden layer of the RCNN, which further reduces the amount of parameters and calculation of the perception network, and improves the processing efficiency. Moreover, when the first RCNN is used for training, each task corresponds to independent sub-classification fc and sub-regression fc, which improves the scalability of the perception network. Flexibly increase or decrease detection tasks by increasing or decreasing sub-classification fc and sub-regression fc.
此外,在本申请实施例的方案中,对第一RCNN中的多个子分类fc和子回归fc进行合并,采用第二RCNN作为分类回归网络,能够进一步减少矩阵运算的操作,对硬件更加友好,进一步减少了运算耗时,提高了处理效率。In addition, in the solution of the embodiment of the present application, multiple sub-classification fc and sub-regression fc in the first RCNN are combined, and the second RCNN is used as the classification and regression network, which can further reduce the operation of matrix operations, is more friendly to hardware, and further The time-consuming operation is reduced and the processing efficiency is improved.
本申请实施例中的感知网络可以采用现有的训练方法进行训练。The perception network in the embodiment of the present application may be trained by using an existing training method.
然而,采用现有的训练方法进行训练时,若采用全标注的样本数据进行训练,则需要将数据集中的样本图像上存在的所有任务的待检测的物体标注出来,标注成本较大。而且,若需要对感知网络进行扩展,即增加新的任务,则需要将整个数据集中的样本图像重新标注一次,以补充新的任务中的待检测的物体,进一步增加了标注成本,降低了感知网络的可扩展性。However, when using the existing training method for training, if the fully-labeled sample data is used for training, it is necessary to label the objects to be detected for all tasks existing on the sample images in the data set, and the labeling cost is relatively high. Moreover, if the perception network needs to be expanded, that is, to add new tasks, the sample images in the entire dataset need to be re-labeled once to supplement the objects to be detected in the new task, which further increases the labeling cost and reduces the perception. Scalability of the network.
若采用部分标注的样本图像进行训练,一个样本图像上不需要标注所有任务的待检测的物体,能够降低标注成本。然而,由于各个任务共用一个RPN,在训练RPN时,不同任务的训练数据可能会互相抑制,导致RPN无法预测得到所有任务中的待检测的物体的候选区域,进而影响感知网络的准确性。具体地,由于标注数据为部分标注数据,例如,标一个样本图像上仅标注了一个任务的待检测物体的标注数据,那么在采用该任务的待检测的物体的标注数据进行训练时,会调整RPN的参数,以使RPN能够更准确地预测出该任务的待检测的物体的候选2D框,但无法准确预测该样本图像上其他任务的待检测的物体的候选2D框。在采用另一任务的待检测的物体的标注数据进行训练时,会调整该RPN的参数,这样,调整后的RPN可能无法准确预测出其他任务的待检测的物体的候选2D框。 这样,不同的任务的训练数据可能会相互抑制,导致RPN无法预测出图像中所有的目标物体。If some labeled sample images are used for training, it is not necessary to label the objects to be detected for all tasks on a sample image, which can reduce the cost of labeling. However, since each task shares one RPN, when training RPN, the training data of different tasks may inhibit each other, resulting in the inability of RPN to predict the candidate regions of objects to be detected in all tasks, thereby affecting the accuracy of the perception network. Specifically, since the labeling data is partial labeling data, for example, when only labeling the labeling data of the object to be detected for one task is marked on a sample image, when the labeling data of the object to be detected for the task is used for training, adjustments will be made. The parameters of the RPN, so that the RPN can more accurately predict the candidate 2D frame of the object to be detected for this task, but cannot accurately predict the candidate 2D frame of the object to be detected for other tasks on the sample image. When using the labeled data of the object to be detected in another task for training, the parameters of the RPN will be adjusted, so the adjusted RPN may not be able to accurately predict the candidate 2D frame of the object to be detected in other tasks. In this way, the training data of different tasks may suppress each other, causing RPN to fail to predict all the target objects in the image.
本申请实施例提供了一种感知网络的训练方法,利用其它感知网络推理训练集中的样本图像,为样本图像中没有被标注的待检测的物体提供伪框(pseudo bounding boxes,Pseudo Bboxes),进而基于伪框和标注数据共同训练RPN,有利于得到多个任务中的待检测的物体的候选2D框。The embodiment of the present application provides a training method for a perceptual network, which utilizes sample images in the inference training set of other perceptual networks to provide pseudo boxes (pseudo bounding boxes, Pseudo Bboxes) for objects to be detected that are not marked in the sample images, and then The RPN is jointly trained based on pseudo-frames and labeled data, which is beneficial to obtain candidate 2D frames of objects to be detected in multiple tasks.
图12示出了本申请实施例提供的一种感知网络的训练方法1200,方法1200可以由神经网络模型的训练装置来执行,该训练装置可以是云服务设备,也可以是终端设备,例如,电脑、服务器等运算能力足以用来执行神经网络模型的训练方法的装置,也可以是由云服务设备和终端设备构成的系统。示例性地,方法1200可以由图3中的训练设备120、图5中的神经网络处理器50或图6中的执行设备310执行。感知网络包括:RPN,RPN用于预测样本图像中的目标物体的候选2D框的位置信息,目标物体包括多个任务的待检测的物体,多个任务中的每个任务包括至少一个类别。FIG. 12 shows a method 1200 for training a perceptual network provided by an embodiment of the present application. The method 1200 may be performed by a training device for a neural network model, and the training device may be a cloud service device or a terminal device. For example, A device with sufficient computing power to execute the neural network model training method, such as a computer and a server, can also be a system composed of cloud service equipment and terminal equipment. Illustratively, the method 1200 may be performed by the training device 120 in FIG. 3 , the neural network processor 50 in FIG. 5 , or the execution device 310 in FIG. 6 . The perception network includes: RPN, where the RPN is used to predict the position information of the candidate 2D frame of the target object in the sample image, the target object includes objects to be detected for multiple tasks, and each task in the multiple tasks includes at least one category.
可选地,感知网络可以为图8中所示的感知网络。为了避免不必要的重复,在描述训练方法时适当省略相关描述。在训练过程中,将输入图像替换为样本图像即可。Optionally, the sensory network may be the sensory network shown in FIG. 8 . To avoid unnecessary repetition, relevant descriptions are appropriately omitted when describing the training method. During training, just replace the input image with a sample image.
方法1200包括步骤S1210至步骤S1220,下面对步骤S1210至步骤S1220进行说明。The method 1200 includes steps S1210 to S1220, and steps S1210 to S1220 are described below.
S1210,获取训练数据。S1210, acquiring training data.
目标物体包括第一任务物体和第二任务物体。训练数据包括样本图像、样本图像上的第一任务物体的标注数据以及样本图像上的第二任务物体的伪框,标注数据包括第一任务物体的类标签和第一任务物体的标注2D框,第二任务物体的伪框是通过其他感知网络对样本图像进行推理得到的第二任务物体的目标2D框。The target objects include a first task object and a second task object. The training data includes the sample image, the labeling data of the first task object on the sample image, and the pseudo-frame of the second task object on the sample image, and the labeling data includes the class label of the first task object and the labeled 2D frame of the first task object, The pseudo frame of the second task object is the target 2D frame of the second task object obtained by inferring the sample image through other perceptual networks.
标注数据也可以理解为真值(ground truth)。标注的类标签用于指示任务物体所属的真实类别。第一任务物体的标注数据也可以理解为样本图像的标注数据。样本图像的全标注数据包括样本图像上的所有任务中的待检测的物体的类标签和标注2D框。全标注数据中包括所有感兴趣的物体的标注信息。部分标注数据包括该样本图像上的部分任务中的待检测的物体的类标签和标注2D框。部分标注数据中仅包括部分感兴趣的物体的标注信息。Labeled data can also be understood as ground truth. Annotated class labels are used to indicate the true class to which the task object belongs. The labeled data of the first task object can also be understood as the labeled data of the sample image. The fully annotated data of the sample image includes the class labels and annotated 2D boxes of the objects to be detected in all tasks on the sample image. The fully annotated data includes the annotation information of all objects of interest. Part of the annotation data includes the class label and annotated 2D frame of the object to be detected in some tasks on the sample image. Part of the annotation data only includes the annotation information of some objects of interest.
第一任务物体可以包括一个或多个任务中的待检测的物体。该一个或多个任务即为第一任务物体所在的任务。训练集中的不同样本图像中的第一任务物体可以是相同的,也可以是不同的。本申请实施例中的“第一任务物体”中的“第一”仅用于限定样本图像中具有真值的待检测的物体,不具有其他限定作用。The first task objects may include objects to be detected in one or more tasks. The one or more tasks are the tasks where the first task object is located. The first task objects in different sample images in the training set may be the same or different. The "first" in the "first task object" in the embodiment of the present application is only used to define the object to be detected that has a true value in the sample image, and has no other limiting role.
例如,样本图像1#的标注数据为车的标注数据,即样本图像1#中的第一任务物体包括车的检测任务中的待检测的物体,例如,卡车、轿车、公交车等;样本图像2#的标注数据为车轮及车灯的标注数据,即样本图像2#中的第一任务物体包括车轮及车灯的检测任务中的待检测的物体,例如,车轮、车灯等;样本图像3#的标注数据包括车的标注数据和车轮及车灯的标注数据,即样本图像3#中的第一任务物体包括车的检测任务中的物体和车轮及车灯的检测任务中的待检测的物体。For example, the annotation data of sample image 1# is the annotation data of the car, that is, the first task object in the sample image 1# includes the objects to be detected in the detection task of the car, such as trucks, cars, buses, etc.; the sample image The labeled data of 2# is the labeled data of wheels and lights, that is, the first task object in sample image 2# includes the objects to be detected in the detection task of wheels and lights, such as wheels, lights, etc.; sample image The labeling data of 3# includes the labeling data of the car and the labeling data of the wheels and lights, that is, the first task object in the sample image 3# includes the objects in the detection task of the car and the objects to be detected in the detection task of the wheels and lights. object.
也就是说,本申请实施例中的样本图像的标注数据可以为部分标注数据,这样可以进行针对性采集,即针对具体任务采集所需样本图像,无需在每一个样本图像中标出所有任务的待检测的物体,降低了数据的采集成本以及标注成本。此外,采用部分标注数据的方 案具有灵活的扩展性,在增加任务的情况下,只需要提供新增任务的标注数据即可,无需在原有的训练数据的基础上标注出新的待检测的物体。That is to say, the labeling data of the sample images in the embodiments of the present application may be partial labeling data, so that targeted collection can be carried out, that is, the required sample images are collected for specific tasks, and it is not necessary to mark each sample image in each sample image to be marked for all tasks. The detected objects reduce the cost of data collection and labeling. In addition, the scheme using part of the labeled data has flexible scalability. In the case of adding tasks, it is only necessary to provide the labeled data of the new tasks, and there is no need to label new objects to be detected on the basis of the original training data. .
样本图像上的Pseudo Bboxes是通过其他感知网络对样本图像进行推理得到的第二任务物体的目标2D框。样本图像上的Pseudo Bboxes也可以理解为第二任务物体的Pseudo Bboxes。The Pseudo Bboxes on the sample image are the target 2D boxes of the second task object obtained by inferring the sample image through other perceptual networks. The Pseudo Bboxes on the sample image can also be understood as the Pseudo Bboxes of the second task object.
其他感知网络指的是待训练的感知网络以外的其他感知网络。示例性地,其他感知网络可以为多头端多任务的感知网络。Other perceptual networks refer to other perceptual networks than the one to be trained. Exemplarily, the other perceptual network may be a multi-head multi-tasking perceptual network.
例如,采用如图7所示的感知网络对训练集中的样本图像进行推理,得到样本图像的推理结果,推理结果包括样本图像上的目标物体的目标2D框。For example, the perceptual network as shown in FIG. 7 is used to infer the sample images in the training set, and the inference result of the sample image is obtained, and the inference result includes the target 2D frame of the target object on the sample image.
示例性地,其他感知网络也可以包括多个单任务的感知网络。Exemplarily, other perceptual networks may also include multiple single-task perceptual networks.
例如,采用多个单任务的感知网络分别对训练集中的样本图像进行推理,分别得到样本图像的推理结果,每个单任务的感知网络的推理结果包括样本图像上该任务中的待检测的物体的目标2D框,根据该多个单任务的感知网络的推理结果即可得到样本图像上多个任务中的待检测的物体的目标2D框。For example, multiple single-task perceptual networks are used to infer the sample images in the training set respectively, and the inference results of the sample images are obtained respectively. The inference results of each single-task perceptual network include the object to be detected in the task on the sample image. According to the inference results of the multiple single-task perceptual networks, the target 2D frames of the objects to be detected in multiple tasks on the sample image can be obtained.
第二任务物体可以包括一个或多个任务中的待检测的物体。该一个或多个任务即为第二任务物体所在的任务。第二任务物体和第一任务物体中可能存在相同的待检测的物体。训练集中的不同样本图像中的第二任务物体可以是相同的,也可以是不同的。本申请实施例中的“第二任务物体”中的“第二”仅用于限定样本图像中具有伪框的待检测的物体,不具有其他限定作用。The second task objects may include objects to be detected in one or more tasks. The one or more tasks are the tasks where the second task object is located. The same object to be detected may exist in the second task object and the first task object. The second task objects in different sample images in the training set can be the same or different. The "second" in the "second task object" in the embodiment of the present application is only used to define the object to be detected with a pseudo frame in the sample image, and has no other limiting role.
示例性地,在第一任务物体和第二任务物体中存在相同的待检测的物体的情况下,以标注数据中的标注框作为RPN的目标输出。标注数据通常是人为标注的数据,标注数据的准确性通常高于其他感知网络推理得到的伪框,以标注框作为目标输出,能够提高训练模型的准确性。Exemplarily, in the case that the same object to be detected exists in the first task object and the second task object, the annotation frame in the annotation data is used as the target output of the RPN. Labeled data is usually human-labeled data, and the accuracy of labeling data is usually higher than that of pseudo-frames obtained by inference from other perception networks. Using labelled frames as the target output can improve the accuracy of the training model.
例如,感知网络需要完成的多个任务包括表1中的8个任务,样本图像1#的标注数据为车的标注数据,样本图像1#中的第一任务物体包括车的检测任务中的待检测的物体,例如,卡车、轿车和公交车,即样本图像1#的标注数据为部分标注数据。通过其他感知网络对样本图像1#进行推理,得到第二任务物体的目标2D框,即伪框。例如,通过用于完成表1中的除了车的检测任务之外的7个任务的7个单任务感知网络对样本图像1#进行推理,得到第二任务物体的目标2D框,在该情况下,第二任务物体可以包括表1中的除了车的检测任务之外的7个任务中的物体。再如,如图7所示的多头端多任务的感知网络可以用于完成表1中的8个任务,利用该感知网络对样本图像1#进行推理,可以得到第二任务物体的目标2D框,在该情况下,第二任务物体可以包括表1中的8个任务中的待检测的物体。这样,伪框和标注框合并后即可得到样本图像1#中的8个任务中的待检测的物体所在区域。For example, the multiple tasks that the perception network needs to complete include the 8 tasks in Table 1, the labeled data of the sample image 1# is the labeled data of the car, and the first task object in the sample image 1# includes the object to be detected in the car detection task. The detected objects, such as trucks, cars and buses, that is, the labeled data of sample image 1# are part of the labeled data. The sample image 1# is reasoned through other perceptual networks to obtain the target 2D frame of the second task object, that is, the pseudo frame. For example, the sample image 1# is inferred by 7 single-task perception networks used to complete the 7 tasks except the car detection task in Table 1, and the target 2D frame of the second task object is obtained, in this case , the second task object may include objects in the seven tasks in Table 1 except for the vehicle detection task. For another example, the multi-head and multi-task perceptual network shown in Figure 7 can be used to complete the 8 tasks in Table 1. Using the perceptual network to infer the sample image 1#, the target 2D frame of the second task object can be obtained. , in this case, the second task object may include the objects to be detected in the eight tasks in Table 1. In this way, the regions where the objects to be detected are located in the eight tasks in the sample image 1# can be obtained after the pseudo frame and the annotation frame are combined.
利用伪框补充样本图像中未被标注的待检测的物体,避免RPN基于部分标注数据进行训练时,不同任务的部分标注数据之间互相抑制,影响RPN的训练,提高RPN的召回率,有利于在RPN预测出所有需要检测的任务中的待检测的物体所在区域。Use pseudo-frames to supplement the unlabeled objects to be detected in the sample image, so as to avoid that when the RPN is trained based on the partial labeled data, the partial labeled data of different tasks will inhibit each other, which will affect the training of the RPN and improve the recall rate of the RPN, which is beneficial to The RPN predicts the area where the object to be detected is located in all tasks that need to be detected.
进一步地,其他感知网络对样本图像进行推理,可以得到样本图像上的第二任务物体的目标2D框以及第二任务物体所属类别的置信度。在该置信度大于或等于第一阈值的情 况下,将其他感知网络推理得到的样本图像上的第二任务物体的目标2D框作为样本图像上的伪框。也就是说,在该置信度大于或等于第一阈值的情况下,利用其它感知网络的推理结果进行训练。Further, other perceptual networks perform reasoning on the sample image, and can obtain the target 2D frame of the second task object on the sample image and the confidence level of the category to which the second task object belongs. When the confidence is greater than or equal to the first threshold, the target 2D frame of the second task object on the sample image obtained by other perceptual network inferences is used as the pseudo frame on the sample image. That is, when the confidence level is greater than or equal to the first threshold, the inference results of other perceptual networks are used for training.
示例性地,可以采用低阈值进行过滤。例如,第一阈值为0.05,即置信度大于或等于0.05的目标2D框可以作为样本图像上的伪框,与标注数据一起参与感知网络的训练。应理解,第一阈值可以根据需要设置,本申请实施例对此不做限定。Illustratively, a low threshold may be used for filtering. For example, the first threshold is 0.05, that is, the target 2D frame with a confidence level greater than or equal to 0.05 can be used as a pseudo frame on the sample image to participate in the training of the perceptual network together with the labeled data. It should be understood that the first threshold may be set as required, which is not limited in this embodiment of the present application.
S1220,基于训练数据对感知网络进行训练。S1220, train the perception network based on the training data.
具体地,步骤S1220可以包括步骤S1221至步骤S1223。Specifically, step S1220 may include steps S1221 to S1223.
S1221,根据第一任务物体的标注2D框和第二任务物体的目标2D框与RPN预测得到的样本图像中的目标物体的候选2D框之间的差异计算第一损失函数值。S1221: Calculate a first loss function value according to the difference between the marked 2D frame of the first task object and the target 2D frame of the second task object and the candidate 2D frame of the target object in the sample image predicted by the RPN.
也就是说,第一任务物体的标注2D框和第二任务物体的目标2D框与RPN预测得到的目标物体的候选2D框进行比较,得到RPN阶段的损失函数值,即第一损失函数值。That is to say, the labeled 2D frame of the first task object and the target 2D frame of the second task object are compared with the candidate 2D frame of the target object predicted by RPN, and the loss function value of the RPN stage is obtained, that is, the first loss function value.
基于样本图像执行感知网络的前向传播,由RPN预测得到样本图像上的目标物体的候选2D框,具体的前向传播过程参见图8,此处不再赘述。The forward propagation of the perceptual network is performed based on the sample image, and the candidate 2D frame of the target object on the sample image is predicted by the RPN. The specific forward propagation process is shown in FIG. 8 and will not be repeated here.
S1222,根据样本图像的标注数据计算感知网络的第二损失函数值。S1222: Calculate a second loss function value of the perceptual network according to the labeled data of the sample image.
感知网络的第二损失函数值即为感知网络中所需训练的部分的第二损失函数值。感知网络中所需训练的部分包括分类回归网络中所需训练的部分、感兴趣区域提取模块、RPN和主干网络,分类回归网络中所需训练的部分是根据第一任务物体确定的。The second loss function value of the perceptual network is the second loss function value of the part of the perceptual network that needs to be trained. The part to be trained in the perception network includes the part to be trained in the classification and regression network, the region of interest extraction module, the RPN and the backbone network, and the part to be trained in the classification and regression network is determined according to the first task object.
感知网络中所需训练的部分指的是感知网络中由样本图像确定的所需训练的部分。The part of the perceptual network that needs to be trained refers to the part of the perceptual network that needs to be trained as determined by the sample images.
分类回归网络可以预测得到候选2D框属于各个类别的置信度以及目标物体的目标2D框。The classification and regression network can predict the confidence that the candidate 2D box belongs to each category and the target 2D box of the target object.
具体地,RPN预测得到目标物体的候选2D框后,由感兴趣区域提取模块在特征图上扣取出候选2D框的特征,候选2D框的特征输入分类回归网络中所需训练的部分,得到候选2D框属于第一任务物体所对应的任务中的物体类别的置信度。分类回归网络中所需训练的部分是根据第一任务物体确定的。或者说,分类回归网络中所需训练的部分是根据第一任务物体所在的任务确定的。Specifically, after RPN predicts and obtains the candidate 2D frame of the target object, the region of interest extraction module deducts the features of the candidate 2D frame from the feature map, and the features of the candidate 2D frame are input into the part to be trained in the classification and regression network, and the candidate 2D frame is obtained. Confidence that the 2D box belongs to the object category in the task corresponding to the first task object. The part of the classification and regression network that needs to be trained is determined according to the first task object. In other words, the part to be trained in the classification and regression network is determined according to the task where the first task object is located.
可选地,分类回归网络包括多个第三RCNN,分类回归网络中所需训练的部分包括第一任务物体所在的任务对应的第三RCNN。Optionally, the classification and regression network includes a plurality of third RCNNs, and the part to be trained in the classification and regression network includes the third RCNN corresponding to the task where the first task object is located.
示例性地,感知网络可以如图9所示。样本图像1#(样本图像的一例)中的第一任务物体所在的任务包括车的检测任务,第一任务物体包括车的检测任务中的待检测的物体。候选2D框的特征输入与车的检测任务对应的第三RCNN中,进而得到该候选2D框属于轿车、卡车和公交车这三个类别的置信度,以及目标2D框。对于样本图像1#而言,分类回归网络中所需训练的部分即为车的检测任务对应的第三RCNN。Exemplarily, the perception network may be as shown in FIG. 9 . The task where the first task object in the sample image 1# (an example of the sample image) is located includes a vehicle detection task, and the first task object includes an object to be detected in the vehicle detection task. The features of the candidate 2D box are input into the third RCNN corresponding to the vehicle detection task, and then the confidence level of the candidate 2D box belonging to the three categories of cars, trucks and buses, and the target 2D box are obtained. For sample image 1#, the part to be trained in the classification and regression network is the third RCNN corresponding to the vehicle detection task.
可选地,分类回归网络包括第一RCNN,分类回归网络中所需训练的部分包括第一RCNN中的隐层和第一任务物体所在的任务对应的子分类fc和子回归fc。Optionally, the classification and regression network includes a first RCNN, and the part to be trained in the classification and regression network includes the hidden layer in the first RCNN and the sub-classification fc and sub-regression fc corresponding to the task where the first task object is located.
示例性地,感知网络可以如图10所示。样本图像1#中的第一任务物体所在的任务包括车的检测任务,第一任务物体包括车的检测任务中的待检测的物体。候选2D框的特征经过第一RCNN中的隐层后输入与车的检测任务对应的子分类fc和子回归fc中,进而得到该候选2D框属于轿车、卡车和公交车这三个类别的置信度,以及目标2D框。对于样 本图像1#而言,分类回归网络中所需训练的部分即为第一RCNN中的隐层以及车的检测任务对应的子分类fc和子回归fc。Exemplarily, the perception network can be as shown in FIG. 10 . The task where the first task object in the sample image 1# is located includes the detection task of the car, and the first task object includes the object to be detected in the detection task of the car. The features of the candidate 2D box are input into the sub-classification fc and sub-regression fc corresponding to the vehicle detection task after passing through the hidden layer in the first RCNN, and then the confidence level of the candidate 2D box belonging to the three categories of cars, trucks and buses is obtained. , and the target 2D box. For the sample image 1#, the part that needs to be trained in the classification and regression network is the hidden layer in the first RCNN and the sub-classification fc and sub-regression fc corresponding to the car detection task.
将样本图像的标注数据与分类回归网络的输出结果进行比较,得到分类回归网络阶段的第一任务物体所在的任务的损失函数值,即第二损失函数值。也就是说,不计算样本图像的标注数据没有涉及到的其他任务的损失。The labeled data of the sample image is compared with the output result of the classification and regression network, and the loss function value of the task where the first task object in the classification and regression network stage is located, that is, the second loss function value is obtained. That is, the loss of other tasks not involved in the annotation data of the sample images is not calculated.
S1223,基于第一损失函数值和第二损失函数值进行反向传播,调整感知网络中所需训练的部分的参数。S1223: Perform backpropagation based on the first loss function value and the second loss function value, and adjust the parameters of the part of the perception network that needs to be trained.
基于第一损失函数值反向传播,计算与第一损失函数值相关的参数的梯度,进而基于参数的梯度调整与第一损失函数值相关的参数,实现对感知网络的调整,以使RPN能够更全面地预测候选框。Based on the back-propagation of the first loss function value, the gradient of the parameter related to the first loss function value is calculated, and then the parameter related to the first loss function value is adjusted based on the gradient of the parameter, so as to realize the adjustment of the perceptual network, so that the RPN can Predict candidate boxes more comprehensively.
与第一损失函数值相关的参数即为计算得到第一损失函数值的过程中所利用的感知网络中的参数,例如,backbone的参数以及RPN的参数。进一步地,在感知网络包括FPN的情况下,与第一损失函数值相关的参数还包括FPN。The parameters related to the first loss function value are the parameters in the perceptual network used in the process of obtaining the first loss function value, for example, the parameters of the backbone and the parameters of the RPN. Further, in the case where the perceptual network includes FPN, the parameter related to the value of the first loss function also includes FPN.
基于第二损失函数值反向传播,计算与第二损失函数值相关的参数的梯度,进而基于参数的梯度调整与第二损失函数值相关的参数,实现对感知网络的调整,以使分类回归网络能够更好地修正输出的2D框,提高类别预测的准确性。Based on the back-propagation of the second loss function value, the gradient of the parameter related to the second loss function value is calculated, and then the parameter related to the second loss function value is adjusted based on the gradient of the parameter to realize the adjustment of the perceptual network, so that the classification regression The network can better correct the output 2D box and improve the accuracy of category prediction.
与第二损失函数相关的参数即为计算得到第二损失函数值的过程中所利用的感知网络中的参数,例如,backbone的参数、RPN的参数、感兴趣区域提取模块的参数以及分类回归网络中所需训练的部分的参数。进一步地,在感知网络包括FPN的情况下,与第二损失函数值相关的参数还包括FPN。与第二损失函数相关的参数即为感知网络中所需训练的部分的参数。The parameters related to the second loss function are the parameters in the perceptual network used in the process of calculating the value of the second loss function, for example, the parameters of the backbone, the parameters of the RPN, the parameters of the region of interest extraction module, and the classification and regression network. parameters for the part of the training required. Further, in the case where the perceptual network includes FPN, the parameter related to the value of the second loss function also includes FPN. The parameters related to the second loss function are the parameters of the part of the perception network that needs to be trained.
在满足训练终止条件的情况下,则终止训练,得到训练好的感知网络。When the training termination condition is met, the training is terminated, and a trained perceptual network is obtained.
例如,在感知网络收敛的情况下,终止训练,输出训练好的感知网络的权重。For example, when the perceptual network converges, the training is terminated and the weights of the trained perceptual network are output.
应理解,步骤S1221至步骤S1223仅为步骤S1220的一种实现方式,步骤S1220还可以采用其他方式实现。It should be understood that steps S1221 to S1223 are only an implementation manner of step S1220, and step S1220 may also be implemented in other manners.
示例性地,步骤S1220包括以下步骤S1至步骤S3。Exemplarily, step S1220 includes the following steps S1 to S3.
S1,根据第一任务物体的标注2D框和第二任务物体的目标2D框与RPN预测得到的样本图像上的目标物体的候选2D框之间的差异计算第一损失函数值。S1: Calculate a first loss function value according to the difference between the labeled 2D frame of the first task object and the target 2D frame of the second task object and the candidate 2D frame of the target object on the sample image predicted by the RPN.
也就是说,第一任务物体的标注2D框和第二任务物体的目标2D框与RPN预测得到的目标物体的候选2D框进行比较,得到RPN阶段的损失函数值,即第一损失函数值。That is to say, the labeled 2D frame of the first task object and the target 2D frame of the second task object are compared with the candidate 2D frame of the target object predicted by RPN, and the loss function value of the RPN stage is obtained, that is, the first loss function value.
基于样本图像执行感知网络的前向传播,由RPN预测得到样本图像上的目标物体的候选2D框,具体的前向传播过程参见图8,此处不再赘述。The forward propagation of the perceptual network is performed based on the sample image, and the candidate 2D frame of the target object on the sample image is predicted by the RPN. The specific forward propagation process is shown in FIG. 8 and will not be repeated here.
S2,根据样本图像的标注数据、样本图像上的伪框以及样本图像上的第二任务物体的伪标签计算感知网络中所需训练的部分的第二损失函数值,感知网络中所需训练的部分包括分类回归网络中所需训练的部分、感兴趣区域提取模块、RPN和主干网络,分类回归网络中所需训练的部分是根据第一任务物体和第二任务物体确定的。样本图像上的伪标签是通过其他感知网络对所述样本图像进行推理得到的所述样本图像上的第二任务物体的类标签。S2, according to the labeled data of the sample image, the pseudo-frame on the sample image, and the pseudo-label of the second task object on the sample image, the second loss function value of the part to be trained in the perceptual network is calculated, and the value of the second loss function of the part to be trained in the perceptual network is calculated. The part includes the part that needs to be trained in the classification and regression network, the region of interest extraction module, the RPN and the backbone network. The part that needs to be trained in the classification and regression network is determined according to the first task object and the second task object. The pseudo-label on the sample image is the class label of the second task object on the sample image obtained by inferring the sample image through other perceptual networks.
分类回归网络可以预测得到候选2D框属于各个类别的置信度以及目标物体的目标 2D框。The classification and regression network can predict the confidence that the candidate 2D box belongs to each category and the target 2D box of the target object.
具体地,RPN预测得到目标物体的候选2D框后,由感兴趣区域提取模块在特征图上扣取出候选2D框的特征,候选2D框的特征输入分类回归网络中所需训练的部分,得到候选2D框属于第一任务物体所在的任务中的物体类别的置信度以及候选2D框属于第二任务物体所在的任务中的物体类别的置信度。分类回归网络中所需训练的部分是根据第一任务物体和第二任务物体确定的。或者说,分类回归网络中所需训练的部分是根据第一任务物体所在的任务和第二任务物体所在的任务确定的。Specifically, after RPN predicts and obtains the candidate 2D frame of the target object, the region of interest extraction module deducts the features of the candidate 2D frame from the feature map, and the features of the candidate 2D frame are input into the part to be trained in the classification and regression network, and the candidate 2D frame is obtained. The confidence that the 2D box belongs to the object category in the task where the first task object is located, and the confidence level that the candidate 2D box belongs to the object category in the task where the second task object is located. The part of the classification and regression network that needs to be trained is determined according to the first task object and the second task object. In other words, the part to be trained in the classification and regression network is determined according to the task where the first task object is located and the task where the second task object is located.
示例性地,分类回归网络包括多个第三RCNN,例如,感知网络可以如图9所示。样本图像1#中的第一任务物体所在的任务包括车的检测任务,第一任务物体包括车的检测任务中的待检测的物体。候选2D框的特征输入与车的检测任务对应的第三RCNN中,进而得到该候选2D框属于轿车、卡车和公交车这三个类别的置信度,以及目标2D框。样本图像1#中的第二任务物体所在的任务包括车轮及车灯的检测任务,第二任务物体包括车轮及车灯的检测任务中的物体。候选2D框的特征输入与车轮及车灯的检测任务对应的第三RCNN中,进而得到该候选2D框属于车轮、车灯这两个类别的置信度,以及目标2D框。Exemplarily, the classification and regression network includes a plurality of third RCNNs, for example, the perceptual network may be as shown in FIG. 9 . The task where the first task object in the sample image 1# is located includes the detection task of the car, and the first task object includes the object to be detected in the detection task of the car. The features of the candidate 2D box are input into the third RCNN corresponding to the vehicle detection task, and then the confidence level of the candidate 2D box belonging to the three categories of cars, trucks and buses, and the target 2D box are obtained. The task where the second task object in the sample image 1# is located includes the detection task of wheels and lights, and the second task object includes objects in the detection task of wheels and lights. The features of the candidate 2D frame are input into the third RCNN corresponding to the detection task of wheels and lights, and then the confidence of the candidate 2D frame belonging to the two categories of wheels and lights, and the target 2D frame are obtained.
对于样本图像1#而言,分类回归网络中所需训练的部分即为车的检测任务对应的第三RCNN以及车轮和车灯的检测任务对应的第三RCNN。For sample image 1#, the parts to be trained in the classification and regression network are the third RCNN corresponding to the detection task of the car and the third RCNN corresponding to the detection task of the wheels and lights.
示例性地,分类回归网络包括第一RCNN,例如,感知网络可以如图10所示。样本图像1#中的第一任务物体所在的任务包括车的检测任务,第一任务物体包括车的检测任务中的待检测的物体。候选2D框的特征经过第一RCNN中的隐层后输入与车的检测任务对应的子分类fc和子回归fc中,进而得到该候选2D框属于轿车、卡车和公交车这三个类别的置信度,以及目标2D框。样本图像1#中的第二任务物体所在的任务包括车轮及车灯的检测任务,第二任务物体包括车轮及车灯的检测任务中的物体。候选2D框的特征经过第一RCNN中的隐层后输入与车轮及车灯的检测任务对应的子分类fc和子回归fc中,进而得到该候选2D框属于车轮、车灯这两个类别的置信度,以及目标2D框。Exemplarily, the classification and regression network includes the first RCNN, for example, the perceptual network may be as shown in FIG. 10 . The task where the first task object in the sample image 1# is located includes the detection task of the car, and the first task object includes the object to be detected in the detection task of the car. The features of the candidate 2D box are input into the sub-classification fc and sub-regression fc corresponding to the vehicle detection task after passing through the hidden layer in the first RCNN, and then the confidence level of the candidate 2D box belonging to the three categories of cars, trucks and buses is obtained. , and the target 2D box. The task where the second task object in the sample image 1# is located includes the detection task of wheels and lights, and the second task object includes objects in the detection task of wheels and lights. The features of the candidate 2D box are input into the sub-classification fc and sub-regression fc corresponding to the detection task of wheels and lights after passing through the hidden layer in the first RCNN, and then the confidence that the candidate 2D box belongs to the two categories of wheels and lights is obtained. degrees, and the target 2D box.
对于样本图像1#而言,分类回归网络中所需训练的部分包括第一RCNN中的隐层、车的检测任务对应的子分类fc和子回归fc以及车轮和车灯的检测任务对应的子分类fc和子回归fc。For sample image 1#, the parts that need to be trained in the classification and regression network include the hidden layer in the first RCNN, the sub-classification fc and sub-regression fc corresponding to the detection task of the car, and the sub-classification corresponding to the detection task of wheels and lights fc and subregression fc.
将样本图像的标注数据与分类回归网络的输出结果进行比较,得到分类回归网络阶段的第一任务物体对应的任务的损失函数值以及第二任务物体对应的任务的损失函数值,即第二损失函数值。也就是说,不计算样本图像的标注数据以及伪标签没有涉及到的其他任务的损失。Compare the labeled data of the sample image with the output of the classification and regression network, and obtain the loss function value of the task corresponding to the first task object in the classification and regression network stage and the loss function value of the task corresponding to the second task object, that is, the second loss. function value. That is, the loss of the labeled data of the sample image and other tasks not involved in the pseudo-label is not calculated.
S3,基于第一损失函数值和第二损失函数值进行反向传播,调整感知网络中所需训练的部分的参数。S3: Back-propagation is performed based on the first loss function value and the second loss function value, and the parameters of the part to be trained in the perceptual network are adjusted.
基于第一损失函数值反向传播,计算与第一损失函数值相关的参数的梯度,进而基于参数的梯度调整与第一损失函数值相关的参数,实现对感知网络的调整,以使RPN能够更全面地预测候选框。Based on the back-propagation of the first loss function value, the gradient of the parameter related to the first loss function value is calculated, and then the parameter related to the first loss function value is adjusted based on the gradient of the parameter, so as to realize the adjustment of the perceptual network, so that the RPN can Predict candidate boxes more comprehensively.
与第一损失函数值相关的参数即为计算得到第一损失函数值的过程中所利用的感知网络中的参数,例如,backbone的参数以及RPN的参数。进一步地,在感知网络包括FPN 的情况下,与第一损失函数值相关的参数还包括FPN。The parameters related to the first loss function value are the parameters in the perceptual network used in the process of obtaining the first loss function value, for example, the parameters of the backbone and the parameters of the RPN. Further, in the case where the perceptual network includes FPN, the parameter related to the value of the first loss function also includes FPN.
基于第二损失函数值反向传播,计算与第二损失函数值相关的参数的梯度,进而基于参数的梯度调整与第二损失函数值相关的参数,实现对感知网络的调整,以使分类回归网络能够更好地修正输出的2D框,提高类别预测的准确性。Based on the back-propagation of the second loss function value, the gradient of the parameter related to the second loss function value is calculated, and then the parameter related to the second loss function value is adjusted based on the gradient of the parameter to realize the adjustment of the perceptual network, so that the classification regression The network can better correct the output 2D box and improve the accuracy of category prediction.
与第二损失函数相关的参数即为计算得到第二损失函数值的过程中所利用的感知网络中的参数,例如,backbone的参数、RPN的参数、感兴趣区域提取模块的参数以及分类回归网络中所需训练的部分的参数。进一步地,在感知网络包括FPN的情况下,与第二损失函数值相关的参数还包括FPN。与第二损失函数相关的参数即为感知网络中所需训练的部分的参数。The parameters related to the second loss function are the parameters in the perceptual network used in the process of calculating the value of the second loss function, for example, the parameters of the backbone, the parameters of the RPN, the parameters of the region of interest extraction module, and the classification and regression network. parameters for the part of the training required. Further, in the case where the perceptual network includes FPN, the parameter related to the value of the second loss function also includes FPN. The parameters related to the second loss function are the parameters of the part of the perception network that needs to be trained.
在满足训练终止条件的情况下,则终止训练,得到训练好的感知网络。When the training termination condition is met, the training is terminated, and a trained perceptual network is obtained.
例如,在感知网络收敛的情况下,终止训练,输出训练好的感知网络的权重。For example, when the perceptual network converges, the training is terminated and the weights of the trained perceptual network are output.
根据本申请实施例中的方案,基于伪框和标注数据共同训练感知网络,在标注数据仅包括第一任务物体的标注数据的情况下,即部分标注数据的情况下,提供第二任务物体的伪框,以便在同一个样本图像上提供更全面的待检测的物体的框作为RPN的目标输出,以调整RPN的参数使得RPN的输出不断接近目标数据,避免不同任务之间相互抑制,有利于使RPN得到更全面更准确的候选2D框,同时提高召回率。本申请实施例中的样本图像的标注数据可以为部分标注数据,这样可以进行针对性采集,即针对具体任务采集所需样本图像,无需在每一个样本图像中标出所有任务的待检测的物体,降低了数据的采集成本以及标注成本,有利于均衡不同任务的训练数据。此外,采用部分标注数据的方案具有灵活的扩展性,在增加任务的情况下,只需要提供新增任务的标注数据即可,无需在原有的训练数据的基础上标注出新的待检测的物体。According to the solution in the embodiment of the present application, the perception network is jointly trained based on the pseudo frame and the labeled data, and in the case that the labeled data only includes the labeled data of the first task object, that is, in the case of partial labeled data, the information of the second task object is provided. Pseudo frame, in order to provide a more comprehensive frame of the object to be detected on the same sample image as the target output of the RPN, to adjust the parameters of the RPN so that the output of the RPN is constantly close to the target data, avoiding mutual inhibition between different tasks, which is beneficial to It enables RPN to obtain more comprehensive and accurate candidate 2D boxes, while improving the recall rate. The labeling data of the sample images in the embodiments of the present application may be partial labeling data, so that targeted collection can be performed, that is, the required sample images are collected for specific tasks, and there is no need to mark the objects to be detected for all tasks in each sample image. It reduces the cost of data collection and the cost of labeling, which is conducive to balancing the training data of different tasks. In addition, the scheme using part of the labeled data has flexible scalability. In the case of adding tasks, it is only necessary to provide the labeled data of the new tasks, and there is no need to label new objects to be detected on the basis of the original training data. .
而且,根据本申请实施例中的方案,感知网络中不同任务共享的部分,例如主干网络、RPN、感兴趣区域提取模块等,在基于不同任务的标注数据进行训练的过程中均参与训练,这样能够使得感知网络中不同任务共享的部分学习到各个任务的共有特征。感知网络中不同任务对应的不同部分,例如,分类回归网络中各个任务对应的部分,仅在基于各自的任务的标注数据进行训练的过程中参与训练,能够使得感知网络中不同任务对应的不同部分可以学习到其任务特定的特征,提高了模型的准确性。同时,在训练过程中,分类回归网络中所需训练的部分是根据任务确定的,不同任务对应的分类回归网络中的不同部分在训练过程中互不影响,保证了各个任务的独立性,使得模型具有较强的灵活性。Moreover, according to the solution in the embodiment of the present application, the parts of the perception network that are shared by different tasks, such as the backbone network, RPN, the region of interest extraction module, etc., all participate in the training process based on the labeled data of different tasks, so that It enables the parts shared by different tasks in the perceptual network to learn the common features of each task. Different parts corresponding to different tasks in the perception network, for example, the parts corresponding to each task in the classification and regression network, only participate in the training process based on the labeled data of the respective tasks, which can make different parts corresponding to different tasks in the perception network. Its task-specific features can be learned, improving the accuracy of the model. At the same time, in the training process, the part of the classification and regression network that needs to be trained is determined according to the task, and different parts of the classification and regression network corresponding to different tasks do not affect each other during the training process, ensuring the independence of each task, making The model has strong flexibility.
图13示出了本申请实施例提供的一种感知网络的训练方法,图13所示的方法可以视为图12所示方法的一种具体实现方式,相关描述可以参见方法1200中的描述,为了避免不必要的重复,在描述方法1300时做适当省略。FIG. 13 shows a training method of a perceptual network provided by an embodiment of the present application. The method shown in FIG. 13 may be regarded as a specific implementation of the method shown in FIG. 12 . For related descriptions, refer to the description in method 1200 . In order to avoid unnecessary repetition, appropriate omissions are made when describing the method 1300 .
下面以ADAS/ADS的视觉感知系统为例,对本申请实施例的方案进行详细的介绍。ADAS/ADS的视觉感知系统中需要进行多种任务的目标检测,例如:动态障碍物、静态障碍物、交通标志、交通灯、路面标志(比如,左转标志或直行标志灯)以及斑马线等。The solution of the embodiment of the present application is described in detail below by taking the visual perception system of ADAS/ADS as an example. The visual perception system of ADAS/ADS needs to perform target detection for various tasks, such as: dynamic obstacles, static obstacles, traffic signs, traffic lights, road signs (such as left turn signs or straight signs) and zebra crossings.
采用本申请实施例中的方案,能够在一个感知网络中完成上述多种任务的目标检测,下面对本申请实施例的方案进行详细描述。By adopting the solutions in the embodiments of the present application, the target detection of the above-mentioned various tasks can be completed in one sensing network. The solutions in the embodiments of the present application are described in detail below.
下面以表1的任务划分为例对本申请实施例中的感知网络的训练方法进行详细描述。The training method of the perceptual network in the embodiment of the present application is described in detail below by taking the task division in Table 1 as an example.
在开始训练前准备训练数据,目标物体包括第一任务物体和第二任务物体,训练数据 包括样本图像、样本图像上的第一任务物体的标注数据以及样本图像上的第二任务物体的伪框,标注数据包括第一任务物体的类标签和第一任务物体的标注2D框。Prepare training data before starting training. The target objects include the first task object and the second task object. The training data includes the sample image, the annotation data of the first task object on the sample image, and the pseudo frame of the second task object on the sample image. , the annotation data includes the class label of the first task object and the labeled 2D frame of the first task object.
根据表1的任务划分,为各任务提供标注数据。例如,为task0的训练过程提供车的标注数据,在数据集中的一个或多个样本图像上标注出Car/Truck/Bus的2D框以及类标签;为task1的训练提供人的标注数据,在数据集中的一个或多个样本图像上标注出Pedestrian/Cyclist/Tricycle的2D框以及类标签;为task2提供车轮及车灯的标注数据,在数据集中的一个或多个样本图像上标注出Wheel/Car_light的2D框以及类标签,为task3提供交通灯的标注数据,在数据集中的一个或多个样本图像上标注出TrafficLight_Red/Yellow/Green/Black的2D框以及类标签,以此类推。这样,每个样本图像至少具备一种任务的标注数据。According to the task division in Table 1, labeled data is provided for each task. For example, provide the labeling data of the car for the training process of task0, mark the 2D frame and class label of Car/Truck/Bus on one or more sample images in the dataset; provide the labeling data of the person for the training of task1, in the data One or more sample images in the set are marked with the 2D frame and class label of Pedestrian/Cyclist/Tricycle; the annotation data of wheels and lights are provided for task2, and Wheel/Car_light is marked on one or more sample images in the dataset The 2D box and class label of TrafficLight_Red/Yellow/Green/Black are marked on one or more sample images in the dataset, and the 2D box and class label of TrafficLight_Red/Yellow/Green/Black are marked for task3, and so on. In this way, each sample image has annotated data for at least one task.
在一种可能的实现方式中,样本图像中包括所有感兴趣的物体的标注信息。也就是说,在每一张样本图像中将所有感兴趣的物体标注出来。示例性地,感兴趣的物体即为表1中的8个大类中的待检测的物体。In a possible implementation manner, the sample image includes annotation information of all objects of interest. That is, all objects of interest are annotated in each sample image. Exemplarily, the object of interest is the object to be detected in the eight categories in Table 1.
在另一种可能的实现方式中,每一种标注数据只需要标注特定类型的物体即可。也就是说,每个样本图像的标注数据可以为部分标注数据。In another possible implementation, each type of annotation data only needs to annotate a specific type of object. That is, the labeled data of each sample image may be partial labeled data.
示例性地,每个样本图像上仅标注一个任务中的待检测的物体的类标签和2D框。Exemplarily, only the class label and 2D frame of the object to be detected in one task are marked on each sample image.
或者,每个样本图像上也可以标注多个任务中的待检测的物体的类标签和2D框,即提供混合标注的数据。例如,在样本图像上同时标注Car/Truck/Bus/Pedestrian/Cyclist/Tricycle的2D框以及类标签。这样,就可以利用该训练数据同时训练两个任务对应的感知网络中所需训练的部分。Alternatively, class labels and 2D boxes of objects to be detected in multiple tasks can also be labeled on each sample image, that is, to provide mixed labeled data. For example, label the 2D box and class label of Car/Truck/Bus/Pedestrian/Cyclist/Tricycle at the same time on the sample image. In this way, the training data can be used to train the required training part of the perceptual network corresponding to the two tasks at the same time.
示例性地,可以为每个样本图像指定任务标签,任务标签可以用于指示该样本图像用于训练感知网络中的所需训练的部分。Illustratively, a task label may be assigned to each sample image, and the task label may be used to indicate that the sample image is used to train the required training portion of the perceptual network.
通过上述方式即可得到样本图像的标注数据。示例性地,标注数据可以存储于标注文件中。标注文件即ground truth文件。The labeled data of the sample image can be obtained in the above manner. Illustratively, the annotation data may be stored in an annotation file. The annotation file is the ground truth file.
通过其他感知网络对样本图像进行推理,得到推理结果。推理结果包括样本图像上的Pseudo Bboxes。Pseudo Bboxes可以用于补全样本图像的标注数据中没有标注的属于其他任务的待检测的物体。示例性地,推理结果可以存储于推理结果文件中。推理结果文件即Pseudo Bboxes文件。The sample images are inferred through other perceptual networks, and the inference results are obtained. Inference results include Pseudo Bboxes on sample images. Pseudo Bboxes can be used to complement objects to be detected belonging to other tasks that are not labeled in the labeled data of the sample image. Illustratively, the inference result may be stored in an inference result file. The inference result file is the Pseudo Bboxes file.
每个样本图像均可以对应一个标注文件和一个推理结果文件。在一种可能的实现方式中,样本图像的标注数据中的标注2D框和Pseudo Bboxes合并后可以得到样本图像上所有任务中的待检测的物体的2D框。Each sample image can correspond to an annotation file and an inference result file. In a possible implementation manner, the labeled 2D boxes in the labeled data of the sample image and the Pseudo Bboxes can be combined to obtain the 2D boxes of the objects to be detected in all tasks on the sample image.
例如,利用多头端多任务的感知网络对样本图像进行推理,得到推理结果。For example, using a multi-head multi-task perceptual network to infer sample images to obtain inference results.
再如,利用多个单任务的感知网络分别对样本图像进行推理,得到多个任务的推理结果,将多个任务的推理结果融合到一起。For another example, use multiple single-task perceptual networks to infer the sample images respectively, obtain the inference results of multiple tasks, and fuse the inference results of multiple tasks together.
进一步地,推理结果还包括样本图像上的第二任务物体所属类别的置信度。采用低阈值对推理结果进行过滤。即过滤掉置信度小于第一阈值的推理结果。使得用于训练的Pseudo Bboxes对应的置信度均大于或等于第一阈值。例如,第一阈值为0.05。Further, the inference result also includes the confidence level of the category to which the second task object on the sample image belongs. A low threshold is used to filter the inference results. That is, inference results whose confidence is less than the first threshold are filtered out. The confidence levels corresponding to the Pseudo Bboxes used for training are all greater than or equal to the first threshold. For example, the first threshold is 0.05.
基于部分标注数据和Pseudo Bboxes训练感知网络。具体地,方法1300包括步骤S1310至步骤S1350。A perceptual network is trained based on partially labeled data and Pseudo Bboxes. Specifically, the method 1300 includes steps S1310 to S1350.
S1310,获取训练数据。S1310, acquiring training data.
将训练数据输入感知网络中,训练数据包括样本图像、样本图像上的第一任务物体的标注数据以及样本图像上的第二任务物体的伪框。The training data is input into the perception network, and the training data includes a sample image, annotated data of the first task object on the sample image, and a pseudo frame of the second task object on the sample image.
例如,将样本图像、样本图像对应的标注文件和Pseudo Bboxes文件输入感知网络中。For example, input the sample image, the annotation file corresponding to the sample image, and the Pseudo Bboxes file into the perceptual network.
步骤S1310与方法1200中的步骤S1210对应,具体描述详见步骤S1210。Step S1310 corresponds to step S1210 in the method 1200. For details, please refer to step S1210.
基于训练数据执行感知网络的前向传播。Perform forward propagation of the perceptual network based on the training data.
示例性地,根据表1中的任务划分方式,训练过程中采用的感知网络的结构如图14所示。如图14所示,感知网络包括:backbone、RPN、感兴趣区域提取模块和第一RCNN。图14所示的感知网络可以视为图10所示的感知网络的一种具体实现方式。图14中的感知网络能够同时完成表1中的8个大类的目标检测。或者说,图14中的感知网络能够同时完成表1中的8种任务的目标检测。具体地,图14中的第一RCNN中的8个子分类fc和子回归fc同时完成表1中的8个大类的2D目标检测。从图14中可以看出,本申请的感知网络可以根据业务的需求,对第一RCNN中的分类fc和回归fc进行灵活地增加或删减,从而训练得到能够实现不同数量的任务的目标检测的感知网络。Exemplarily, according to the task division method in Table 1, the structure of the perceptual network used in the training process is shown in Figure 14. As shown in Figure 14, the perceptual network includes: backbone, RPN, region of interest extraction module and first RCNN. The sensory network shown in FIG. 14 can be regarded as a specific implementation of the sensory network shown in FIG. 10 . The perceptual network in Figure 14 can simultaneously complete the object detection of the 8 categories in Table 1. In other words, the perceptual network in Figure 14 can simultaneously complete the target detection of the eight tasks in Table 1. Specifically, the 8 sub-classifications fc and the sub-regression fc in the first RCNN in Figure 14 simultaneously complete the 2D object detection of the 8 categories in Table 1. It can be seen from Figure 14 that the perceptual network of the present application can flexibly add or delete the classification fc and regression fc in the first RCNN according to the needs of the business, so as to train to obtain target detection that can achieve different numbers of tasks perception network.
S1320,利用标注数据和Pseudo Bboxes计算RPN阶段的loss。S1320, use the labeled data and Pseudo Bboxes to calculate the loss in the RPN stage.
样本图像的标注数据包括第一任务物体的标注2D框和类标签。样本图像上的Pseudo Bboxes包括第二任务物体的Pseudo Bboxes。The labeled data of the sample image includes the labeled 2D box and the class label of the first task object. The Pseudo Bboxes on the sample image include the Pseudo Bboxes of the second task object.
步骤S1320包括:利用第一任务物体的标注2D框和第二任务物体的Pseudo Bboxes计算RPN阶段的loss,即第一损失函数值。Step S1320 includes: using the labeled 2D box of the first task object and the Pseudo Bboxes of the second task object to calculate the loss in the RPN stage, that is, the first loss function value.
例如,将Pseudo Bboxes文件中置信度大于或等于0.05的Pseudo Bboxes与标注数据中的标注2D框合并,得到样本图像上所有目标物体的2D框。将所有目标物体的2D框和RPN预测得到的候选2D框进行比较,得到RPN阶段的损失函数值,即第一损失函数值。For example, merge the Pseudo Bboxes with confidence greater than or equal to 0.05 in the Pseudo Bboxes file with the annotated 2D boxes in the annotation data to obtain the 2D boxes of all target objects on the sample image. The 2D boxes of all target objects are compared with the candidate 2D boxes predicted by RPN, and the loss function value of the RPN stage is obtained, that is, the first loss function value.
步骤S1320与方法1200中的步骤S1221对应,具体描述详见步骤S1221。Step S1320 corresponds to step S1221 in the method 1200. For details, please refer to step S1221.
S1330,利用标注数据计算分类回归网络阶段的loss。S1330, using the labeled data to calculate the loss in the classification and regression network stage.
样本图像根据其标注的数据类型可以分属于一个或多个任务,或者说,样本图像根据其第一任务物体对应的任务可以分属于一个或多个任务。比如一张样本图像中仅标注交通标志,则该样本图像只属于交通标志这个任务,如果一张样本图像同时标注了人和车,那么该样本图像就属于人和车两个任务。在计算分类回归网络阶段的loss时,只计算当前样本图像所属任务对应的部分的loss,其余任务的loss并不计算。例如,当前输入的样本图像属于人和车的任务,则仅计算人和车对应的部分的loss,其余任务(比如交通灯、交通标志)对应的部分的loss不进行计算。The sample image may belong to one or more tasks according to the data type it is annotated. In other words, the sample image may belong to one or more tasks according to the task corresponding to the first task object. For example, if a sample image is only marked with traffic signs, the sample image only belongs to the task of traffic signs. If a sample image is marked with people and cars at the same time, then the sample image belongs to the two tasks of people and cars. When calculating the loss of the classification and regression network stage, only the loss of the part corresponding to the task to which the current sample image belongs is calculated, and the loss of other tasks is not calculated. For example, if the currently input sample image belongs to the task of people and cars, only the loss of the part corresponding to the person and the car is calculated, and the loss of the part corresponding to the other tasks (such as traffic lights and traffic signs) is not calculated.
例如,如图14所示,感兴趣区域提取模块根据RPN预测得到的候选2D框,在一个特征图上扣取出特征,经过shared fc和shared conv之后进入样本图像所属任务对应的子分类fc和子回归fc中,得到预测结果,即该候选2D框属于该任务中的物体类别的置信度,以及目标2D框。进而将标注数据与预测结果进行比较得到loss,即为该任务对应的分类回归网络阶段的loss。For example, as shown in Figure 14, the region of interest extraction module deducts features from a feature map according to the candidate 2D frame predicted by RPN, and enters the sub-classification fc and sub-regression corresponding to the task of the sample image after shared fc and shared conv In fc, the prediction result is obtained, that is, the confidence that the candidate 2D frame belongs to the object category in the task, and the target 2D frame. Then, compare the labeled data with the prediction result to obtain the loss, which is the loss in the classification and regression network stage corresponding to the task.
若当前样本图像的标注数据仅包括一个任务的标注数据,则该样本图像输入网络中进行训练时,对于第一RCNN中的多个子分类fc和子回归fc而言,仅训练第一RCNN中该任务对应的子分类fc和子回归fc,不影响第一RCNN中其他任务对应的子分类fc和子回 归fc。If the labeled data of the current sample image only includes the labeled data of one task, when the sample image is input to the network for training, for the multiple sub-classification fc and sub-regression fc in the first RCNN, only the task in the first RCNN is trained. The corresponding subclassification fc and subregression fc do not affect the subclassification fc and subregression fc corresponding to other tasks in the first RCNN.
例如,如图14所示,若当前样本图像仅标注了交通灯的2D框,如表1所示,交通灯的任务即为任务3,则训练时,只通过任务3对应的子分类fc和子回归fc得到该样本图像中的交通灯的预测结果,并且和真值进行比较,得到损失值。也就是说,交通灯的样本图像仅经过backbone、RPN、感兴趣区域提取模块以及第一RCNN中的交通灯对应的子分类fc和子回归fc,其他的task对应的子分类fc和子回归fc不参与损失值的计算。For example, as shown in Figure 14, if the current sample image is only marked with the 2D frame of the traffic light, as shown in Table 1, the task of the traffic light is task 3, then during training, only the sub-categories fc and sub-categories corresponding to task 3 are passed. Regression fc obtains the prediction result of the traffic light in the sample image, and compares it with the true value to obtain the loss value. That is to say, the sample image of the traffic light only passes through the backbone, RPN, region of interest extraction module, and the sub-classification fc and sub-regression fc corresponding to the traffic light in the first RCNN, and the sub-classification fc and sub-regression fc corresponding to other tasks are not involved. Calculation of loss value.
若当前样本图像的标注数据包括多个任务的标注数据,则该样本图像输入网络中进行训练时,对于第一RCNN中的多个子分类fc和子回归fc而言,仅训练第一RCNN中该多个任务对应的子分类fc和子回归fc,不影响第一RCNN中其他任务对应的子分类fc和子回归fc。If the labeled data of the current sample image includes the labeled data of multiple tasks, when the sample image is input to the network for training, for the multiple sub-classification fc and sub-regression fc in the first RCNN, only the multiple sub-classification fc and sub-regression fc in the first RCNN are trained The subclassification fc and subregression fc corresponding to each task do not affect the subclassification fc and subregression fc corresponding to other tasks in the first RCNN.
例如,如图14所示,若当前样本图像标注了交通灯的2D框和人的2D框,如表1所示交通灯的任务即为任务3,人的任务即为任务1。训练时,通过任务3对应的子分类fc和子回归fc得到该样本图像中的交通灯的预测结果,通过任务1对应的子分类fc和子回归fc得到该样本图像中的人的预测结果,并且和真值进行比较,得到两个任务对应的损失值。也就是说,样本图像仅经过backbone、RPN、感兴趣区域提取模块、第一RCNN中的task3对应的子分类fc和子回归fc以及第一RCNN中的task1对应的子分类fc和子回归fc。其他的task对应的子分类fc和子回归fc不参与损失值的计算。这样,会得到两个任务对应的分类回归阶段的loss,分类回归阶段的总体的损失值可以为该多个loss的均值。For example, as shown in Figure 14, if the current sample image is marked with a 2D frame of a traffic light and a 2D frame of a person, as shown in Table 1, the task of the traffic light is task 3, and the task of people is task 1. During training, the prediction results of the traffic lights in the sample image are obtained through the sub-classification fc and sub-regression fc corresponding to task 3, and the prediction results of the people in the sample image are obtained through the sub-classification fc and sub-regression fc corresponding to task 1, and the The true values are compared to obtain the loss values corresponding to the two tasks. That is to say, the sample image only passes through the backbone, RPN, region of interest extraction module, sub-classification fc and sub-regression fc corresponding to task3 in the first RCNN, and sub-classification fc and sub-regression fc corresponding to task1 in the first RCNN. The sub-classification fc and sub-regression fc corresponding to other tasks do not participate in the calculation of the loss value. In this way, the losses of the classification and regression stages corresponding to the two tasks will be obtained, and the overall loss value of the classification and regression stages can be the average of the multiple losses.
S1340,梯度回传。S1340, the gradient is returned.
在计算loss后,需要进行梯度回传,即反向传播。After calculating the loss, it is necessary to carry out gradient back-propagation, that is, back-propagation.
基于RPN阶段的loss(第一损失函数值)和分类回归网络的loss(第二损失函数值)反向传播,计算相关参数的梯度,进行梯度回传。Based on the loss (first loss function value) of the RPN stage and the loss (second loss function value) of the classification and regression network backpropagation, the gradient of the relevant parameters is calculated, and the gradient is returned.
在感知网络中感知网络中所需训练的部分进行梯度回传,感知网络中所需训练的部分是根据样本图像所属任务确定的,不在样本图像所属任务对应的部分不参与梯度回传。In the perceptual network, the part that needs to be trained in the perceptual network is subjected to gradient backhaul. The part of the perception network that needs to be trained is determined according to the task to which the sample image belongs, and the part not corresponding to the task to which the sample image belongs does not participate in the gradient backhaul.
例如,如图14所示,梯度沿着样本图像所属任务对应的子分类fc和子回归fc回传,不影响其他任务对应的子分类fc和子回归fc,第一RCNN的shared fc或conv以及RPN和backbone均参与梯度回传。For example, as shown in Figure 14, the gradient is passed back along the sub-class fc and sub-regression fc corresponding to the task to which the sample image belongs, without affecting the sub-class fc and sub-regression fc corresponding to other tasks, the shared fc or conv of the first RCNN and the RPN and Backbone participates in gradient return.
S1350,调整感知网络的参数。S1350, adjust the parameters of the sensing network.
利用回传的梯度更新感知网络中感知网络中所需训练的部分的权重参数。The weight parameters of the part of the perceptual network that need to be trained in the perceptual network are updated using the back-passed gradients.
这样,就可以针对性地调整感知网络中样本图像所属任务对应的部分,使得样本图像所属任务对应的部分能够更好地学习样本图像所属任务。In this way, the part corresponding to the task to which the sample image belongs in the perceptual network can be adjusted in a targeted manner, so that the part corresponding to the task to which the sample image belongs can better learn the task to which the sample image belongs.
S1360,判断感知网络是否收敛。S1360, determine whether the sensing network converges.
若感知网络收敛,则输出感知网络的权重参数。If the perceptual network converges, output the weight parameters of the perceptual network.
若感知网络没有收敛,则转至步骤S1310,继续训练过程。If the perception network does not converge, go to step S1310 to continue the training process.
本申请实施例中的样本图像的标注数据可以为部分标注数据,这样可以进行针对性的采集,即针对具体任务采集所需样本图像,而不用在每一张图片中把所有感兴趣的物体标注处理,降低了数据的采集成本以及标注成本。另外,采用部分标注数据的方案准备训练数据的方式具有很灵活的扩展性,在增加检测任务的情况下,只需要在分类回归网络中增 加该检测任务对应的部分,例如,增加该检测任务对应的子分类fc和子回归fc,并且提供具有新增物体的标注数据的样本图像即可,不需要在原有训练数据的基础上将新增的待检测的物体标注出来。The labeling data of the sample images in the embodiments of the present application may be partial labeling data, so that targeted collection can be performed, that is, the required sample images are collected for specific tasks without labeling all objects of interest in each picture. processing, reducing the cost of data collection and labeling. In addition, the method of preparing training data by using partial labeling data has very flexible scalability. In the case of adding detection tasks, only the part corresponding to the detection task needs to be added to the classification and regression network. For example, adding the corresponding part of the detection task The sub-classification fc and sub-regression fc of the sub-category fc and sub-regression fc are provided, and the sample image with the annotation data of the newly added object can be provided, and the newly added object to be detected is not required to be marked on the basis of the original training data.
而且,利用伪框补充样本图像中未被标注的待检测的物体,避免RPN基于部分标注数据进行训练时,不同任务的部分标注数据之间互相抑制,影响RPN的训练,有利于在RPN预测出所有需要检测的任务中的待检测的物体所在区域。Moreover, the pseudo-frames are used to supplement the unlabeled objects to be detected in the sample images, so as to avoid that when the RPN is trained based on the partial labeled data, the partial labeled data of different tasks will suppress each other, which will affect the training of the RPN, and is conducive to the prediction of the RPN. The area where the object to be detected is located in all tasks that need to be detected.
此外,感知网络中每个任务对应的部分仅检测该任务中的待检测的物体,在训练过程中,可以避免对未标注的其他任务的物体的误伤。此外,使得感知网络中共享部分,例如,backbone、RPN、感兴趣区域提取模块等,学习到各个任务的共有特征,而分类回归网络中各个任务对应的部分学习到任务特定的特征,例如,第一RCNN中的各个任务对应的子分类fc和子回归fc学习到其任务特定的特征。In addition, the part corresponding to each task in the perception network only detects the object to be detected in the task, and during the training process, it can avoid accidental injury to objects of other tasks that are not labeled. In addition, the shared parts in the perception network, such as backbone, RPN, region of interest extraction module, etc., learn the common features of each task, while the parts corresponding to each task in the classification and regression network learn task-specific features, for example, the first The sub-classification fc and sub-regression fc corresponding to each task in an RCNN learn its task-specific features.
本申请实施例还提供了一种物体识别方法1500,方法1500可以由物体识别装置执行。该物体识别装置可以是云服务设备,也可以是终端设备,例如,车辆、无人机、机器人、电脑、服务器或手机等运算能力足以用来执行物体识别方法的装置,还可以是由云服务设备和终端设备构成的系统。示例性地,方法1500可以由图3中的执行设备110、图5中的神经网络处理器50或图6中的执行设备310或本地设备执行。This embodiment of the present application further provides an object recognition method 1500, and the method 1500 can be executed by an object recognition apparatus. The object recognition device may be a cloud service device or a terminal device, for example, a vehicle, drone, robot, computer, server or mobile phone and other devices with sufficient computing power to execute the object recognition method, or a cloud service device. A system consisting of equipment and terminal equipment. For example, the method 1500 may be executed by the execution device 110 in FIG. 3 , the neural network processor 50 in FIG. 5 , or the execution device 310 in FIG. 6 , or a local device.
例如,物体识别方法具体可以由如图3所示的执行设备110执行。For example, the object recognition method may be specifically executed by the execution device 110 shown in FIG. 3 .
可选地,物体识别方法可以由GPU处理,也可以由CPU和GPU共同处理,也可以不用GPU,而使用其他适合用于神经网络计算的处理器,本申请不做限制。Optionally, the object recognition method may be processed by the GPU, or may be jointly processed by the CPU and the GPU, or other processors suitable for neural network computing may be used without using the GPU, which is not limited in this application.
方法1500中采用本申请实施例中的感知网络对图像进行处理,为了避免不必要的重复,下面在介绍方法1500时适当省略重复的描述。In the method 1500, the perceptual network in the embodiment of the present application is used to process the image. In order to avoid unnecessary repetition, the repeated description is appropriately omitted when introducing the method 1500 below.
方法1500包括步骤S1510至步骤S1540,下面对步骤S1510至步骤S1540进行描述。The method 1500 includes steps S1510 to S1540, which are described below.
感知网络包括主干网络、RPN、感兴趣区域提取模块和分类回归网络。The perception network includes backbone network, RPN, region of interest extraction module and classification regression network.
S1510,利用主干网络对输入图像进行卷积处理,输出输入图像的第一特征图。S1510, using the backbone network to perform convolution processing on the input image, and output the first feature map of the input image.
示例性地,输入图像可以是终端设备(或者电脑、服务器等其他装置或设备)通过摄像头拍摄到的图像,或者,输入图像还可以是从终端设备(或者电脑、服务器等其他装置或设备)内部获得的图像(例如,终端设备的相册中存储的图像,或者终端设备从云端获取的图像),本申请实施例对此并不限定。Exemplarily, the input image may be an image captured by a terminal device (or other device or device such as a computer, server, etc.) through a camera, or the input image may also be an image obtained from the terminal device (or other device or device such as a computer, server, etc.) The obtained image (for example, an image stored in an album of the terminal device, or an image obtained by the terminal device from the cloud) is not limited in this embodiment of the present application.
S1520,利用RPN基于第二特征图上输出目标物体的候选二维2D框的位置信息,目标物体包括多个任务中的待检测的物体,多个任务中的每个任务至少包括一个类别,第二特征图是根据第一特征图确定的。S1520, use the RPN to output the position information of the candidate two-dimensional 2D frame of the target object based on the second feature map, the target object includes objects to be detected in multiple tasks, each task in the multiple tasks includes at least one category, and the first The second feature map is determined according to the first feature map.
S1530,利用感兴趣区域提取模块基于候选2D框的位置信息在第三特征图上提取第一特征信息,第一特征信息为候选2D框所在区域的特征,第三特征图是根据第一特征图确定的。S1530, using the region of interest extraction module to extract first feature information on the third feature map based on the position information of the candidate 2D frame, where the first feature information is a feature of the region where the candidate 2D frame is located, and the third feature map is based on the first feature map definite.
S1540,利用分类回归网络对第一特征信息进行处理,得到目标物体的目标2D框以及第一指示信息,目标2D框的数量小于或等于候选2D框的数量,第一指示信息用于指示目标物体所属的类别。S1540: Use a classification and regression network to process the first feature information to obtain a target 2D frame and first indication information of the target object, where the number of target 2D frames is less than or equal to the number of candidate 2D frames, and the first indication information is used to indicate the target object the category to which it belongs.
可选地,利用分类回归网络对第一特征信息进行处理,得到目标物体的目标2D框以及第一指示信息,包括:利用分类回归网络对第一特征信息进行处理,得到候选2D框属 于多个任务中的各个类别的置信度;利用分类回归网络对候选2D框的位置信息进行调整,得到调整后的候选2D框;根据调整后的候选2D框确定目标2D框;根据目标2D框属于各个类别的置信度确定第一指示信息。Optionally, using a classification and regression network to process the first feature information to obtain the target 2D frame of the target object and the first indication information, including: using a classification and regression network to process the first feature information to obtain a candidate 2D frame belonging to multiple The confidence of each category in the task; use the classification and regression network to adjust the position information of the candidate 2D frame to obtain the adjusted candidate 2D frame; determine the target 2D frame according to the adjusted candidate 2D frame; according to the target 2D frame belongs to each category The confidence of determining the first indication information.
可选地,分类回归网络包括第一区域卷积神经网络RCNN,第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,隐层与多个子分类全连接层相连,隐层与多个子回归全连接层相连,多个子分类全连接层与多个任务一一对应,多个子回归全连接层与多个任务一一对应;以及利用分类回归网络对第一特征信息进行处理,输出目标物体的目标2D框以及第一指示信息,包括:利用隐层对第一特征信息进行处理,得到第二特征信息;利用子分类全连接层根据第二特征信息得到候选2D框属于子分类全连接层对应的任务中的物体类别的置信度;利用子回归全连接层根据第二特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。Optionally, the classification and regression network includes a first regional convolutional neural network RCNN, the first RCNN includes a hidden layer, multiple sub-category fully connected layers and multiple sub-regression fully connected layers, the hidden layer is connected to the multiple sub-category fully connected layers, and the hidden layer is The layer is connected with multiple sub-regression fully-connected layers, the multiple sub-classification fully-connected layers are in one-to-one correspondence with multiple tasks, and the multiple sub-regression fully-connected layers are in one-to-one correspondence with multiple tasks; and the classification and regression network is used to process the first feature information. , outputting the target 2D frame of the target object and the first indication information, including: using the hidden layer to process the first feature information to obtain the second feature information; using the sub-classification fully connected layer to obtain the candidate 2D frame belonging to the sub-class according to the second feature information. Classify the confidence of the object category in the task corresponding to the fully connected layer; use the sub-regression fully connected layer to adjust the position information of the candidate 2D frame according to the second feature information, and obtain the adjusted candidate 2D frame.
可选地,分类回归网络包括第二RCNN,第二RCNN包括隐层、分类全连接层和回归全连接层,隐层与分类全连接层相连,隐层与回归全连接层相连;以及利用分类回归网络对第一特征信息进行处理,输出目标物体的目标2D框以及第一指示信息,包括:利用隐层对第一特征信息进行处理,得到第三特征信息;利用分类全连接层根据第三特征信息得到候选2D框属于各个类别的置信度;利用回归全连接层根据第三特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。Optionally, the classification and regression network includes a second RCNN, the second RCNN includes a hidden layer, a classification fully connected layer and a regression fully connected layer, the hidden layer is connected to the classification fully connected layer, and the hidden layer is connected to the regression fully connected layer; The regression network processes the first feature information, and outputs the target 2D frame of the target object and the first indication information, including: using the hidden layer to process the first feature information to obtain third feature information; The feature information obtains the confidence that the candidate 2D frame belongs to each category; the position information of the candidate 2D frame is adjusted according to the third feature information by using the regression fully connected layer, and the adjusted candidate 2D frame is obtained.
可选地,分类全连接层是通过将第一RCNN中的多个子分类全连接层进行合并得到的,回归全连接层是通过将第一RCNN中的多个子回归全连接层进行合并得到的,第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,隐层与多个子分类全连接层相连,隐层与多个子回归全连接层相连,多个子分类全连接层与多个任务一一对应,多个子回归全连接层与多个任务一一对应;子分类全连接层用于根据第三特征信息得到候选2D框属于子分类全连接层对应的任务中的物体类别的置信度;子回归全连接层用于根据第三特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。Optionally, the classification fully connected layer is obtained by merging multiple sub-classification fully connected layers in the first RCNN, and the regression fully connected layer is obtained by merging multiple sub-regression fully connected layers in the first RCNN, The first RCNN includes a hidden layer, multiple sub-category fully-connected layers, and multiple sub-regression fully-connected layers. The hidden layer is connected to multiple sub-category fully-connected layers, the hidden layer is connected to multiple sub-regression fully-connected layers, and the multiple sub-category fully-connected layers are connected to Multiple tasks are in one-to-one correspondence, and multiple sub-regression fully-connected layers are in one-to-one correspondence with multiple tasks; the sub-classification fully-connected layer is used to obtain the object category of the candidate 2D frame belonging to the task corresponding to the sub-classification fully-connected layer according to the third feature information. The confidence of the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the third feature information, and obtain the adjusted candidate 2D frame.
图16中示出了本申请实施例提供的物体识别方法的处理流程,图16中的处理流程可以视为图15所示方法的一种具体实现方式,图16中的方法可以采用图8所示的感知网络执行,相关描述可以参见感知网络800中的描述,为了避免不必要的重复,在描述方法1600时适当省略重复的描述。FIG. 16 shows the processing flow of the object recognition method provided by the embodiment of the present application. The processing flow in FIG. 16 can be regarded as a specific implementation of the method shown in FIG. 15 , and the method in FIG. The perceptual network shown in the figure is executed. For related descriptions, refer to the description in the perceptual network 800. In order to avoid unnecessary repetition, repeated descriptions are appropriately omitted when describing the method 1600.
下面以ADAS/ADS的视觉感知系统为例,对本申请实施例的方案进行详细的介绍。The solution of the embodiment of the present application is described in detail below by taking the visual perception system of ADAS/ADS as an example.
根据表1中的任务划分方式,本申请实施例采用的感知网络的结构如图17所示。如图17所示,感知网络包括:backbone、RPN、感兴趣区域提取模块和第二RCNN。图17所示的感知网络可以视为图11所示的感知网络的一种具体实现方式。图17中的感知网络能够同时完成表1中的8个大类的目标检测。或者说,图17中的感知网络能够同时完成表1中的8种任务的目标检测。图17所示的感知网络可以是根据图14所示的感知网络确定的。例如,如图18所示,由第一RCNN中的多个子分类fc合并后得到第二RCNN中的分类fc,由第一RCNN中的子回归fc合并后得到第二RCNN中的回归fc。从图18中可以看出,本申请的感知网络可以根据业务的需求,对第一RCNN中的子分类fc和子回归fc进行灵活地增加或删减,从而实现不同数量的任务的目标检测。According to the task division method in Table 1, the structure of the perception network adopted in this embodiment of the present application is shown in FIG. 17 . As shown in Figure 17, the perceptual network includes: backbone, RPN, region of interest extraction module and second RCNN. The sensory network shown in FIG. 17 can be regarded as a specific implementation of the sensory network shown in FIG. 11 . The perceptual network in Figure 17 can simultaneously complete the object detection of the 8 categories in Table 1. In other words, the perceptual network in Figure 17 can simultaneously complete the target detection of the 8 tasks in Table 1. The sensory network shown in FIG. 17 may be determined according to the sensory network shown in FIG. 14 . For example, as shown in FIG. 18 , the classification fc in the second RCNN is obtained by merging multiple sub-classifications fc in the first RCNN, and the regression fc in the second RCNN is obtained after merging the sub-regression fc in the first RCNN. As can be seen from Figure 18, the perceptual network of the present application can flexibly add or delete the sub-classification fc and sub-regression fc in the first RCNN according to the needs of the business, so as to achieve target detection of different numbers of tasks.
具体地,方法1600包括步骤S1610至步骤S1650。Specifically, the method 1600 includes steps S1610 to S1650.
S1610,输入待处理的图像。S1610, input the image to be processed.
S1620,生成基础特征。S1620, generate basic features.
示例性地,步骤S1620可以由图17中的backbone执行。Exemplarily, step S1620 may be performed by the backbone in FIG. 17 .
具体地,由backbone对输入的图像进行卷积处理,生成若干不同尺度的特征图,即第一特征图。Specifically, the backbone performs convolution processing on the input image to generate several feature maps of different scales, that is, the first feature map.
示例性地,backbone可以采用多种形式的卷积网络,例如,VGG16、Resnet50或Inception-Net等。Exemplarily, the backbone can adopt various forms of convolutional networks, such as VGG16, Resnet50, or Inception-Net, etc.
进一步地,在感知网络还包括FPN的情况下,步骤S1620还可以包括:基于第一特征图进行特征融合,输出融合后的特征图。Further, when the perceptual network further includes FPN, step S1620 may further include: performing feature fusion based on the first feature map, and outputting the fused feature map.
主干网络或FPN输出的特征图均可以作为基础特征提供给之后的模块。The feature maps output by the backbone network or FPN can be provided as basic features to subsequent modules.
S1630,预测候选2D框。S1630, predict the candidate 2D frame.
示例性地,步骤S1630可以由图17中的RPN执行。Exemplarily, step S1630 may be performed by the RPN in FIG. 17 .
RPN在第二特征图上预测目标物体所在的区域,并输出与目标物体所在的区域匹配的候选2D框,目标物体包括多个任务中的待检测的物体。第二特征图可以包括主干网络或FPN输出的特征图。The RPN predicts the region where the target object is located on the second feature map, and outputs a candidate 2D frame matching the region where the target object is located. The target object includes objects to be detected in multiple tasks. The second feature map may include the feature map output by the backbone network or FPN.
具体地,RPN根据backbone或FPN提供的特征图,预测出可能存在目标物体的区域,并输出这些区域的候选框,或者说候选区域(proposal)的坐标。本申请实施例中,RPN可以预测出可能存在表1中8个大类的待检测的物体的候选框。Specifically, RPN predicts areas where target objects may exist based on the feature map provided by backbone or FPN, and outputs candidate frames of these areas, or the coordinates of candidate areas (proposal). In the embodiment of the present application, the RPN can predict that there may be candidate frames of objects to be detected in the eight categories in Table 1.
S1640,提取候选2D框的特征。S1640, extract the features of the candidate 2D frame.
示例性地,步骤S1640可以由图17中的感兴趣区域提取模块执行。Exemplarily, step S1640 may be performed by the region of interest extraction module in FIG. 17 .
感兴趣区域提取模块在第三特征图上提取候选2D框所在区域的特征。第三特征图可以是backbone或FPN提供的一个特征图。The region of interest extraction module extracts the features of the region where the candidate 2D frame is located on the third feature map. The third feature map can be a feature map provided by backbone or FPN.
示例性地,感兴趣区域提取模块根据RPN提供的proposal的坐标,在backbone或FPN提供的一个特征图上把每个proposal所在区域的特征抽取出来,并resize到固定的大小,得到每个proposal的特征。Exemplarily, the region of interest extraction module extracts the features of the region where each proposal is located on a feature map provided by the backbone or FPN according to the coordinates of the proposal provided by the RPN, and resize to a fixed size to obtain the value of each proposal. feature.
S1650,对候选2D框进行修正以及分类。S1650, correcting and classifying the candidate 2D frame.
示例性地,步骤S1650可以由图17中的第二RCNN执行。Exemplarily, step S1650 may be performed by the second RCNN in FIG. 17 .
具体地,第二RCNN中的隐层,例如,shared fc/conv,对感兴趣区域提取模块提取出的每个proposal的特征进一步进行特征提取,送入至cls fc和reg fc中,由cls fc对proposal进行分类,得到每个proposal属于各个类别的置信度,由reg fc对proposal的2D框的坐标进行调整,得到更紧致的2D框坐标,然后经过框和并操作,例如NMS操作合并调整后的2D框,输出目标2D框和分类结果。分类结果可以作为第一指示信息。Specifically, the hidden layer in the second RCNN, for example, shared fc/conv, further performs feature extraction on the features of each proposal extracted by the region of interest extraction module, and sends them to cls fc and reg fc. Classify the proposal to obtain the confidence that each proposal belongs to each category, adjust the coordinates of the 2D frame of the proposal by reg fc to obtain a more compact 2D frame coordinate, and then perform the frame sum operation, such as the NMS operation to merge and adjust After the 2D box, output the target 2D box and the classification result. The classification result can be used as the first indication information.
图17中的第二RCNN中的分类fc的权重是通过对图16中的第一RCNN的多个子分类fc的权重进行合并得到的。图17中的第二RCNN中的回归fc的权重是通过对图16中的第一RCNN的多个子回归fc的权重进行合并得到的。在训练过程中,图16中的第一RCNN使用sigmoid函数对子分类fc得到的标签逻辑值(lable logits)进行归一化,得到各个类别的置信度,相当于对各个类别均进行一次二分类处理,当前类别的置信度与其他类别没有关系,因此,在推理时,可以将模型所有的任务的子分类fc合并成一个分类fc。子回归fc也可以合并为一个回归fc。The weights of the classification fc in the second RCNN in FIG. 17 are obtained by combining the weights of multiple sub-classifications fc of the first RCNN in FIG. 16 . The weights of the regression fc in the second RCNN in FIG. 17 are obtained by combining the weights of the multiple sub-regression fcs of the first RCNN in FIG. 16 . During the training process, the first RCNN in Figure 16 uses the sigmoid function to normalize the label logits obtained by the sub-category fc to obtain the confidence of each category, which is equivalent to performing a second classification for each category Processing, the confidence of the current category has no relationship with other categories, so during inference, the sub-categories fc of all tasks of the model can be combined into one category fc. The sub-regressions fc can also be combined into one regression fc.
例如,候选2D框为矩形框,候选2D框的位置信息通过4个值表示,隐层输出的特征(feature)的长度为1024,每个task中的类别数为n,则每个task中的子回归fc的权重为1024*4n的张量(tensor),每个task中的子分类fc的权重为1024*n的tensor。表1中共有8个task,31类任务物体,合并后形成的回归fc的权重即为1024*124的tensor,分类fc的权重为1024*31的tensor。也就是说,合并后得到的第二RCNN中仅包括一个分类fc和一个回归fc,其输入和输出与合并后的权重的张量维数(tenser shape)保持一致,即分类fc和回归fc的输入为1024,分类fc的输出为31,回归fc的输出为124。For example, the candidate 2D frame is a rectangular frame, the position information of the candidate 2D frame is represented by 4 values, the length of the feature output by the hidden layer is 1024, and the number of categories in each task is n, then the number of categories in each task is n. The weight of the sub-regression fc is a tensor of 1024*4n, and the weight of the sub-category fc in each task is a tensor of 1024*n. There are 8 tasks and 31 types of task objects in Table 1. The weight of the regression fc formed after merging is the tensor of 1024*124, and the weight of the classification fc is the tensor of 1024*31. That is to say, the second RCNN obtained after merging only includes one classification fc and one regression fc, and its input and output are consistent with the tensor shape of the combined weight, that is, the input of classification fc and regression fc is 1024, the output of classification fc is 31, and the output of regression fc is 124.
表2示出本申请实施例中的单头端多任务网络和现有的多头端多任务网络在输入图像大小为720*1280(@720p)的情况下实现8个任务的参数量和计算量的统计。即表2中示出了8任务(task)的单头端任务网络和多头端多任务网络的参数量和计算量。Table 2 shows the parameter amount and calculation amount of 8 tasks implemented by the single-head multi-task network in the embodiment of the present application and the existing multi-head multi-task network when the input image size is 720*1280 (@720p). registration. That is, Table 2 shows the parameter amount and calculation amount of the 8-task single-head-end task network and the multi-head-end multi-task network.
表2Table 2
8 Task-Model@720p8 Task-Model@720p | GFlopsGFlops | Parameters(M)Parameters(M) |
多头端多任务网络(8task)Multi-head multi-task network (8task) | 413.96413.96 | 142.76142.76 |
单头端多任务网络(8task)Single-end multitasking network (8task) | 139.61139.61 | 41.2941.29 |
如表2所示,若采用多头端多任务网络实现本申请实施例中的8个任务的目标检测,需要的总计算量为413.96GFlops,网络参数量(Parameters)为142.76M,巨大的计算量和网络参数量会给硬件带来很大的压力。而使用本申请实施例提供的单头端多任务网络,能够使得计算量下降60%,参数量下降71%,极大降低了计算量和参数量,减少了计算消耗,降低了硬件压力。As shown in Table 2, if a multi-head-end multi-task network is used to implement the target detection of the 8 tasks in the embodiment of the present application, the total amount of computation required is 413.96 GFlops, and the amount of network parameters (Parameters) is 142.76M, which is a huge amount of computation. And the amount of network parameters will put a lot of pressure on the hardware. However, using the single-end multitasking network provided by the embodiment of the present application can reduce the amount of calculation by 60% and the amount of parameters by 71%, which greatly reduces the amount of calculation and parameters, reduces calculation consumption, and reduces hardware pressure.
表3示出了本申请实施例中的单头端多任务网络和现有的多头端多任务网络的推理耗时对比。Table 3 shows the comparison of inference time consumption between the single-head multi-task network in the embodiment of the present application and the existing multi-head multi-task network.
表3table 3
8 Task-Model@720p8 Task-Model@720p | 720p latency(ms)720p latency(ms) | 1080p latency(ms)1080p latency(ms) |
多头端多任务网络(8task)Multi-head multi-task network (8task) | 2828 | 4040 |
单头端多任务网络(8task)Single-end multitasking network (8task) | 23twenty three | 3131 |
如表3所示,相对于多头端多任务网络,本申请实施例的单头端多任务网络在分辨率为720p和1080p图像上的耗时(latency)分别下降了17%和22%,显著提高了处理效率,有利于部署于实时性要求较高的场景中。As shown in Table 3, compared with the multi-head-end multi-task network, the single-head-end multi-task network of the embodiment of the present application reduces the latency by 17% and 22% on images with resolutions of 720p and 1080p, respectively, which is significantly The processing efficiency is improved, which is conducive to deployment in scenarios with high real-time requirements.
此外,本申请实施例中的单头端多任务网络能够实现与多头端多任务网络一样的检测性能。表4示出了单头端多任务网络和多头端多任务网络在部分类别上的性能比较。In addition, the single-head multitasking network in the embodiment of the present application can achieve the same detection performance as the multi-heading multitasking network. Table 4 shows the performance comparison of the single-head-end multi-task network and the multi-head-end multi-task network on some categories.
表4Table 4
类别category | 多头端多任务网络(AP)Multi-Head End Multitasking Network (AP) | 单头端多任务网络(AP)Single-end multitasking network (AP) |
PedestrianPedestrian | 75.6675.66 | 72.7672.76 |
CyclistCyclist | 84.7784.77 | 81.9281.92 |
CarCar | 96.0996.09 | 97.5697.56 |
TruckTruck | 88.1888.18 | 90.2190.21 |
TramTram | 88.4888.48 | 94.6294.62 |
TrafficConeTrafficCone | 83.1183.11 | 87.6587.65 |
TrafficStickTrafficStick | 73.3173.31 | 86.6886.68 |
FireHydrantFireHydrant | 63.363.3 | 77.8677.86 |
TrafficLight_RedTrafficLight_Red | 96.5196.51 | 95.7195.71 |
TrafficLight_YellowTrafficLight_Yellow | 98.6698.66 | 96.4996.49 |
TrafficLight_GreenTrafficLight_Green | 95.8595.85 | 94.2194.21 |
TrafficSignTrafficSign | 83.8783.87 | 86.1486.14 |
GuideSignGuideSign | 56.5756.57 | 59.9659.96 |
如表4所示,本申请实施例中的单头端多任务网络和现有的多头端多任务网络的平均精准度(average precision,AP)相差不大,即两者的性能相当。由此可见,本申请实施例中的单头端多任务网络能够在保证模型的性能的前提下节省计算量和显存。As shown in Table 4, the average precision (average precision, AP) of the single-head multi-task network in the embodiment of the present application and the existing multi-head multi-task network is not much different, that is, the performance of the two is comparable. It can be seen from this that the single-end multitasking network in the embodiment of the present application can save the amount of computation and memory on the premise of ensuring the performance of the model.
下面结合图19至图20对本申请实施例的装置进行说明。应理解,下面描述的装置能够执行前述本申请实施例的方法,为了避免不必要的重复,下面在介绍本申请实施例的装置时适当省略重复的描述。The apparatus of the embodiment of the present application will be described below with reference to FIG. 19 to FIG. 20 . It should be understood that the apparatuses described below can execute the methods of the foregoing embodiments of the present application. In order to avoid unnecessary repetition, the repetitive descriptions are appropriately omitted when introducing the apparatuses of the embodiments of the present application below.
图19是本申请实施例的一种装置的示意性框图。图19所示的装置4000包括获取单元4010和处理单元4020。FIG. 19 is a schematic block diagram of an apparatus according to an embodiment of the present application. The apparatus 4000 shown in FIG. 19 includes an acquisition unit 4010 and a processing unit 4020 .
在一种实现方式中,装置4000可以作为感知网络的训练装置,获取单元4010和处理单元4020可以用于执行本申请实施例的感知网络的训练方法,示例性地,可以用于执行方法1200或方法1300。In an implementation manner, the apparatus 4000 may be used as a training apparatus for a perceptual network, and the acquiring unit 4010 and the processing unit 4020 may be used to perform the training method of the perceptual network of the embodiments of the present application, for example, may be used to perform the method 1200 or Method 1300.
具体地,感知网络包括候选区域生成网络RPN,RPN用于预测样本图像中的目标物体的候选二维2D框的位置信息,目标物体包括多个任务的待检测的物体,多个任务中的每个任务包括至少一个类别,目标物体包括第一任务物体和第二任务物体。Specifically, the perception network includes a candidate region generation network RPN, and the RPN is used to predict the position information of the candidate two-dimensional 2D frame of the target object in the sample image. The target object includes objects to be detected for multiple tasks. Each task includes at least one category, and the target objects include a first task object and a second task object.
获取单元4010用于获取训练数据,训练数据包括样本图像、样本图像上的第一任务物体的标注数据以及样本图像上的第二任务物体的伪框,标注数据包括第一任务物体的类标签和第一任务物体的标注2D框,第二任务物体的伪框是通过其他感知网络对样本图像进行推理得到的第二任务物体的目标2D框。The obtaining unit 4010 is used to obtain training data, the training data includes the sample image, the labeling data of the first task object on the sample image, and the pseudo frame of the second task object on the sample image, and the labeling data includes the class label of the first task object and The labeled 2D frame of the first task object, and the pseudo frame of the second task object is the target 2D frame of the second task object obtained by inferring the sample image through other perceptual networks.
处理单元4020用于基于训练数据对感知网络进行训练。The processing unit 4020 is configured to train the perception network based on the training data.
可选地,作为一个实施例,感知网络还包括主干网络、感兴趣区域提取模块和分类回归网络,处理单元4020具体用于:根据第一任务物体的标注2D框和第二任务物体的目标2D框与RPN预测得到的样本图像中的目标物体的候选2D框之间的差异计算第一损失函数值;根据标注数据计算感知网络的第二损失函数值;将第一损失函数值和第二损失函数值进行反向传播,调整感知网络中所需训练的部分的参数,感知网络中所需训练的部分包括分类回归网络中所需训练的部分、感兴趣区域提取模块、RPN和主干网络,分类回归网络中所需训练的部分是根据第一任务物体确定的。Optionally, as an embodiment, the perception network further includes a backbone network, a region of interest extraction module, and a classification and regression network, and the processing unit 4020 is specifically configured to: according to the marked 2D frame of the first task object and the target 2D of the second task object. The difference between the frame and the candidate 2D frame of the target object in the sample image predicted by RPN calculates the first loss function value; calculates the second loss function value of the perceptual network according to the labeled data; The function value is back-propagated, and the parameters of the part to be trained in the perception network are adjusted. The part to be trained in the perception network includes the part to be trained in the classification and regression network, the region of interest extraction module, the RPN and the backbone network, and the classification The part of the regression network that needs to be trained is determined according to the first task object.
可选地,作为一个实施例,主干网络,用于对样本图像进行卷积处理,输出样本图像的第一特征图;RPN,用于基于第二特征图上输出目标物体的候选2D框的位置信息,第二特征图是根据第一特征图确定的;感兴趣区域提取模块,用于基于候选2D框的位置信息在第三特征图上提取第一特征信息,第一特征信息为候选2D框所在区域的特征,第三特征图是根据第一特征图确定的;分类回归网络,用于对第一特征信息进行处理,输出目标物体的目标2D框以及第一指示信息,目标物体的目标2D框的数量小于或等于目标物体的候选2D框的数量,第一指示信息用于指示目标物体所属的类别。Optionally, as an embodiment, the backbone network is used to perform convolution processing on the sample image and output the first feature map of the sample image; RPN is used to output the position of the candidate 2D frame of the target object based on the second feature map. information, the second feature map is determined according to the first feature map; the region of interest extraction module is used to extract the first feature information on the third feature map based on the position information of the candidate 2D frame, and the first feature information is the candidate 2D frame The feature of the area, the third feature map is determined according to the first feature map; the classification and regression network is used to process the first feature information, output the target 2D frame of the target object and the first indication information, the target 2D of the target object The number of boxes is less than or equal to the number of candidate 2D boxes of the target object, and the first indication information is used to indicate the category to which the target object belongs.
可选地,作为一个实施例,分类回归网络包括第一区域卷积神经网络RCNN,第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,隐层与多个子分类全连接层相连,隐层与多个子回归全连接层相连,多个子分类全连接层与多个任务一一对应,多个子回归全连接层与多个任务一一对应;隐层,用于对第一特征信息进行处理,得到第二 特征信息;子分类全连接层用于根据第二特征信息得到候选2D框属于子分类全连接层对应的任务中的物体类别的置信度;子回归全连接层用于根据隐层处理后的结果对候选2D框的位置信息进行调整,得到调整后的候选2D框;以及分类回归网络中所需训练的部分包括隐层和与第一任务物体所在的任务对应的子分类全连接层和子回归全连接层。Optionally, as an embodiment, the classification and regression network includes a first regional convolutional neural network RCNN, the first RCNN includes a hidden layer, multiple sub-classification fully connected layers and multiple sub-regression fully connected layers, and the hidden layer and multiple sub-classification fully connected layers. The connection layer is connected, the hidden layer is connected with multiple sub-regression fully-connected layers, multiple sub-classification fully-connected layers are in one-to-one correspondence with multiple tasks, and multiple sub-regression fully-connected layers are in one-to-one correspondence with multiple tasks; One feature information is processed to obtain second feature information; the sub-classification fully connected layer is used to obtain the confidence level of the object category in the task corresponding to the sub-classification fully connected layer according to the second feature information; the sub-regression fully connected layer It is used to adjust the position information of the candidate 2D frame according to the result of the hidden layer processing to obtain the adjusted candidate 2D frame; and the part to be trained in the classification and regression network includes the hidden layer and the task corresponding to the first task object. The sub-classification fully connected layer and the sub-regression fully connected layer.
在另一种实现方式中,装置4000可以作为物体识别装置。物体识别装置包括获取单元4010和处理单元4020。感知网络包括:主干网络、候选区域生成网络、感兴趣区域提取模块和分类回归网络。In another implementation, the device 4000 may function as an object recognition device. The object recognition apparatus includes an acquisition unit 4010 and a processing unit 4020 . The perception network includes: backbone network, candidate region generation network, region of interest extraction module and classification regression network.
获取单元4010和处理单元4020可以用于执行本申请实施例的物体识别方法,例如,可以用于执行方法1500或方法1600。The acquiring unit 4010 and the processing unit 4020 may be used to execute the object recognition method of the embodiments of the present application, for example, may be used to execute the method 1500 or the method 1600 .
获取单元4010用于获取输入图像。The acquisition unit 4010 is used to acquire an input image.
处理单元4020用于利用主干网络对输入图像进行卷积处理,得到输入图像的第一特征图;利用RPN基于第二特征图输出目标物体的候选二维2D框的位置信息,目标物体包括多个任务中的待检测的物体,多个任务中的每个任务包括至少一个类别,第二特征图是根据第一特征图确定的;利用感兴趣区域提取模块基于候选2D框的位置信息在第三特征图上提取第一特征信息,第一特征信息为候选2D框所在区域的特征,第三特征图是根据第一特征图确定的;利用分类回归网络对第一特征信息进行处理,得到目标物体的目标2D框以及第一指示信息,目标物体的目标2D框的数量小于或等于目标物体的候选2D框的数量,第一指示信息用于指示目标物体所属类别。The processing unit 4020 is configured to use the backbone network to perform convolution processing on the input image to obtain the first feature map of the input image; use the RPN to output the position information of the candidate two-dimensional 2D frame of the target object based on the second feature map, and the target object includes a plurality of The object to be detected in the task, each task in the multiple tasks includes at least one category, and the second feature map is determined according to the first feature map; the region of interest extraction module is used based on the position information of the candidate 2D frame. Extract the first feature information from the feature map, the first feature information is the feature of the area where the candidate 2D frame is located, and the third feature map is determined according to the first feature map; use the classification and regression network to process the first feature information to obtain the target object The target 2D frame of the target object and the first indication information, the number of target 2D frames of the target object is less than or equal to the number of candidate 2D frames of the target object, and the first indication information is used to indicate the category to which the target object belongs.
可选地,作为一个实施例,处理单元4020具体用于:利用分类回归网络对第一特征信息进行处理,得到候选2D框属于多个任务中的各个类别的置信度;利用分类回归网络对候选2D框的位置信息进行调整,得到调整后的候选2D框;根据调整后的候选2D框确定目标2D框;根据目标2D框属于各个类别的置信度确定第一指示信息。Optionally, as an embodiment, the processing unit 4020 is specifically configured to: use a classification and regression network to process the first feature information to obtain the confidence that the candidate 2D frame belongs to each category in multiple tasks; The position information of the 2D frame is adjusted to obtain an adjusted candidate 2D frame; the target 2D frame is determined according to the adjusted candidate 2D frame; the first indication information is determined according to the confidence that the target 2D frame belongs to each category.
可选地,作为一个实施例,分类回归网络包括第一区域卷积神经网络RCNN,第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,隐层与多个子分类全连接层相连,隐层与多个子回归全连接层相连,多个子分类全连接层与多个任务一一对应,多个子回归全连接层与多个任务一一对应;以及处理单元具体用于:利用隐层对第一特征信息进行处理,得到第二特征信息;利用子分类全连接层根据第二特征信息得到候选2D框属于子分类全连接层对应的任务中的物体类别的置信度;利用子回归全连接层根据第二特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。Optionally, as an embodiment, the classification and regression network includes a first regional convolutional neural network RCNN, the first RCNN includes a hidden layer, multiple sub-classification fully connected layers and multiple sub-regression fully connected layers, and the hidden layer and multiple sub-classification fully connected layers. The connection layer is connected, the hidden layer is connected with multiple sub-regression fully-connected layers, the multiple sub-classification fully-connected layers are in one-to-one correspondence with multiple tasks, and the multiple sub-regression fully-connected layers are in one-to-one correspondence with multiple tasks; and the processing unit is specifically used for: Use the hidden layer to process the first feature information to obtain the second feature information; use the sub-classification fully connected layer to obtain the confidence level of the object category in the task corresponding to the sub-classification fully connected layer by using the sub-classification fully connected layer; use The sub-regression fully connected layer adjusts the position information of the candidate 2D frame according to the second feature information, and obtains the adjusted candidate 2D frame.
可选地,作为一个实施例,分类回归网络包括第二RCNN,第二RCNN包括隐层、分类全连接层和回归全连接层,隐层与分类全连接层相连,隐层与回归全连接层相连;以及处理单元4020具体用于:利用所利用隐层对第一特征信息进行处理,得到第三特征信息;利用分类全连接层根据得到第三特征信息得到候选2D框属于各个类别的置信度;利用回归全连接层根据得到第三特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。Optionally, as an embodiment, the classification and regression network includes a second RCNN, the second RCNN includes a hidden layer, a classification fully connected layer, and a regression fully connected layer, the hidden layer is connected to the classification fully connected layer, and the hidden layer is connected to the regression fully connected layer. and the processing unit 4020 is specifically used for: using the hidden layer to process the first feature information to obtain the third feature information; using the classification fully connected layer to obtain the confidence that the candidate 2D frame belongs to each category according to the third feature information obtained ; Use the regression fully connected layer to adjust the position information of the candidate 2D frame according to the obtained third feature information, and obtain the adjusted candidate 2D frame.
可选地,作为一个实施例,分类全连接层是通过将第一RCNN中的多个子分类全连接层进行合并得到的,回归全连接层是通过将第一RCNN中的多个子回归全连接层进行合并得到的,第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,隐层与多个子分类全连接层相连,隐层与多个子回归全连接层相连,多个子分类全连接层与多 个任务一一对应,多个子回归全连接层与多个任务一一对应;子分类全连接层用于根据得到第三特征信息得到候选2D框属于子分类全连接层对应的任务中的物体类别的置信度;子回归全连接层用于根据得到第三特征信息对候选2D框的位置信息进行调整,得到调整后的候选2D框。Optionally, as an embodiment, the classification fully connected layer is obtained by merging multiple sub-classification fully connected layers in the first RCNN, and the regression fully connected layer is obtained by combining multiple sub-regression fully connected layers in the first RCNN. After merging, the first RCNN includes a hidden layer, multiple sub-classification fully connected layers and multiple sub-regression fully connected layers, the hidden layer is connected with multiple sub-classification fully connected layers, the hidden layer is connected with multiple sub-regression fully connected layers, and multiple sub-regression fully connected layers. The classification fully connected layer corresponds to multiple tasks one-to-one, and multiple sub-regression fully connected layers correspond to multiple tasks one-to-one; the sub-classification fully connected layer is used to obtain the candidate 2D frame according to the obtained third feature information, which belongs to the sub-classification fully connected layer. The confidence of the object category in the task; the sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the obtained third feature information, and obtain the adjusted candidate 2D frame.
需要说明的是,上述装置4000以功能单元的形式体现。这里的术语“单元”可以通过软件和/或硬件形式实现,对此不作具体限定。It should be noted that the above-mentioned apparatus 4000 is embodied in the form of functional units. The term "unit" here can be implemented in the form of software and/or hardware, which is not specifically limited.
例如,“单元”可以是实现上述功能的软件程序、硬件电路或二者结合。所述硬件电路可能包括应用特有集成电路(application specific integrated circuit,ASIC)、电子电路、用于执行一个或多个软件或固件程序的处理器(例如共享处理器、专有处理器或组处理器等)和存储器、合并逻辑电路和/或其它支持所描述的功能的合适组件。For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that realizes the above-mentioned functions. The hardware circuits may include application specific integrated circuits (ASICs), electronic circuits, processors for executing one or more software or firmware programs (eg, shared processors, proprietary processors, or group processors) etc.) and memory, merge logic and/or other suitable components to support the described functions.
因此,在本申请的实施例中描述的各示例的单元,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Therefore, the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
图20是本申请实施例提供的一种装置的硬件结构示意图。图20所示的装置6000(该装置6000具体可以是一种计算机设备)包括存储器6001、处理器6002、通信接口6003以及总线6004。其中,存储器6001、处理器6002、通信接口6003通过总线6004实现彼此之间的通信连接。FIG. 20 is a schematic diagram of a hardware structure of an apparatus provided by an embodiment of the present application. The apparatus 6000 shown in FIG. 20 (the apparatus 6000 may specifically be a computer device) includes a memory 6001 , a processor 6002 , a communication interface 6003 and a bus 6004 . The memory 6001 , the processor 6002 , and the communication interface 6003 are connected to each other through the bus 6004 for communication.
在一种实现方式中,装置6000可以作为感知网络的训练装置。In one implementation, the apparatus 6000 may serve as a training apparatus for a perceptual network.
存储器6001可以是只读存储器(read only memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(random access memory,RAM)。存储器6001可以存储程序,当存储器6001中存储的程序被处理器6002执行时,处理器6002用于执行本申请实施例的感知网络的训练方法的各个步骤。具体地,处理器6002可以执行上文中图12所示的方法中的步骤S1220。The memory 6001 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 6001 may store a program, and when the program stored in the memory 6001 is executed by the processor 6002, the processor 6002 is configured to execute each step of the method for training a perceptual network according to the embodiment of the present application. Specifically, the processor 6002 may perform step S1220 in the method shown in FIG. 12 above.
处理器6002可以采用通用的中央处理器(central processing unit,CPU),微处理器,应用专用集成电路(application specific integrated circuit,ASIC),图形处理器(graphics processing unit,GPU)或者一个或多个集成电路,用于执行相关程序,以实现本申请方法实施例的感知网络的训练方法。The processor 6002 may adopt a general-purpose central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processor (graphics processing unit, GPU), or one or more The integrated circuit is used to execute the relevant program to realize the training method of the perceptual network according to the method embodiment of the present application.
处理器6002还可以是一种集成电路芯片,具有信号的处理能力,例如,可以是图5所示的芯片。在实现过程中,本申请的感知网络的训练方法的各个步骤可以通过处理器6002中的硬件的集成逻辑电路或者软件形式的指令完成。The processor 6002 may also be an integrated circuit chip with signal processing capability, for example, the chip shown in FIG. 5 . In the implementation process, each step of the training method of the perceptual network of the present application can be completed by the hardware integrated logic circuit in the processor 6002 or the instructions in the form of software.
上述处理器6002还可以是通用处理器、数字信号处理器(digital signal processing,DSP)、专用集成电路(ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器6001,处理器6002 读取存储器6001中的信息,结合其硬件完成本申请实施例中的训练装置中包括的单元所需执行的功能,或者,执行本申请方法实施例的图12所示的感知网络的训练方法。The above-mentioned processor 6002 can also be a general-purpose processor, a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, Discrete gate or transistor logic devices, discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory 6001, and the processor 6002 reads the information in the memory 6001 and, in combination with its hardware, completes the functions required to be performed by the units included in the training device in the embodiments of the present application, or executes the diagrams in the method embodiments of the present application. 12 shows the training method of the perceptual network.
通信接口6003使用例如但不限于收发器一类的收发装置,来实现装置6000与其他设备或通信网络之间的通信。例如,可以通过通信接口6003获取训练数据。The communication interface 6003 uses a transceiver device such as but not limited to a transceiver to implement communication between the device 6000 and other devices or a communication network. For example, training data can be obtained through the communication interface 6003 .
总线6004可包括在装置6000各个部件(例如,存储器6001、处理器6002、通信接口6003)之间传送信息的通路。The bus 6004 may include a pathway for communicating information between the various components of the device 6000 (eg, the memory 6001, the processor 6002, the communication interface 6003).
在另一种实现方式中,装置6000可以作为物体识别装置。In another implementation, the device 6000 may function as an object recognition device.
存储器6001可以是ROM,静态存储设备和RAM。存储器6001可以存储程序,当存储器6001中存储的程序被处理器6002执行时,处理器6002和通信接口6003用于执行本申请实施例的物体识别方法的各个步骤。具体地,处理器6002可以执行上文中图15所示的方法中的步骤S1520至S1540。The memory 6001 may be ROM, static storage device and RAM. The memory 6001 may store a program. When the program stored in the memory 6001 is executed by the processor 6002, the processor 6002 and the communication interface 6003 are used to execute each step of the object recognition method of the embodiment of the present application. Specifically, the processor 6002 may perform steps S1520 to S1540 in the method shown in FIG. 15 above.
处理器6002可以采用通用的,CPU,微处理器,ASIC,GPU或者一个或多个集成电路,用于执行相关程序,以实现本申请实施例的物体识别装置中的单元所需执行的功能,或者执行本申请方法实施例的物体识别方法。The processor 6002 may adopt a general-purpose CPU, a microprocessor, an ASIC, a GPU, or one or more integrated circuits, and is used to execute a related program, so as to realize the functions required to be performed by the unit in the object recognition apparatus of the embodiment of the present application, Or execute the object recognition method of the method embodiment of the present application.
处理器6002还可以是一种集成电路芯片,具有信号的处理能力,例如,可以是图6所示的芯片。在实现过程中,本申请实施例的物体识别方法的各个步骤可以通过处理器6002中的硬件的集成逻辑电路或者软件形式的指令完成。The processor 6002 may also be an integrated circuit chip with signal processing capability, for example, the chip shown in FIG. 6 . In the implementation process, each step of the object recognition method of the embodiment of the present application may be completed by an integrated logic circuit of hardware in the processor 6002 or an instruction in the form of software.
上述处理器6002还可以是通用处理器、DSP、ASIC、FPGA或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器6001,处理器6002读取存储器6001中的信息,结合其硬件完成本申请实施例的物体识别装置中包括的单元所需执行的功能,或者执行本申请方法实施例的物体识别方法。The above-mentioned processor 6002 may also be a general-purpose processor, DSP, ASIC, FPGA or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory 6001, and the processor 6002 reads the information in the memory 6001, and combines its hardware to complete the functions required to be performed by the units included in the object recognition device of the embodiment of the present application, or to perform the object recognition of the method embodiment of the present application. method.
通信接口6003使用例如但不限于收发器一类的收发装置,来实现装置6000与其他设备或通信网络之间的通信。例如,可以通过通信接口6003获取待处理的数据。The communication interface 6003 uses a transceiver device such as but not limited to a transceiver to implement communication between the device 6000 and other devices or a communication network. For example, the data to be processed can be acquired through the communication interface 6003 .
总线6004可包括在装置6000各个部件(例如,存储器6001、处理器6002、通信接口6003)之间传送信息的通路。The bus 6004 may include a pathway for communicating information between the various components of the device 6000 (eg, the memory 6001, the processor 6002, the communication interface 6003).
应注意,尽管上述装置6000仅仅示出了存储器、处理器、通信接口,但是在具体实现过程中,本领域的技术人员应当理解,装置6000还可以包括实现正常运行所必须的其他器件。同时,根据具体需要,本领域的技术人员应当理解,装置6000还可包括实现其他附加功能的硬件器件。此外,本领域的技术人员应当理解,装置6000也可仅仅包括实现本申请实施例所必须的器件,而不必包括图20中所示的全部器件。It should be noted that although the above-mentioned apparatus 6000 only shows a memory, a processor, and a communication interface, in the specific implementation process, those skilled in the art should understand that the apparatus 6000 may also include other devices necessary for normal operation. Meanwhile, according to specific needs, those skilled in the art should understand that the apparatus 6000 may further include hardware devices that implement other additional functions. In addition, those skilled in the art should understand that the apparatus 6000 may only include the necessary devices for implementing the embodiments of the present application, and does not necessarily include all the devices shown in FIG. 20 .
本申请实施例提供一种计算机可读介质,该计算机可读介质存储于设备执行的程序代码,该程序代码包括用于执行如图15或图16所示的物体识别方法的相关内容。An embodiment of the present application provides a computer-readable medium, where the computer-readable medium stores program code executed by a device, where the program code includes relevant content for executing the object recognition method shown in FIG. 15 or FIG. 16 .
本申请实施例提供一种计算机可读介质,该计算机可读介质存储于设备执行的程序代码,该程序代码包括用于执行如图12或图13所示的训练方法的相关内容。An embodiment of the present application provides a computer-readable medium, where the computer-readable medium stores program code executed by a device, where the program code includes relevant content for executing the training method shown in FIG. 12 or FIG. 13 .
本申请实施例提供一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行如图15或图16所示的物体识别方法的相关内容。An embodiment of the present application provides a computer program product, which, when the computer program product runs on a computer, enables the computer to execute the relevant content of the object recognition method shown in FIG. 15 or FIG. 16 .
本申请实施例提供一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行如图12或图13所示的训练方法的相关内容。An embodiment of the present application provides a computer program product, which, when the computer program product runs on a computer, enables the computer to execute the relevant content of the training method shown in FIG. 12 or FIG. 13 .
本申请实施例提供一种芯片,芯片包括处理器与数据接口,所述处理器通过所述数据接口读取存储器上的指令,执行如图15或图16的物体识别方法。An embodiment of the present application provides a chip, where the chip includes a processor and a data interface, the processor reads an instruction on a memory through the data interface, and executes the object recognition method as shown in FIG. 15 or FIG. 16 .
本申请实施例提供一种芯片,芯片包括处理器与数据接口,所述处理器通过所述数据接口读取存储器上的指令,执行如图12或图13的训练方法。An embodiment of the present application provides a chip, where the chip includes a processor and a data interface, the processor reads an instruction on a memory through the data interface, and executes the training method as shown in FIG. 12 or FIG. 13 .
可选地,作为一种实现方式,所述芯片还可以包括存储器,所述存储器中存储有指令,所述处理器用于执行所述存储器上存储的指令,当所述指令被执行时,所述处理器用于执行图15或图16的物体识别方法或图12或图13的训练方法。Optionally, as an implementation manner, the chip may further include a memory, in which instructions are stored, the processor is configured to execute the instructions stored in the memory, and when the instructions are executed, the The processor is configured to execute the object recognition method of FIG. 15 or FIG. 16 or the training method of FIG. 12 or FIG. 13 .
应理解,本申请实施例中的处理器可以为中央处理单元(central processing unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that the processor in the embodiment of the present application may be a central processing unit (central processing unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (digital signal processors, DSP), application-specific integrated circuits (application specific integrated circuit, ASIC), off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
还应理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的随机存取存储器(random access memory,RAM)可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。It should also be understood that the memory in the embodiments of the present application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory. Volatile memory may be random access memory (RAM), which acts as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (DRAM) Access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory Fetch memory (synchlink DRAM, SLDRAM) and direct memory bus random access memory (direct rambus RAM, DR RAM).
上述实施例,可以全部或部分地通过软件、硬件、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令或计算机程序。在计算机上加载或执行所述计算机指令或计算机程序时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介 质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质。半导体介质可以是固态硬盘。The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server or data center by wire (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that contains one or more sets of available media. The usable media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media. The semiconductor medium may be a solid state drive.
应理解,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,其中A,B可以是单数或者复数。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系,但也可能表示的是一种“和/或”的关系,具体可参考前后文进行理解。It should be understood that the term "and/or" in this document is only an association relationship to describe associated objects, indicating that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, and A and B exist at the same time , there are three cases of B alone, where A and B can be singular or plural. In addition, the character "/" in this document generally indicates that the related objects before and after are an "or" relationship, but may also indicate an "and/or" relationship, which can be understood with reference to the context.
本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。In this application, "at least one" means one or more, and "plurality" means two or more. "At least one item(s) below" or similar expressions thereof refer to any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one item (a) of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c may be single or multiple .
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that, in various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the embodiments of the present application. implementation constitutes any limitation.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的 介质。The functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (27)
- 一种感知网络,其特征在于,包括:主干网络、候选区域生成网络RPN、感兴趣区域提取模块和分类回归网络;A perception network, comprising: a backbone network, a candidate region generation network RPN, a region of interest extraction module and a classification and regression network;所述主干网络,用于对输入图像进行卷积处理,输出所述输入图像的第一特征图;The backbone network is used to perform convolution processing on the input image and output the first feature map of the input image;所述RPN,用于基于第二特征图输出目标物体的候选二维2D框的位置信息,所述目标物体包括多个任务中的待检测的物体,所述多个任务中的每个任务包括至少一个类别,所述第二特征图是根据所述第一特征图确定的;The RPN is used to output the position information of the candidate two-dimensional 2D frame of the target object based on the second feature map, where the target object includes objects to be detected in multiple tasks, and each task in the multiple tasks includes: at least one category, the second feature map is determined according to the first feature map;所述感兴趣区域提取模块,用于基于所述候选2D框的位置信息在第三特征图上提取第一特征信息,所述第一特征信息为所述候选2D框所在区域的特征,所述第三特征图是根据所述第一特征图确定的;The region of interest extraction module is configured to extract first feature information on the third feature map based on the position information of the candidate 2D frame, where the first feature information is a feature of the region where the candidate 2D frame is located, and the The third feature map is determined according to the first feature map;所述分类回归网络,用于对所述第一特征信息进行处理,输出所述目标物体的目标2D框以及第一指示信息,所述目标2D框的数量小于或等于所述候选2D框的数量,所述第一指示信息用于指示所述目标物体所属的类别。The classification and regression network is used to process the first feature information, and output the target 2D frame of the target object and the first indication information, and the number of the target 2D frame is less than or equal to the number of the candidate 2D frames , and the first indication information is used to indicate the category to which the target object belongs.
- 根据权利要求1所述的感知网络,其特征在于,所述分类回归网络具体用于:The perception network according to claim 1, wherein the classification and regression network is specifically used for:对所述第一特征信息进行处理,得到所述候选2D框属于所述多个任务中的各个类别的置信度;processing the first feature information to obtain the confidence that the candidate 2D frame belongs to each category in the multiple tasks;对所述候选2D框的位置信息进行调整,得到调整后的候选2D框;Adjust the position information of the candidate 2D frame to obtain the adjusted candidate 2D frame;根据所述调整后的候选2D框确定所述目标2D框;Determine the target 2D frame according to the adjusted candidate 2D frame;根据所述目标2D框属于各个类别的置信度确定所述第一指示信息。The first indication information is determined according to the confidence that the target 2D frame belongs to each category.
- 根据权利要求2所述的感知网络,其特征在于,所述分类回归网络包括第一区域卷积神经网络RCNN,所述第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,所述隐层与所述多个子分类全连接层相连,所述隐层与所述多个子回归全连接层相连,所述多个子分类全连接层与所述多个任务一一对应,所述多个子回归全连接层与所述多个任务一一对应;The perceptual network according to claim 2, wherein the classification and regression network comprises a first regional convolutional neural network (RCNN), and the first RCNN comprises a hidden layer, a plurality of sub-classification fully connected layers and a plurality of sub-regression fully connected layers layer, the hidden layer is connected with the multiple sub-classification fully connected layers, the hidden layer is connected with the multiple sub-regression fully connected layers, and the multiple sub-classification fully connected layers are in one-to-one correspondence with the multiple tasks, The multiple sub-regression fully connected layers are in one-to-one correspondence with the multiple tasks;所述隐层,用于对所述第一特征信息进行处理,得到第二特征信息;The hidden layer is used to process the first feature information to obtain second feature information;所述子分类全连接层用于根据所述第二特征信息得到所述候选2D框属于所述子分类全连接层对应的任务中的物体类别的置信度;The sub-category fully-connected layer is used to obtain, according to the second feature information, the confidence of the candidate 2D frame belonging to the object category in the task corresponding to the sub-category fully-connected layer;所述子回归全连接层用于根据所述第二特征信息对所述候选2D框的位置信息进行调整,得到所述调整后的候选2D框。The sub-regression fully connected layer is configured to adjust the position information of the candidate 2D frame according to the second feature information to obtain the adjusted candidate 2D frame.
- 根据权利要求2所述的感知网络,其特征在于,所述分类回归网络包括第二RCNN,所述第二RCNN包括隐层、分类全连接层和回归全连接层,所述隐层与所述分类全连接层相连,所述隐层与所述回归全连接层相连;The perception network according to claim 2, wherein the classification and regression network includes a second RCNN, the second RCNN includes a hidden layer, a classification fully connected layer and a regression fully connected layer, the hidden layer and the The classification fully connected layer is connected, and the hidden layer is connected with the regression fully connected layer;所述隐层,用于对所述第一特征信息进行处理,得到第三特征信息;The hidden layer is used to process the first feature information to obtain third feature information;所述分类全连接层,用于根据所述第三特征信息得到所述候选2D框属于所述各个类别的置信度;The classification fully connected layer is used to obtain the confidence that the candidate 2D frame belongs to the respective categories according to the third feature information;所述回归全连接层,用于根据所述第三特征信息对所述候选2D框的位置信息进行调整,得到所述调整后的候选2D框。The regression fully connected layer is configured to adjust the position information of the candidate 2D frame according to the third feature information to obtain the adjusted candidate 2D frame.
- 根据权利要求4所述的感知网络,其特征在于,所述分类全连接层是通过将第一RCNN中的多个子分类全连接层进行合并得到的,所述回归全连接层是通过将所述第一RCNN中的多个子回归全连接层进行合并得到的,The perceptual network according to claim 4, wherein the classification fully connected layer is obtained by merging a plurality of sub-classification fully connected layers in the first RCNN, and the regression fully connected layer is obtained by combining the It is obtained by merging multiple sub-regression fully connected layers in the first RCNN,所述第一RCNN包括所述隐层、多个子分类全连接层和多个子回归全连接层,所述隐层与所述多个子分类全连接层相连,所述隐层与所述多个子回归全连接层相连,所述多个子分类全连接层与所述多个任务一一对应,所述多个子回归全连接层与所述多个任务一一对应;The first RCNN includes the hidden layer, multiple sub-category fully connected layers and multiple sub-regression fully connected layers, the hidden layer is connected to the multiple sub-category fully connected layers, and the hidden layer is connected to the multiple sub-regression layers. The fully-connected layers are connected, the multiple sub-category fully-connected layers are in one-to-one correspondence with the multiple tasks, and the multiple sub-regression fully-connected layers are in one-to-one correspondence with the multiple tasks;所述子分类全连接层用于根据所述第三特征信息得到所述候选2D框属于所述子分类全连接层对应的任务中的物体类别的置信度;The sub-category fully-connected layer is used to obtain, according to the third feature information, the confidence level that the candidate 2D frame belongs to the object category in the task corresponding to the sub-category fully-connected layer;所述子回归全连接层用于根据所述第三特征信息对所述候选2D框的位置信息进行调整,得到所述调整后的候选2D框。The sub-regression fully connected layer is configured to adjust the position information of the candidate 2D frame according to the third feature information to obtain the adjusted candidate 2D frame.
- 一种感知网络的训练方法,其特征在于,所述感知网络包括:候选区域生成网络RPN,所述RPN用于预测样本图像中的目标物体的候选二维2D框的位置信息,所述目标物体包括多个任务的待检测的物体,所述多个任务中的每个任务包括至少一个类别;所述目标物体包括第一任务物体和第二任务物体;A training method for a perceptual network, wherein the perceptual network comprises: a candidate region generation network RPN, the RPN is used to predict the position information of a candidate two-dimensional 2D frame of a target object in a sample image, the target object an object to be detected including multiple tasks, each of the multiple tasks includes at least one category; the target object includes a first task object and a second task object;所述方法包括:The method includes:获取训练数据,所述训练数据包括所述样本图像、所述样本图像上的所述第一任务物体的标注数据以及所述样本图像上的所述第二任务物体的伪框,所述标注数据包括所述第一任务物体的类标签和所述第一任务物体的标注2D框,所述第二任务物体的伪框是通过其他感知网络对所述样本图像进行推理得到的所述第二任务物体的目标2D框;Acquire training data, where the training data includes the sample image, the labeling data of the first task object on the sample image, and the pseudo-frame of the second task object on the sample image, the labeling data Including the class label of the first task object and the labeled 2D frame of the first task object, the pseudo frame of the second task object is the second task obtained by inferring the sample image through other perceptual networks The object's target 2D box;基于所述训练数据对所述感知网络进行训练。The perceptual network is trained based on the training data.
- 根据权利要求6所述的训练方法,其特征在于,所述感知网络还包括主干网络、感兴趣区域提取模块和分类回归网络,The training method according to claim 6, wherein the perception network further comprises a backbone network, a region of interest extraction module and a classification and regression network,所述基于所述训练数据对所述感知网络进行训练,包括:The training of the perception network based on the training data includes:根据所述第一任务物体的标注2D框和所述第二任务物体的目标2D框与所述RPN预测得到的所述样本图像中的目标物体的候选2D框之间的差异计算第一损失函数值;Calculate the first loss function according to the difference between the labeled 2D frame of the first task object and the target 2D frame of the second task object and the candidate 2D frame of the target object in the sample image predicted by the RPN value;根据所述标注数据计算所述感知网络的第二损失函数值;Calculate a second loss function value of the perceptual network according to the labeled data;将所述第一损失函数值和所述第二损失函数值进行反向传播,调整所述感知网络中所需训练的部分的参数,所述感知网络中所需训练的部分包括所述分类回归网络中所需训练的部分、所述感兴趣区域提取模块、所述RPN和所述主干网络,所述分类回归网络中所需训练的部分是根据所述第一任务物体确定的。The first loss function value and the second loss function value are back-propagated, and the parameters of the part to be trained in the perceptual network are adjusted, and the part to be trained in the perceptual network includes the classification regression The part to be trained in the network, the region of interest extraction module, the RPN and the backbone network, and the part to be trained in the classification and regression network are determined according to the first task object.
- 根据权利要求6或7所述的训练方法,其特征在于,The training method according to claim 6 or 7, wherein,所述主干网络,用于对所述样本图像进行卷积处理,输出所述样本图像的第一特征图;the backbone network, configured to perform convolution processing on the sample image, and output the first feature map of the sample image;所述RPN,用于基于第二特征图输出所述目标物体的候选2D框的位置信息,所述第二特征图是根据所述第一特征图确定的;The RPN is used to output the position information of the candidate 2D frame of the target object based on a second feature map, where the second feature map is determined according to the first feature map;所述感兴趣区域提取模块,用于基于所述候选2D框的位置信息在第三特征图上提取第一特征信息,所述第一特征信息为所述候选2D框所在区域的特征,所述第三特征图是根据所述第一特征图确定的;The region of interest extraction module is configured to extract first feature information on the third feature map based on the position information of the candidate 2D frame, where the first feature information is a feature of the region where the candidate 2D frame is located, and the The third feature map is determined according to the first feature map;所述分类回归网络,用于对所述第一特征信息进行处理,输出所述目标物体的目标 2D框以及第一指示信息,所述目标2D框的数量小于或等于所述候选2D框的数量,所述第一指示信息用于指示所述目标物体所属的类别。The classification and regression network is used to process the first feature information, and output the target 2D frame of the target object and the first indication information, and the number of the target 2D frame is less than or equal to the number of the candidate 2D frames , and the first indication information is used to indicate the category to which the target object belongs.
- 根据权利要求8所述的训练方法,其特征在于,所述分类回归网络包括第一区域卷积神经网络RCNN,所述第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,所述隐层与所述多个子分类全连接层相连,所述隐层与所述多个子回归全连接层相连,所述多个子分类全连接层与所述多个任务一一对应,所述多个子回归全连接层与所述多个任务一一对应;The training method according to claim 8, wherein the classification and regression network comprises a first regional convolutional neural network (RCNN), and the first RCNN comprises a hidden layer, multiple sub-classification fully connected layers and multiple sub-regression fully connected layers layer, the hidden layer is connected with the multiple sub-classification fully connected layers, the hidden layer is connected with the multiple sub-regression fully connected layers, and the multiple sub-classification fully connected layers are in one-to-one correspondence with the multiple tasks, The multiple sub-regression fully connected layers are in one-to-one correspondence with the multiple tasks;所述隐层,用于对所述第一特征信息进行处理,得到第二特征信息;The hidden layer is used to process the first feature information to obtain second feature information;所述子分类全连接层用于根据所述第二特征信息得到所述候选2D框属于所述子分类全连接层对应的任务中的物体类别的置信度;The sub-category fully-connected layer is used to obtain, according to the second feature information, the confidence of the candidate 2D frame belonging to the object category in the task corresponding to the sub-category fully-connected layer;所述子回归全连接层用于根据所述第二特征信息对所述候选2D框的位置信息进行调整,得到所述调整后的候选2D框;The sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the second feature information to obtain the adjusted candidate 2D frame;以及as well as所述分类回归网络中所需训练的部分包括所述隐层和与所述第一任务物体所在的任务对应的子分类全连接层和子回归全连接层。The part to be trained in the classification and regression network includes the hidden layer and the sub-classification fully connected layer and the sub-regression fully connected layer corresponding to the task where the first task object is located.
- 一种物体识别方法,其特征在于,感知网络包括:主干网络、候选区域生成网络RPN、感兴趣区域提取模块和分类回归网络,所述方法包括:An object recognition method, characterized in that the perception network comprises: a backbone network, a candidate region generation network RPN, a region of interest extraction module and a classification regression network, the method comprising:利用所述主干网络对输入图像进行卷积处理,得到所述输入图像的第一特征图;Using the backbone network to perform convolution processing on the input image to obtain the first feature map of the input image;利用所述RPN基于第二特征图上输出目标物体的候选二维2D框的位置信息,所述目标物体包括多个任务中的待检测的物体,所述多个任务中的每个任务至少包括一个类别,所述第二特征图是根据所述第一特征图确定的;Using the RPN to output the position information of the candidate two-dimensional 2D frame of the target object based on the second feature map, the target object includes objects to be detected in multiple tasks, and each task in the multiple tasks at least includes a category, the second feature map is determined according to the first feature map;利用所述感兴趣区域提取模块基于所述候选2D框的位置信息在第三特征图上提取第一特征信息,所述第一特征信息为所述候选2D框所在区域的特征,所述第三特征图是根据所述第一特征图确定的;Using the region of interest extraction module to extract first feature information on the third feature map based on the position information of the candidate 2D frame, the first feature information is the feature of the region where the candidate 2D frame is located, and the third The feature map is determined according to the first feature map;利用所述分类回归网络对所述第一特征信息进行处理,得到所述目标物体的目标2D框以及第一指示信息,所述目标2D框的数量小于或等于所述候选2D框的数量,所述第一指示信息用于指示所述目标物体所属的类别。The first feature information is processed by the classification and regression network to obtain the target 2D frame of the target object and the first indication information. The number of the target 2D frames is less than or equal to the number of the candidate 2D frames, so The first indication information is used to indicate the category to which the target object belongs.
- 根据权利要求10所述的方法,其特征在于,所述利用所述分类回归网络对所述第一特征信息进行处理,得到所述目标物体的目标2D框以及第一指示信息,包括:The method according to claim 10, wherein the using the classification and regression network to process the first feature information to obtain the target 2D frame and the first indication information of the target object, comprising:利用所述分类回归网络对所述第一特征信息进行处理,得到所述候选2D框属于所述多个任务中的各个类别的置信度;Use the classification and regression network to process the first feature information to obtain the confidence that the candidate 2D frame belongs to each category in the multiple tasks;利用所述分类回归网络对所述候选2D框的位置信息进行调整,得到调整后的候选2D框;Use the classification and regression network to adjust the position information of the candidate 2D frame to obtain the adjusted candidate 2D frame;根据所述调整后的候选2D框确定所述目标2D框;Determine the target 2D frame according to the adjusted candidate 2D frame;根据所述目标2D框属于各个类别的置信度确定所述第一指示信息。The first indication information is determined according to the confidence that the target 2D frame belongs to each category.
- 根据权利要求11所述的方法,其特征在于,所述分类回归网络包括第一区域卷积神经网络RCNN,所述第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,所述隐层与所述多个子分类全连接层相连,所述隐层与所述多个子回归全连接层相连,所述多个子分类全连接层与所述多个任务一一对应,所述多个子回归全连接层与所述多个 任务一一对应;以及The method according to claim 11, wherein the classification and regression network comprises a first regional convolutional neural network (RCNN), and the first RCNN comprises a hidden layer, a plurality of sub-classification fully connected layers and a plurality of sub-regression fully connected layers , the hidden layer is connected to the multiple sub-classification fully connected layers, the hidden layer is connected to the multiple sub-regression fully connected layers, and the multiple sub-classification fully connected layers are in one-to-one correspondence with the multiple tasks, so The plurality of sub-regression fully connected layers are in one-to-one correspondence with the plurality of tasks; and所述利用所述分类回归网络对所述第一特征信息进行处理,输出所述目标物体的目标2D框以及所述第一指示信息,包括:Using the classification and regression network to process the first feature information, and output the target 2D frame of the target object and the first indication information, include:利用所述隐层对所述第一特征信息进行处理,得到第二特征信息;Use the hidden layer to process the first feature information to obtain second feature information;利用所述子分类全连接层根据所述第二特征信息得到所述候选2D框属于所述子分类全连接层对应的任务中的物体类别的置信度;Using the sub-category fully-connected layer to obtain the confidence level of the object category in the task corresponding to the sub-category fully-connected layer that the candidate 2D frame belongs to according to the second feature information;利用所述子回归全连接层根据所述第二特征信息对所述候选2D框的位置信息进行调整,得到所述调整后的候选2D框。The position information of the candidate 2D frame is adjusted by using the sub-regression fully connected layer according to the second feature information to obtain the adjusted candidate 2D frame.
- 根据权利要求11所述的方法,其特征在于,所述分类回归网络包括第二RCNN,所述第二RCNN包括隐层、分类全连接层和回归全连接层,所述隐层与所述分类全连接层相连,所述隐层与所述回归全连接层相连;以及The method according to claim 11, wherein the classification and regression network comprises a second RCNN, the second RCNN comprises a hidden layer, a classification fully connected layer and a regression fully connected layer, the hidden layer and the classification A fully connected layer is connected, and the hidden layer is connected to the regression fully connected layer; and所述利用所述分类回归网络对所述第一特征信息进行处理,输出所述目标物体的目标2D框以及第一指示信息,包括:The processing of the first feature information by using the classification and regression network, and outputting the target 2D frame of the target object and the first indication information, including:利用所述隐层对所述第一特征信息进行处理,得到第三特征信息;Use the hidden layer to process the first feature information to obtain third feature information;利用所述分类全连接层根据所述第三特征信息得到所述候选2D框属于所述各个类别的置信度;Obtain the confidence that the candidate 2D frame belongs to the respective categories according to the third feature information by using the classification fully-connected layer;利用所述回归全连接层根据所述第三特征信息对所述候选2D框的位置信息进行调整,得到所述调整后的候选2D框。The position information of the candidate 2D frame is adjusted by using the regression fully connected layer according to the third feature information to obtain the adjusted candidate 2D frame.
- 根据权利要求13所述的方法,其特征在于,所述分类全连接层是通过将第一RCNN中的多个子分类全连接层进行合并得到的,所述回归全连接层是通过将所述第一RCNN中的多个子回归全连接层进行合并得到的,The method according to claim 13, wherein the classification fully connected layer is obtained by merging multiple sub-classification fully connected layers in the first RCNN, and the regression fully connected layer is obtained by combining the first RCNN It is obtained by merging multiple sub-regression fully connected layers in an RCNN,所述第一RCNN包括所述隐层、所述多个子分类全连接层和所述多个子回归全连接层,所述隐层与所述多个子分类全连接层相连,所述隐层与所述多个子回归全连接层相连,所述多个子分类全连接层与所述多个任务一一对应,所述多个子回归全连接层与所述多个任务一一对应;The first RCNN includes the hidden layer, the multiple sub-category fully connected layers and the multiple sub-regression fully connected layers, the hidden layer is connected to the multiple sub-category fully connected layers, and the hidden layer is connected to the multiple sub-category fully connected layers. The multiple sub-regression fully-connected layers are connected, the multiple sub-classification fully-connected layers are in one-to-one correspondence with the multiple tasks, and the multiple sub-regression fully-connected layers are in one-to-one correspondence with the multiple tasks;所述子分类全连接层用于根据所述第三特征信息得到所述候选2D框属于所述子分类全连接层对应的任务中的物体类别的置信度;The sub-category fully-connected layer is used to obtain, according to the third feature information, the confidence level that the candidate 2D frame belongs to the object category in the task corresponding to the sub-category fully-connected layer;所述子回归全连接层用于根据所述第三特征信息对所述候选2D框的位置信息进行调整,得到所述调整后的候选2D框。The sub-regression fully connected layer is configured to adjust the position information of the candidate 2D frame according to the third feature information to obtain the adjusted candidate 2D frame.
- 一种感知网络的训练装置,其特征在于,所述感知网络包括候选区域生成网络RPN,所述RPN用于预测样本图像中的目标物体的候选二维2D框的位置信息,所述目标物体包括多个任务的待检测的物体,所述多个任务中的每个任务包括至少一个类别,所述目标物体包括第一任务物体和第二任务物体;所述训练装置包括:A training device for a perceptual network, wherein the perceptual network includes a candidate region generation network RPN, the RPN is used to predict the position information of a candidate two-dimensional 2D frame of a target object in a sample image, and the target object includes Objects to be detected for multiple tasks, each task in the multiple tasks includes at least one category, and the target objects include a first task object and a second task object; the training device includes:获取单元,用于获取训练数据,所述训练数据包括所述样本图像、所述样本图像上的所述第一任务物体的标注数据以及所述样本图像上的所述第二任务物体的伪框,所述标注数据包括所述第一任务物体的类标签和所述第一任务物体的标注2D框,所述第二任务物体的伪框是通过其他感知网络对所述样本图像进行推理得到的所述第二任务物体的目标2D框;an acquisition unit, configured to acquire training data, the training data includes the sample image, the labeling data of the first task object on the sample image, and the pseudo frame of the second task object on the sample image , the annotation data includes the class label of the first task object and the labeled 2D frame of the first task object, and the pseudo frame of the second task object is obtained by inferring the sample image through other perceptual networks the target 2D frame of the second task object;处理单元,用于基于所述训练数据对所述感知网络进行训练。A processing unit, configured to train the perception network based on the training data.
- 根据权利要求15所述的训练装置,其特征在于,所述感知网络还包括主干网络、感兴趣区域提取模块和分类回归网络,以及所述处理单元具体用于:The training device according to claim 15, wherein the perception network further comprises a backbone network, a region of interest extraction module and a classification and regression network, and the processing unit is specifically configured to:根据所述第一任务物体的标注2D框和所述第二任务物体的目标2D框与所述RPN预测得到的所述样本图像中的目标物体的候选2D框之间的差异计算第一损失函数值;Calculate the first loss function according to the difference between the labeled 2D frame of the first task object and the target 2D frame of the second task object and the candidate 2D frame of the target object in the sample image predicted by the RPN value;根据所述标注数据计算所述感知网络的第二损失函数值;Calculate a second loss function value of the perceptual network according to the labeled data;将所述第一损失函数值和所述第二损失函数值进行反向传播,调整所述感知网络中所需训练的部分的参数,所述感知网络中所需训练的部分包括所述分类回归网络中所需训练的部分、所述感兴趣区域提取模块、所述RPN和所述主干网络,所述分类回归网络中所需训练的部分是根据所述第一任务物体确定的。The first loss function value and the second loss function value are back-propagated, and the parameters of the part to be trained in the perceptual network are adjusted, and the part to be trained in the perceptual network includes the classification regression The part to be trained in the network, the region of interest extraction module, the RPN and the backbone network, and the part to be trained in the classification and regression network are determined according to the first task object.
- 根据权利要求15或16所述的训练装置,其特征在于,The training device according to claim 15 or 16, characterized in that,所述主干网络,用于对所述样本图像进行卷积处理,输出所述样本图像的第一特征图;the backbone network, configured to perform convolution processing on the sample image, and output the first feature map of the sample image;所述RPN,用于基于第二特征图上输出目标物体的候选2D框的位置信息,所述第二特征图是根据所述第一特征图确定的;The RPN is used to output the position information of the candidate 2D frame of the target object based on the second feature map, and the second feature map is determined according to the first feature map;所述感兴趣区域提取模块,用于基于所述候选2D框的位置信息在第三特征图上提取第一特征信息,所述第一特征信息为所述候选2D框所在区域的特征,所述第三特征图是根据所述第一特征图确定的;The region of interest extraction module is configured to extract first feature information on the third feature map based on the position information of the candidate 2D frame, where the first feature information is a feature of the region where the candidate 2D frame is located, and the The third feature map is determined according to the first feature map;所述分类回归网络,用于对所述第一特征信息进行处理,输出所述目标物体的目标2D框以及第一指示信息,所述目标物体的目标2D框的数量小于或等于所述目标物体的候选2D框的数量,所述第一指示信息用于指示所述目标物体所属的类别。The classification and regression network is used to process the first feature information, and output the target 2D frame of the target object and the first indication information, and the number of target 2D frames of the target object is less than or equal to the target object The number of candidate 2D boxes of , the first indication information is used to indicate the category to which the target object belongs.
- 根据权利要求17所述的训练装置,其特征在于,所述分类回归网络包括第一区域卷积神经网络RCNN,所述第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,所述隐层与所述多个子分类全连接层相连,所述隐层与所述多个子回归全连接层相连,所述多个子分类全连接层与所述多个任务一一对应,所述多个子回归全连接层与所述多个任务一一对应;The training device according to claim 17, wherein the classification and regression network comprises a first regional convolutional neural network (RCNN), and the first RCNN comprises a hidden layer, a plurality of sub-classification fully connected layers and a plurality of sub-regression fully connected layers layer, the hidden layer is connected to the multiple sub-classification fully connected layers, the hidden layer is connected to the multiple sub-regression fully connected layers, and the multiple sub-classification fully connected layers correspond to the multiple tasks one-to-one, The multiple sub-regression fully connected layers are in one-to-one correspondence with the multiple tasks;所述隐层,用于对所述第一特征信息进行处理,得到第二特征信息;The hidden layer is used to process the first feature information to obtain second feature information;所述子分类全连接层用于根据所述第二特征信息得到所述候选2D框属于所述子分类全连接层对应的任务中的物体类别的置信度;The sub-category fully-connected layer is used to obtain, according to the second feature information, the confidence of the candidate 2D frame belonging to the object category in the task corresponding to the sub-category fully-connected layer;所述子回归全连接层用于根据所述隐层处理后的结果对所述候选2D框的位置信息进行调整,得到所述调整后的候选2D框;The sub-regression fully connected layer is used to adjust the position information of the candidate 2D frame according to the result of the hidden layer processing, so as to obtain the adjusted candidate 2D frame;以及as well as所述分类回归网络中所需训练的部分包括所述隐层和与所述第一任务物体所在的任务对应的子分类全连接层和子回归全连接层。The part to be trained in the classification and regression network includes the hidden layer and the sub-classification fully connected layer and the sub-regression fully connected layer corresponding to the task where the first task object is located.
- 一种物体识别装置,其特征在于,感知网络包括:主干网络、候选区域生成网络RPN、感兴趣区域提取模块和分类回归网络,所述感知网络部署于所述装置上,所述装置包括:An object recognition device, characterized in that the perception network includes: a backbone network, a candidate region generation network RPN, a region of interest extraction module and a classification and regression network, the perception network is deployed on the device, and the device includes:获取单元,用于获取输入图像;an acquisition unit for acquiring an input image;处理单元,用于:Processing unit for:利用所述主干网络对输入图像进行卷积处理,得到所述输入图像的第一特征图;Using the backbone network to perform convolution processing on the input image to obtain the first feature map of the input image;利用所述RPN基于第二特征图输出目标物体的候选二维2D框的位置信息,所述目标 物体包括多个任务中的待检测的物体,所述多个任务中的每个任务包括至少一个类别,所述第二特征图是根据所述第一特征图确定的;Using the RPN to output the position information of the candidate two-dimensional 2D frame of the target object based on the second feature map, the target object includes objects to be detected in multiple tasks, and each task in the multiple tasks includes at least one category, the second feature map is determined according to the first feature map;利用所述感兴趣区域提取模块基于所述候选2D框的位置信息在第三特征图上提取第一特征信息,所述第一特征信息为所述候选2D框所在区域的特征,所述第三特征图是根据所述第一特征图确定的;Using the region of interest extraction module to extract first feature information on the third feature map based on the position information of the candidate 2D frame, the first feature information is the feature of the region where the candidate 2D frame is located, and the third The feature map is determined according to the first feature map;利用所述分类回归网络对所述第一特征信息进行处理,得到所述目标物体的目标2D框以及第一指示信息,所述目标物体的目标2D框的数量小于或等于所述目标物体的候选2D框的数量,所述第一指示信息用于指示所述目标物体所属类别。The first feature information is processed by the classification and regression network to obtain the target 2D frame of the target object and the first indication information. The number of target 2D frames of the target object is less than or equal to the candidate of the target object The number of 2D boxes, and the first indication information is used to indicate the category to which the target object belongs.
- 根据权利要求19所述的装置,其特征在于,所述处理单元具体用于:The device according to claim 19, wherein the processing unit is specifically configured to:利用所述分类回归网络对所述第一特征信息进行处理,得到所述候选2D框属于所述多个任务中的各个类别的置信度;Using the classification and regression network to process the first feature information to obtain the confidence that the candidate 2D frame belongs to each category in the multiple tasks;利用所述分类回归网络对所述候选2D框的位置信息进行调整,得到调整后的候选2D框;Use the classification and regression network to adjust the position information of the candidate 2D frame to obtain the adjusted candidate 2D frame;根据所述调整后的候选2D框确定所述目标2D框;Determine the target 2D frame according to the adjusted candidate 2D frame;根据所述目标2D框属于各个类别的置信度确定所述第一指示信息。The first indication information is determined according to the confidence that the target 2D frame belongs to each category.
- 根据权利要求20所述的装置,其特征在于,所述分类回归网络包括第一区域卷积神经网络RCNN,所述第一RCNN包括隐层、多个子分类全连接层和多个子回归全连接层,所述隐层与所述多个子分类全连接层相连,所述隐层与所述多个子回归全连接层相连,所述多个子分类全连接层与所述多个任务一一对应,所述多个子回归全连接层与所述多个任务一一对应;以及所述处理单元具体用于:The apparatus according to claim 20, wherein the classification and regression network comprises a first regional convolutional neural network (RCNN), and the first RCNN comprises a hidden layer, multiple sub-classification fully connected layers and multiple sub-regression fully connected layers , the hidden layer is connected with the multiple sub-classification fully connected layers, the hidden layer is connected with the multiple sub-regression fully connected layers, and the multiple sub-classification fully connected layers are in one-to-one correspondence with the multiple tasks, so The multiple sub-regression fully connected layers are in one-to-one correspondence with the multiple tasks; and the processing unit is specifically used for:利用所述隐层对所述第一特征信息进行处理,得到第二特征信息;利用所述子分类全连接层根据所述第二特征信息得到所述候选2D框属于所述子分类全连接层对应的任务中的物体类别的置信度;Use the hidden layer to process the first feature information to obtain second feature information; use the sub-class fully connected layer to obtain the candidate 2D frame belonging to the sub-class fully connected layer according to the second feature information The confidence of the object category in the corresponding task;利用所述子回归全连接层根据所述第二特征信息对所述候选2D框的位置信息进行调整,得到所述调整后的候选2D框。The position information of the candidate 2D frame is adjusted by using the sub-regression fully connected layer according to the second feature information to obtain the adjusted candidate 2D frame.
- 根据权利要求20所述的装置,其特征在于,所述分类回归网络包括第二RCNN,所述第二RCNN包括隐层、分类全连接层和回归全连接层,所述隐层与所述分类全连接层相连,所述隐层与所述回归全连接层相连;以及所述处理单元具体用于:The apparatus according to claim 20, wherein the classification and regression network comprises a second RCNN, the second RCNN comprises a hidden layer, a classification fully connected layer and a regression fully connected layer, the hidden layer and the classification The fully connected layer is connected, and the hidden layer is connected with the regression fully connected layer; and the processing unit is specifically used for:利用所利用所述隐层对所述第一特征信息进行处理,得到第三特征信息;Use the hidden layer to process the first feature information to obtain third feature information;利用所述分类全连接层根据所述得到第三特征信息得到所述候选2D框属于所述各个类别的置信度;Using the classification fully connected layer to obtain the confidence that the candidate 2D frame belongs to the respective categories according to the obtained third feature information;利用所述回归全连接层根据所述得到第三特征信息对所述候选2D框的位置信息进行调整,得到所述调整后的候选2D框。Using the regression fully connected layer to adjust the position information of the candidate 2D frame according to the obtained third feature information, to obtain the adjusted candidate 2D frame.
- 根据权利要求22所述的装置,其特征在于,所述分类全连接层是通过将第一RCNN中的多个子分类全连接层进行合并得到的,所述回归全连接层是通过将所述第一RCNN中的多个子回归全连接层进行合并得到的,The apparatus according to claim 22, wherein the classification fully connected layer is obtained by merging a plurality of sub-classification fully connected layers in the first RCNN, and the regression fully connected layer is obtained by combining the first RCNN It is obtained by merging multiple sub-regression fully connected layers in an RCNN,所述第一RCNN包括所述隐层、所述多个子分类全连接层和所述多个子回归全连接层,所述隐层与所述多个子分类全连接层相连,所述隐层与所述多个子回归全连接层相连,所述多个子分类全连接层与所述多个任务一一对应,所述多个子回归全连接层与所述多个 任务一一对应;The first RCNN includes the hidden layer, the multiple sub-category fully connected layers and the multiple sub-regression fully connected layers, the hidden layer is connected to the multiple sub-category fully connected layers, and the hidden layer is connected to the multiple sub-category fully connected layers. The multiple sub-regression fully-connected layers are connected, the multiple sub-classification fully-connected layers are in one-to-one correspondence with the multiple tasks, and the multiple sub-regression fully-connected layers are in one-to-one correspondence with the multiple tasks;所述子分类全连接层用于根据所述得到第三特征信息得到所述候选2D框属于所述子分类全连接层对应的任务中的物体类别的置信度;The sub-category fully-connected layer is used to obtain the confidence level of the object category in the task corresponding to the sub-category fully-connected layer that the candidate 2D frame belongs to according to the obtained third feature information;所述子回归全连接层用于根据所述得到第三特征信息对所述候选2D框的位置信息进行调整,得到所述调整后的候选2D框。The sub-regression fully connected layer is configured to adjust the position information of the candidate 2D frame according to the obtained third feature information to obtain the adjusted candidate 2D frame.
- 一种感知网络的训练装置,其特征在于,包括处理器和传输接口,所述处理器通过所述传输接口接收或发送数据,所述处理器被配置为调用存储在存储器中的程序指令,以执行权利要求6至9中任一项所述的方法。A training device for a perception network, characterized in that it includes a processor and a transmission interface, the processor receives or sends data through the transmission interface, and the processor is configured to call program instructions stored in a memory to The method of any one of claims 6 to 9 is performed.
- 一种物体识别装置,其特征在于,包括处理器和传输接口,所述处理器通过所述传输接口接收或发送数据,所述处理器被配置为调用存储在存储器中的程序指令,以执行权利要求10至14中任一项所述的方法。An object recognition device, characterized in that it includes a processor and a transmission interface, the processor receives or sends data through the transmission interface, and the processor is configured to call program instructions stored in a memory to execute a right The method of any one of claims 10 to 14.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储用于设备执行的程序代码,当所述程序代码在计算机或处理器上运行时,使得所述计算机或所述处理器执行如权利要求6至9或10至14中任一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores program code for execution by a device, and when the program code is executed on a computer or a processor, causes the computer or the processing The device performs the method of any one of claims 6 to 9 or 10 to 14.
- 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在计算机或处理器上运行时,使得所述计算机或所述处理器执行如权利要求6至9或10至14中任一项所述的方法。A computer program product comprising instructions, characterized in that, when the computer program product is run on a computer or a processor, the computer or the processor is caused to perform any one of claims 6 to 9 or 10 to 14. one of the methods described.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202180096605.3A CN117157679A (en) | 2021-04-12 | 2021-04-12 | Perception network, training method of perception network, object recognition method and device |
PCT/CN2021/086643 WO2022217434A1 (en) | 2021-04-12 | 2021-04-12 | Cognitive network, method for training cognitive network, and object recognition method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2021/086643 WO2022217434A1 (en) | 2021-04-12 | 2021-04-12 | Cognitive network, method for training cognitive network, and object recognition method and apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022217434A1 true WO2022217434A1 (en) | 2022-10-20 |
Family
ID=83639331
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/086643 WO2022217434A1 (en) | 2021-04-12 | 2021-04-12 | Cognitive network, method for training cognitive network, and object recognition method and apparatus |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN117157679A (en) |
WO (1) | WO2022217434A1 (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115713500A (en) * | 2022-11-07 | 2023-02-24 | 广州汽车集团股份有限公司 | Visual perception method and device |
CN116821699A (en) * | 2023-08-31 | 2023-09-29 | 山东海量信息技术研究院 | Perception model training method and device, electronic equipment and storage medium |
CN117152582A (en) * | 2023-08-16 | 2023-12-01 | 中国长城科技集团股份有限公司 | Target detection system, method, device, equipment and medium |
WO2024103803A1 (en) * | 2022-11-16 | 2024-05-23 | 华为技术有限公司 | Target detection method and apparatus, and storage medium |
WO2024179485A1 (en) * | 2023-02-28 | 2024-09-06 | 华为技术有限公司 | Image processing method and related device thereof |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10223610B1 (en) * | 2017-10-15 | 2019-03-05 | International Business Machines Corporation | System and method for detection and classification of findings in images |
CN109784194A (en) * | 2018-12-20 | 2019-05-21 | 上海图森未来人工智能科技有限公司 | Target detection network establishing method and training method, object detection method |
CN110298262A (en) * | 2019-06-06 | 2019-10-01 | 华为技术有限公司 | Object identification method and device |
CN110533067A (en) * | 2019-07-22 | 2019-12-03 | 杭州电子科技大学 | The end-to-end Weakly supervised object detection method that frame based on deep learning returns |
CN110705544A (en) * | 2019-09-05 | 2020-01-17 | 中国民航大学 | Self-adaptive rapid target detection method based on fast-RCNN |
-
2021
- 2021-04-12 CN CN202180096605.3A patent/CN117157679A/en active Pending
- 2021-04-12 WO PCT/CN2021/086643 patent/WO2022217434A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10223610B1 (en) * | 2017-10-15 | 2019-03-05 | International Business Machines Corporation | System and method for detection and classification of findings in images |
CN109784194A (en) * | 2018-12-20 | 2019-05-21 | 上海图森未来人工智能科技有限公司 | Target detection network establishing method and training method, object detection method |
CN110298262A (en) * | 2019-06-06 | 2019-10-01 | 华为技术有限公司 | Object identification method and device |
CN110533067A (en) * | 2019-07-22 | 2019-12-03 | 杭州电子科技大学 | The end-to-end Weakly supervised object detection method that frame based on deep learning returns |
CN110705544A (en) * | 2019-09-05 | 2020-01-17 | 中国民航大学 | Self-adaptive rapid target detection method based on fast-RCNN |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115713500A (en) * | 2022-11-07 | 2023-02-24 | 广州汽车集团股份有限公司 | Visual perception method and device |
WO2024103803A1 (en) * | 2022-11-16 | 2024-05-23 | 华为技术有限公司 | Target detection method and apparatus, and storage medium |
WO2024179485A1 (en) * | 2023-02-28 | 2024-09-06 | 华为技术有限公司 | Image processing method and related device thereof |
CN117152582A (en) * | 2023-08-16 | 2023-12-01 | 中国长城科技集团股份有限公司 | Target detection system, method, device, equipment and medium |
CN116821699A (en) * | 2023-08-31 | 2023-09-29 | 山东海量信息技术研究院 | Perception model training method and device, electronic equipment and storage medium |
CN116821699B (en) * | 2023-08-31 | 2024-01-19 | 山东海量信息技术研究院 | Perception model training method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN117157679A (en) | 2023-12-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020253416A1 (en) | Object detection method and device, and computer storage medium | |
WO2020244653A1 (en) | Object identification method and device | |
WO2021043112A1 (en) | Image classification method and apparatus | |
WO2022217434A1 (en) | Cognitive network, method for training cognitive network, and object recognition method and apparatus | |
WO2021147325A1 (en) | Object detection method and apparatus, and storage medium | |
Mendes et al. | Exploiting fully convolutional neural networks for fast road detection | |
WO2021155792A1 (en) | Processing apparatus, method and storage medium | |
CN111368972B (en) | Convolutional layer quantization method and device | |
CN110309856A (en) | Image classification method, the training method of neural network and device | |
US12039440B2 (en) | Image classification method and apparatus, and image classification model training method and apparatus | |
CN110222718B (en) | Image processing method and device | |
CN111401517A (en) | Method and device for searching perception network structure | |
CN113591872A (en) | Data processing system, object detection method and device | |
WO2022179606A1 (en) | Image processing method and related apparatus | |
Grigorev et al. | Depth estimation from single monocular images using deep hybrid network | |
WO2022156475A1 (en) | Neural network model training method and apparatus, and data processing method and apparatus | |
US20230401826A1 (en) | Perception network and data processing method | |
CN114972182A (en) | Object detection method and device | |
CN112805723B (en) | Image processing system and method and automatic driving vehicle comprising system | |
CN113449550A (en) | Human body weight recognition data processing method, human body weight recognition method and device | |
CN115731530A (en) | Model training method and device | |
CN114881096A (en) | Multi-label class balancing method and device | |
Pan et al. | LVD-YOLO: An efficient lightweight vehicle detection model for intelligent transportation systems | |
US20240273364A1 (en) | Data processing method, apparatus, and system | |
US20240169733A1 (en) | Method and electronic device with video processing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21936329 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21936329 Country of ref document: EP Kind code of ref document: A1 |