Perception method and device based on multi-task learning network, storage medium, and terminal
By introducing adjustment network layers and semi-supervised learning methods into the multi-task learning network and dynamically adjusting weight values, the problems of insufficient generalization ability and low accuracy of perception results in the existing multi-task learning network are solved, reducing labor costs and Improved accuracy of perception results.
Patent Information
- Application Number
- CN202111677833.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-12-31
AI Technical Summary
Existing multi-task learning networks have insufficient generalization capabilities, low accuracy of perception results, and high labor costs due to their reliance on supervised learning and artificially set weight values.
Using a semi-supervised learning method, an adjustment network layer is added between the feature network layer and the task head network layer to dynamically adjust the weight value, and use samples with confirmed and undetermined recognition results for training to optimize the structure and parameters of the multi-task learning network. .
It effectively reduces the labor cost of training, improves the generalization ability of the multi-task learning network and the accuracy of perception results, and avoids the shortcomings of artificially setting weight values.
Smart Images

Figure CN114519381B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning, and in particular to a perception method and device based on a multi-task learning network, a storage medium, and a terminal. Background Art
[0002] The perception algorithm in autonomous driving plays an important role in the vehicle's cognition of the surrounding environment. The perceived targets generally include obstacles such as pedestrians, vehicles, and bicycles. The perception algorithms generally include target detection, tracking, semantic segmentation, instance segmentation, clustering, depth estimation, etc. Since all perception algorithms must be deployed on the computer on the vehicle, this places high demands on the computer's performance and also increases the cost of the equipment in disguise. In order to effectively reduce the computational cost of the algorithm, and considering the interrelationships between different perception tasks in autonomous driving, people have developed multi-task learning methods, which put multiple related tasks together for learning, and multiple tasks can share the domain-related information they have learned during the learning process.
[0003] In the prior art, the current mainstream multi-task learning method adopts the structure of a shared feature network and a task head network. In addition, in the prior art, when training a multi-task learning network, a fixed weight value is generally set for each task head network manually, and the manually set weight is not necessarily optimal, and the fixed weight value is not conducive to the training of the entire multi-task learning network, resulting in the trained multi-task learning network outputting insufficient accuracy of the perception results in practical applications; furthermore, the current mainstream method uses a supervised learning method to train the entire network, but the labeling of data requires a lot of manpower costs, and the generalization ability of the multi-task learning network trained only with labeled sample data is insufficient.
[0004] Therefore, there is an urgent need for a perception method based on a multi-task learning network, which can reduce the manpower cost required for training while effectively improving the generalization ability of the trained multi-task learning network and improving the accuracy of the perception results output by the multi-task learning network. Summary of the invention
[0005] The technical problem solved by the present invention is that the generalization ability of the multi-task learning network in the prior art is insufficient and the accuracy of the perception results is not high.
[0006] In order to solve the above technical problems, an embodiment of the present invention provides a perception method based on a multi-task learning network, characterized in that the multi-task learning network includes a feature network layer, an adjustment network layer, and a task head network layer, wherein the adjustment network layer includes multiple adjustment networks, and the task head network layer includes multiple task head networks, and the multiple adjustment networks correspond to the multiple task head networks one by one; the method includes: constructing a training sample set, wherein the training sample set includes samples with determined recognition results and samples with undetermined recognition results; inputting the samples with determined recognition results into the entire multi-task learning network, and determining the preferred feature network layer parameters and the multi-task learning network after initial training through training; fixing the feature network layer parameters; The parameters of the feature network layer are the preferred feature network layer parameters, the samples with determined recognition results are input into the initially trained multi-task learning network, and the preferred adjustment network layer parameters and the retrained multi-task learning network are obtained through training; the parameters of the feature network layer are fixed as the preferred feature network layer parameters, and the parameters of the adjustment network layer are fixed as the preferred adjustment network layer parameters, the samples with determined recognition results and the screened samples obtained by screening the samples with undetermined recognition results are input into the retrained multi-task learning network, and the adjusted multi-task learning network is obtained through training; the image to be perceived is input into the adjusted multi-task learning network to obtain the perception result.
[0007] Optionally, the samples of the determined recognition results are input into the entire multi-task learning network, and the preferred feature network layer parameters and the multi-task learning network after initial training are determined through training, including: setting the loss function of the multi-task learning network; inputting the samples of the determined recognition results into the entire multi-task learning network to perform initial training on the multi-task learning network until the loss function of the multi-task learning network converges, stopping the training and obtaining the preferred feature network layer parameters and the multi-task learning network after initial training.
[0008] Optionally, the sample of the determined recognition result is input into the entire multi-task learning network, and the preferred feature network layer parameters and the multi-task learning network after initial training are determined through training, including: setting the loss function of the multi-task learning network; inputting the sample of the determined recognition result into the entire multi-task learning network to perform initial training on the multi-task learning network. During the initial training, each time the weight value of each task head network is updated, the parameters of the feature network layer are also updated until the loss function of the multi-task learning network converges, and the training is stopped to obtain the preferred feature network layer parameters and the multi-task learning network after initial training.
[0009] Optionally, the loss function of the multi-task learning network is:
[0010]
[0011] Among them, Loss represents the loss function value of the entire multi-task learning network. represents the weight value of the kth task head network, k represents the number of task head networks, L k Represents the loss function value of the k-th task head network.
[0012] Optionally, the parameters of the feature network layer are fixed to the preferred feature network layer parameters, and the samples of the determined recognition results are input into the multi-task learning network after initial training, and the preferred adjustment network layer parameters and the retrained multi-task learning network are obtained through training, including: setting the loss function of each adjustment network, and fixing the parameters of the feature network layer to the preferred feature network layer parameters; inputting the samples of the determined recognition results into the multi-task learning network after initial training to retrain the multi-task learning network after initial training until the loss functions of the various adjustment networks are all converged, stopping the training and obtaining the preferred adjustment network layer parameters and the retrained multi-task learning network.
[0013] Optionally, the following method is used to screen the samples with undetermined recognition results to obtain the screened samples, including: inputting the samples with undetermined recognition results into the retrained multi-task learning network, and outputting the perception results of each sample with undetermined recognition results and the confidence of each perception result; selecting samples with confidence greater than a preset confidence threshold as the screened samples.
[0014] Optionally, the parameters of the feature network layer are fixed as the preferred feature network layer parameters, and the parameters of the adjustment network layer are fixed as the preferred adjustment network layer parameters, and the samples with determined recognition results and the screened samples obtained after screening the samples with undetermined recognition results are input into the retrained multi-task learning network, and the adjusted multi-task learning network obtained after training includes: setting the loss function of each task head network, and fixing the parameters of the feature network layer as the preferred feature network layer parameters, and fixing the parameters of the adjustment network layer as the preferred adjustment network layer parameters; inputting the samples with determined recognition results and the screened samples into the retrained multi-task learning network to train the retrained multi-task learning network until the loss functions of the task head networks are all converged, and stopping the training to obtain the adjusted multi-task learning network.
[0015] Optionally, the multi-task learning network satisfies one or more of the following: the feature network structure in the feature network layer adopts the darknet structure in the single-step strategy algorithm yolo; the structure of each adjustment network in the adjustment network layer adopts the bottleneck layer bottleneck network structure.
[0016] Optionally, the task head network layer includes one or more of the following: a semantic segmentation head, a low obstacle segmentation head, a target detection head, a garbage detection head, and a traffic light detection head.
[0017] Optionally, the task head network satisfies one or more of the following: the semantic segmentation head adopts a segmentation mask SegMaskPSP structure; the low obstacle segmentation head adopts a segmentation mask SegMaskPSP structure; the target detection head adopts a fully convolutional network FCN structure; the garbage detection head adopts a fully convolutional network FCN structure; the traffic light detection head adopts a fully convolutional network FCN structure.
[0018] The embodiment of the present invention also provides a perception device based on a multi-task learning network, including: a training sample set construction module, used to construct a training sample set, wherein the training sample set includes samples with determined recognition results and samples with undetermined recognition results; an initial training module, used to input the samples with determined recognition results into the entire multi-task learning network, and determine the preferred feature network layer parameters and the multi-task learning network after initial training through training; a retraining module, used to fix the parameters of the feature network layer as the preferred feature network layer parameters, input the samples with determined recognition results into the multi-task learning network after initial training, and obtain the preferred adjustment network layer parameters and the retrained multi-task learning network through training; a network adjustment module, used to fix the parameters of the feature network layer as the preferred feature network layer parameters, and fix the parameters of the adjustment network layer as the preferred adjustment network layer parameters, input the samples with determined recognition results and the screening samples obtained by screening the samples with undetermined recognition results into the retrained multi-task learning network, and obtain the adjusted multi-task learning network through training; a perception result determination module, used to input the image to be perceived into the adjusted multi-task learning network to obtain a perception result.
[0019] An embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned perception method based on the multi-task learning network are executed.
[0020] An embodiment of the present invention also provides a terminal, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor executes the steps of the above-mentioned perception method based on the multi-task learning network when running the computer program.
[0021] Compared with the prior art, the technical solution of the embodiment of the present invention has the following beneficial effects:
[0022] In an embodiment of the present invention, a training sample set is first constructed, wherein the training sample set includes samples with determined recognition results and samples with undetermined recognition results; the samples with determined recognition results are input into the entire multi-task learning network, and the optimal feature network layer parameters and the multi-task learning network after initial training are determined through training; then the parameters of the feature network layer are fixed, and the samples with determined recognition results are input into the multi-task learning network after initial training, and the optimal adjustment network layer parameters and the retrained multi-task learning network are obtained through training; the parameters of the feature network layer and the adjustment network layer are fixed again, and the samples with determined recognition results and the samples after screening of the samples with undetermined recognition results are input into the retrained multi-task learning network, and the adjusted multi-task learning network is obtained through training; the image to be perceived is input into the adjusted multi-task learning network to obtain the perception result. Compared with the prior art, there is no adjustment network corresponding to each task head network one by one, and the weight values of each task head network are generally set manually when training the feature network, resulting in the insufficient accuracy of the perception results output by the trained multi-task learning network in practical applications; in addition, the adopted supervised method (the training samples only contain labeled samples) requires a lot of manpower cost to label the data during training, and the generalization ability of the trained multi-task learning network is insufficient. The embodiment of the present invention adds an adjustment network layer containing multiple adjustment networks between the feature network layer and the task head network layer, and also adopts a semi-supervised learning method (using multiple categories of samples including samples with determined recognition results and samples with undetermined recognition results as training samples) to fine-tune the entire network, which can effectively reduce the manpower cost of training, improve the generalization ability of the trained multi-task learning network, and improve the accuracy of the perception results output by the entire network.
[0023] Furthermore, during the initial training process, each time the weight value of each task head network is updated, the parameters of the feature network layer are also updated until the loss function of the multi-task learning network converges, and the training is stopped to obtain the preferred feature network layer parameters and the multi-task learning network after initial training. By adopting the above method, the weight value of each task head network is dynamically adjusted according to the training status of each task head network during the training process, which improves the problem of inaccurate artificial setting of the weight value of each task head network in the prior art, effectively improves the training effect of each task head network, and thus improves the accuracy of the perception results output by the entire trained multi-task learning network in practical applications.
[0024] Furthermore, the following method is adopted to screen the samples with undetermined recognition results to obtain the screening samples, including: inputting the samples with undetermined recognition results into the retrained multi-task learning network, and outputting the perception results of each sample with undetermined recognition results and the confidence of each perception result; selecting samples with confidence greater than a preset confidence threshold as the screening samples. Since the samples with undetermined recognition results do not require manual labeling, and their selection has a certain degree of randomness, the screening samples after screening are used as part of the training data to further adjust the entire network, which can effectively reduce labor costs and improve the generalization ability of the multi-task learning network. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flow chart of a perception method based on a multi-task learning network in an embodiment of the present invention;
[0026] Figure 2 is an overall architecture diagram of a multi-task learning network in an embodiment of the present invention;
[0027] Figure 3 is a flow chart of another perception method based on a multi-task learning network in an embodiment of the present invention;
[0028] Figure 4 It is a structural diagram of a perception device based on a multi-task learning network in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In the field of autonomous driving, there is an urgent need for a perception method based on a multi-task learning network to achieve accurate perception of the vehicle's surrounding environment.
[0030] In the prior art, the current mainstream multi-task learning method adopts the structure of a shared feature network and multiple task head networks, and there is no adjustment network for each task head; in addition, the prior art generally manually sets fixed weight values for each task head network during training, and often adopts a supervised method to train the entire multi-task learning network, that is, during the training process, all rely on labeled sample data to train, adjust or optimize the multi-task learning network.
[0031] After research, the inventors of the present invention found that since the features extracted by the common feature network are not necessarily suitable for every task, the common features need to be domain-adapted to make them suitable for each individual task; in addition, the manually set weights are not necessarily optimal, and the fixed parameters are not conducive to network training, resulting in the trained multi-task learning network having insufficient accuracy in outputting the perception results in practical applications; furthermore, the prior art uses supervised learning methods and only uses labeled samples as training data, while labeling the samples requires a lot of manpower costs, and the generalization ability of the multi-task learning network trained entirely on labeled samples is insufficient.
[0032] In an embodiment of the present invention, a training sample set is first constructed, wherein the training sample set includes samples with determined recognition results and samples with undetermined recognition results; the samples with determined recognition results are input into the entire multi-task learning network, and the optimal feature network layer parameters and the multi-task learning network after initial training are determined through training; then the parameters of the feature network layer are fixed, and the samples with determined recognition results are input into the multi-task learning network after initial training, and the optimal adjustment network layer parameters and the retrained multi-task learning network are obtained through training; the parameters of the feature network layer and the adjustment network layer are fixed again, and the samples with determined recognition results and the samples after screening of the samples with undetermined recognition results are input into the retrained multi-task learning network, and the adjusted multi-task learning network is obtained through training; the image to be perceived is input into the adjusted multi-task learning network to obtain the perception result. Compared with the prior art, there is no adjustment network corresponding to each task head network one by one, and the weight values of each task head network are generally set manually when training the feature network, resulting in the insufficient accuracy of the perception results output by the trained multi-task learning network in practical applications; in addition, the adopted supervised method (the training samples only contain labeled samples) requires a lot of manpower cost to label the data during training, and the generalization ability of the trained multi-task learning network is insufficient. The embodiment of the present invention adds an adjustment network layer containing multiple adjustment networks between the feature network layer and the task head network layer, and also adopts a semi-supervised learning method (using multiple categories of samples including samples with determined recognition results and samples with undetermined recognition results as training samples) to fine-tune the entire network, which can effectively reduce the manpower cost of training, improve the generalization ability of the trained multi-task learning network, and improve the accuracy of the perception results output by the entire network.
[0033] In order to make the above-mentioned objects, features and beneficial effects of the present invention more obvious and understandable, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0034] Reference Figure 1 , Figure 11 is a flowchart of a perception method based on a multi-task learning network in an embodiment of the present invention. The method may include steps S11 to S15:
[0035] Step S11: constructing a training sample set, wherein the training sample set includes samples with determined recognition results and samples with undetermined recognition results;
[0036] Step S12: inputting the sample with the determined recognition result into the entire multi-task learning network, and determining the optimal feature network layer parameters and the multi-task learning network after initial training through training;
[0037] Step S13: fixing the parameters of the feature network layer to the preferred feature network layer parameters, inputting the samples with the determined recognition results into the multi-task learning network after initial training, and obtaining the preferred adjustment network layer parameters and the retrained multi-task learning network through training;
[0038] Step S14: fixing the parameters of the feature network layer to the preferred feature network layer parameters, and fixing the parameters of the adjustment network layer to the preferred adjustment network layer parameters, inputting the samples with determined recognition results and the screening samples obtained after screening the samples with undetermined recognition results into the retrained multi-task learning network, and obtaining an adjusted multi-task learning network through training;
[0039] Step S15: inputting the image to be perceived into the adjusted multi-task learning network to obtain a perception result.
[0040] The multi-task learning network includes a feature network layer, an adjustment network layer, and a task head network layer, wherein the adjustment network layer includes multiple adjustment networks, and the task head network layer includes multiple task head networks, and the multiple adjustment networks correspond one-to-one to the multiple task head networks.
[0041] In the specific implementation of step S11, the training sample set can be a multi-frame image data collected by the vehicle camera. Specifically, the training sample set contains multiple task data sets to be trained, and each task data set to be trained has a one-to-one correspondence with each task head network to be trained. The sample with the determined recognition result is a sample data set with a label, and the label can be used to indicate the recognition result that is manually annotated, such as manually annotating a certain object in the image as a certain type of garbage; the sample with the undetermined recognition result is a sample data set without a label.
[0042] Among them, the determined recognition result may refer to a recognition result that has been clearly marked, and the undetermined recognition result may refer to a recognition result that has not been clearly marked, for example, it may be a case where the recognition result is known but not marked, or it may be a case where the recognition result is unknown.
[0043] It should be noted that the training sample set can be enhanced by a data enhancement method, and the data enhancement method used can be adding random noise, image splicing, random scaling, etc. By performing data enhancement on the training sample set, the diversity of the training data can be increased, and then a more optimized multi-task learning network can be trained to achieve high-accuracy perception results in specific applications.
[0044] In the specific implementation of step S12, the sample with the determined recognition result is input into the entire multi-task learning network, and the preferred feature network layer parameters and the multi-task learning network after initial training are determined through training, including: setting the loss function of the multi-task learning network; inputting the sample with the determined recognition result into the entire multi-task learning network to perform initial training on the multi-task learning network until the loss function of the multi-task learning network converges, stopping the training and obtaining the preferred feature network layer parameters and the multi-task learning network after initial training.
[0045] Furthermore, the samples of the determined recognition results are input into the entire multi-task learning network, and the preferred feature network layer parameters and the multi-task learning network after initial training are determined through training, including: setting the loss function of the multi-task learning network; inputting the samples of the determined recognition results into the entire multi-task learning network to perform initial training on the multi-task learning network. During the initial training, each time the weight value of each task head network is updated, the parameters of the feature network layer are also updated until the loss function of the multi-task learning network converges, stopping the training and obtaining the preferred feature network layer parameters and the multi-task learning network after initial training.
[0046] Furthermore, the loss function of the multi-task learning network is:
[0047]
[0048] Among them, Loss represents the loss function value of the entire multi-task learning network. represents the weight value of the kth task head network, k represents the number of task head networks, L k Represents the loss function value of the k-th task head network.
[0049] Among them, σ is called mean square error in probability theory and statistics, which is used to indicate the degree of change of the variable. More specifically, it can be used to describe the degree of deviation of data from the mean, and is a measure of the degree of dispersion when measuring a random variable or a set of data. In the specific implementation of the embodiment of the present invention, It can represent the stability of the loss function corresponding to the k-th task head network. During the training process, adaptive adjustments will be made based on the training status of each task head network to reasonably allocate the weights of each task.
[0050] It should be pointed out that in the above-mentioned step of initially training the entire multi-task learning network, in addition to setting the loss function of the entire multi-task learning network, at least the loss function of each task head network needs to be set. During the training process, according to the loss function value of each task head network, the weight value of each task head network is dynamically adjusted, and the parameters of the feature network layer are continuously optimized until the loss function of the multi-task learning network converges and the training is stopped. At this time, the preferred feature network layer parameters and the multi-task learning network after initial training are obtained. In an embodiment of the present invention, by adopting a method of dynamically adjusting the weight value, the problem of inaccurate weight values of each task head network set manually in the prior art is improved, which can effectively improve the training effect of each task head network, and then improve the accuracy of the perception results output by the entire trained multi-task learning network in practical applications.
[0051] In a specific implementation, before the samples with determined recognition results are input into the multi-task learning network to train the feature network, it is necessary to first construct the multi-task learning network.
[0052] Reference Figure 2 , Figure 2 2 is an overall architecture diagram of a multi-task learning network in an embodiment of the present invention. The multi-task learning network may include: a feature network layer 21, an adjustment network layer 22 and a task head network layer 23.
[0053] Among them, the feature network layer 21 can be used to construct the first layer of the multi-task learning network, which includes a shared feature extraction network; the adjustment network layer 22 includes multiple adjustment networks, namely adjustment network 1, adjustment network 2,..., adjustment network n, and the adjustment network layer 22 can be used to construct the second layer of the multi-task learning network; the task head network layer 23 includes multiple task head networks, namely task head network 1, task head network 2,..., task head network n, and the task head network layer 23 can be used to construct the third layer of the multi-task learning network, wherein n is a positive integer.
[0054] Among them, the multiple adjustment networks and the multiple task head networks have a one-to-one correspondence; the feature network layer 21, the adjustment network layer 22, and the task head network layer 23 are connected in sequence.
[0055] The feature network layer 21 may correspond to a common feature extraction network used in a conventional multi-task learning method, and may be used to extract feature points in an image and output a feature data set. The embodiment of the present invention does not limit the specific implementation details of the feature network layer 21.
[0056] The adjustment network layer 22 can perform domain adaptation on the feature data set (or the extracted common features) output by the feature network layer 21 to make it suitable for each individual task.
[0057] The task head network layer 23 may correspond to multiple tasks in a multi-task learning network (each task may also be referred to as a task head). Taking the field of autonomous driving technology as an example, it may include various perception tasks that need to be completed in a driving environment, such as semantic segmentation, low obstacle recognition, garbage detection, traffic light detection, and the like.
[0058] As a non-limiting example, the multi-task learning network satisfies one or more of the following: the feature network structure in the feature network layer adopts the darknet structure in the single-step strategy algorithm (yolo); the structure of each adjustment network in the adjustment network layer adopts the bottleneck network bottleneck structure. Among them, the single-step strategy algorithm (yolo) can be the 5th version (yolov5) of the single-step strategy algorithm, which uses a single neural network to directly predict the object boundary and category probability, and quickly realizes end-to-end object detection in one step; the darknet structure (darknet) is a relatively lightweight learning framework that can analyze and process image data. Its main features are easy installation, flexible use, and very good portability. The bottleneck network structure is also a commonly used network layer structure in machine learning. It uses a 1*1 convolutional neural network. The reason why it is called a bottleneck layer is that it looks more like a bottleneck. This structure is generally used in networks with higher depths, which can reduce the number of parameters, thereby reducing the amount of calculation, and effectively and intuitively train data and extract features.
[0059] As a non-limiting example, the task head network layer may include one or more of the following: semantic segmentation head, low obstacle segmentation head, target detection head, garbage detection head, and traffic light detection head. The task head network layer may also include other types of task heads in the perception field, and the embodiment of the present invention does not limit the types of task heads in the task head network layer.
[0060] Among them, in some non-limiting embodiments, the semantic segmentation head can adopt a segmentation mask (SegMaskPSP) structure, the number of categories can be 65, including common foreground targets on the road, such as road signs, buildings, etc.; the low obstacle segmentation head can adopt a segmentation mask (SegMaskPSP) structure, the number of categories can be 3, respectively low obstacles, passable areas and impassable areas; the target detection head can adopt a full convolutional network (FCN) structure, including classification and regression networks, the number of categories can be 4, respectively, cars, pedestrians, bicycles and motorcycles; the garbage detection head can adopt a full convolutional network (FCN) structure, including classification and regression networks, the number of categories can be 15, including common types of garbage; the traffic light detection head can adopt a full convolutional network FCN structure, including classification and regression networks, the number of categories can be 1. The above-mentioned different task head networks can also adopt other network structures, and the present invention does not limit this.
[0061] In a specific implementation, the basic principle of the training process of the multi-task learning network is as follows:
[0062] First, initial training is performed: samples with determined recognition results (labeled samples) are input into the multi-task learning network for initial training, wherein the samples with determined recognition results contain multiple task data sets to be trained. During this training process, the parameters of the feature network layer (shared feature network) are mainly continuously optimized to obtain the optimal feature network layer parameters;
[0063] Then, retraining is performed: the parameters of the feature network layer are fixed as the preferred feature network layer parameters, and the samples with determined recognition results (labeled samples) are input into the entire multi-task learning network again. During this training process, the parameters of each adjustment network in the adjustment network layer are mainly continuously optimized to obtain the preferred adjustment network layer parameters;
[0064] Furthermore, fine-tune the network, that is, fine-tune the retrained multi-task learning network: fix the parameters of the feature network layer to the preferred feature network layer parameters, and fix the parameters of the adjustment network layer to the preferred adjustment network layer parameters, and input the samples with determined recognition results (labeled samples) and the screened samples (screened unlabeled samples) obtained after screening the samples with undetermined recognition results into the retrained multi-task learning network. During this training process, the parameters of each task head network in the task head network layer are mainly continuously optimized to obtain the preferred task head network layer parameters. At this point, the training process of the multi-task learning network is completed.
[0065] Continue to refer to Figure 1In the specific implementation of step S13, the parameters of the feature network layer are fixed as the preferred feature network layer parameters, the samples of the determined recognition results are input into the multi-task learning network after the initial training, and the preferred adjustment network layer parameters and the retrained multi-task learning network are obtained through training, including: setting the loss function of each adjustment network, and fixing the parameters of the feature network layer as the preferred feature network layer parameters; inputting the samples of the determined recognition results into the multi-task learning network after the initial training to retrain the multi-task learning network after the initial training until the loss functions of the various adjustment networks are all converged, stopping the training and obtaining the preferred adjustment network layer parameters and the retrained multi-task learning network.
[0066] Specifically, in the process of retraining the multi-task learning network after the initial training, since the parameters of the feature network layer are fixed, the retraining process mainly trains the parameters of each adjustment network in the adjustment network layer, wherein the loss functions of each adjustment network are independent of each other. During the training process, whenever the loss function of a certain adjustment network converges, the training of the adjustment network is stopped to obtain the preferred parameters of the adjustment network until the loss functions of each adjustment network in the adjustment network layer converge. At this time, the entire retraining process is stopped, and the preferred adjustment network layer parameters and the retrained multi-task learning network are obtained.
[0067] Specifically, an appropriate loss function can be selected as the loss function of the adjustment network, and the loss functions of the adjustment networks can be the same or different. It should be noted that the training of the adjustment networks in the above retraining process can be independent of each other, and the order of training can be the same.
[0068] In an embodiment of the present invention, an adjustment network layer including multiple adjustment networks is added between the feature network layer and the task head network layer, wherein the multiple adjustment networks correspond one-to-one to the multiple task head networks, and the common features extracted by the feature network layer can be domain-adapted so that the common features are adapted to each individual task, thereby improving the accuracy of the perception results.
[0069] In the specific implementation of step S14, the parameters of the feature network layer are fixed as the preferred feature network layer parameters, and the parameters of the adjustment network layer are fixed as the preferred adjustment network layer parameters, and the samples with determined recognition results and the screened samples obtained after screening the samples with undetermined recognition results are input into the retrained multi-task learning network, and the adjusted multi-task learning network obtained after training includes: setting the loss function of each task head network, and fixing the parameters of the feature network layer as the preferred feature network layer parameters, and fixing the parameters of the adjustment network layer as the preferred adjustment network layer parameters; inputting the samples with determined recognition results and the screened samples into the retrained multi-task learning network to train the retrained multi-task learning network until the loss functions of the task head networks are all converged, and stopping the training to obtain the adjusted multi-task learning network. Specifically, in the process of adjusting the retrained multi-task learning network, since the parameters of the feature network layer and the parameters of the adjustment network layer are fixed, the training process mainly trains the parameters of each task head network in the task head network layer, wherein the loss functions of each task head network are independent of each other. During the training process, whenever the loss function of a task head network converges, the training of the task head network is stopped to obtain the preferred parameters of the task head network until the loss functions of each task head network in the task head network layer converge. At this time, the entire network adjustment (training) process is stopped, and the preferred task head network layer parameters and the adjusted multi-task learning network are obtained.
[0070] In a specific implementation, an appropriate loss function can be selected as the loss function of the task head network, and the loss functions of the task head networks can be the same or different. It should be pointed out that the training of each task head network in the above training process can be independent of each other, and the order of training can be the same.
[0071] In an embodiment of the present invention, by adopting a semi-supervised learning method (using samples of various categories including samples with determined recognition results and samples with undetermined recognition results as training samples), fine-tuning the entire multi-task learning network can effectively improve the generalization ability of the model and improve the accuracy of the perception results output by the model in specific applications.
[0072] Furthermore, screening the samples with undetermined recognition results to obtain the screening samples includes: inputting the samples with undetermined recognition results into the retrained multi-task learning network, and outputting the perception results of each sample with undetermined recognition results and the confidence of each perception result; selecting samples with confidence greater than a preset confidence threshold as the screening samples.
[0073] Among them, confidence refers to the reliability of the perception results output by the multi-task learning network. It can be understood that the larger the value of the confidence, the greater the reliability of the perception results output when the sample with the uncertain recognition result is input into the multi-task learning network; the smaller the value of the confidence, the smaller the reliability of the perception results output when the sample with the uncertain recognition result is input into the multi-task learning network.
[0074] In the embodiment of the present invention, by using the retrained multi-task learning network to screen the samples with uncertain recognition results, and then using the screened samples as part of the training data to further adjust the entire multi-task learning network, the generalization ability of the multi-task learning network can be effectively improved. In addition, since the samples with uncertain recognition results do not need to be manually labeled, the labor cost of constructing the training sample set can be greatly reduced.
[0075] It should be noted that in the specific implementation of the above steps S12, S13, and S14, the parameters of the feature network layer, the parameters of the adjustment network layer, and the parameters of the task head network layer can all be conventional parameters used in the specific network structures used. For example: when the feature network adopts the darknet structure in the single-step strategy algorithm (yolo), the parameters of the feature network layer can be the parameters of the darknet structure itself; when the structure of each adjustment network in the adjustment network layer adopts the bottleneck network structure, the parameters of the adjustment network layer can be the parameters of the bottleneck network structure itself.
[0076] Specifically, the parameters of the feature network layer, the parameters of the adjustment network layer, and the parameters of the task head network layer can be continuously optimized during training; before training, the parameters of each network layer can be set to different initial parameter values according to the needs of different application scenarios. The embodiment of the present invention does not limit the setting of the initial parameter values in the specific network structure adopted.
[0077] In the specific implementation of step S15, the image to be perceived is input into the adjusted multi-task learning network to obtain a perception result.
[0078] In a specific embodiment of the present invention, the image to be sensed may be an image captured by a camera during the autonomous driving process, and the image to be sensed is input into the adjusted multi-task learning network, and the perception result obtained may be a recognition result of an object in the surrounding environment. The camera may be located in front of the cab, or may be located at other appropriate positions on the vehicle.
[0079] Reference Figure 3 , Figure 34 is a flowchart of another perception method based on a multi-task learning network in an embodiment of the present invention. The another perception method based on a multi-task learning network may include steps S31 to S35, and each step is described below.
[0080] In step S31, a training sample set is constructed, wherein the training sample set includes samples with determined recognition results and samples with undetermined recognition results.
[0081] In step S32, the loss function of the multi-task learning network is set, and then the samples with determined recognition results are input into the entire multi-task learning network for initial training until the loss function of the multi-task learning network converges, and the training is stopped to obtain the preferred feature network layer parameters and the multi-task learning network after initial training.
[0082] In step S33, the loss function of each adjustment network is set, and the parameters of the feature network layer are fixed to the preferred feature network layer parameters, and then the samples with determined recognition results are input into the multi-task learning network after initial training for retraining until the loss functions of each adjustment network are all converged, and the training is stopped to obtain the preferred adjustment network layer parameters and the retrained multi-task learning network.
[0083] In step S34, the loss function of each task head network is set, and the parameters of the feature network layer are fixed as the preferred feature network layer parameters, and the parameters of the adjustment network layer are fixed as the preferred adjustment network layer parameters. Then, the samples with determined recognition results and the screened samples are input into the retrained multi-task learning network for training until the loss functions of the various task head networks converge, and the training is stopped to obtain the adjusted multi-task learning network.
[0084] In step S35, the image to be perceived is input into the adjusted multi-task learning network to obtain a perception result.
[0085] In the specific implementation, for more details about steps S31 to S35, please refer to the above and Figure 1 , Figure 2 The steps described in the procedure are executed and will not be repeated here.
[0086] Reference Figure 4 , Figure 4 : is a schematic diagram of a structure of a perception device based on a multi-task learning network in an embodiment of the present invention. The perception device based on a multi-task learning network may include:
[0087] A training sample set construction module 41, used to construct the training sample set using samples with determined recognition results and samples with undetermined recognition results;
[0088] An initial training module 42 is used to input the samples with determined recognition results into the entire multi-task learning network, and determine the optimal feature network layer parameters and the multi-task learning network after initial training through training;
[0089] A retraining module 43, used for fixing the parameters of the feature network layer to the preferred feature network layer parameters, inputting the samples with the determined recognition results into the multi-task learning network after the initial training, and obtaining the preferred adjustment network layer parameters and the retrained multi-task learning network through training;
[0090] A network adjustment module 44 is used to fix the parameters of the feature network layer to the preferred feature network layer parameters, and to fix the parameters of the adjustment network layer to the preferred adjustment network layer parameters, and to input the samples with determined recognition results and the screening samples obtained by screening the samples with undetermined recognition results into the retrained multi-task learning network, so as to obtain an adjusted multi-task learning network through training;
[0091] The perception result determination module 45 is used to input the image to be perceived into the adjusted multi-task learning network to obtain the perception result.
[0092] For the principle, specific implementation and beneficial effects of the perception device based on the multi-task learning network, please refer to the previous article and Figures 1 to 3 The description of the perception method based on the multi-task learning network shown is not repeated here.
[0093] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned perception method based on a multi-task learning network are executed. The computer-readable storage medium may include a non-volatile memory or a non-transitory memory, and may also include an optical disk, a mechanical hard disk, a solid-state hard disk, etc.
[0094] Specifically, in the embodiment of the present invention, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (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 also be any conventional processor, etc.
[0095] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM) and direct rambus RAM (DR RAM).
[0096] The embodiment of the present invention further provides a terminal, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor executes the steps of the above-mentioned perception method based on the multi-task learning network when running the computer program. The terminal may include but is not limited to terminal devices such as mobile phones, computers, and tablet computers, and may also be a server, a cloud platform, etc.
[0097] The "plurality" appearing in the embodiments of the present application refers to two or more.
[0098] The first, second, etc. descriptions appearing in the embodiments of the present application are only used for illustration and distinction of the description objects. There is no order, nor do they indicate any special limitation on the number of devices in the embodiments of the present application, and cannot constitute any limitation on the embodiments of the present application.
[0099] It should be pointed out that the serial numbers of the steps in this embodiment do not limit the execution order of the steps.
[0100] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the scope defined by the claims.
Claims
1. A perception method based on a multi-task learning network, characterized in that: The multi-task learning network includes a feature network layer, an adjustment network layer, and a task head network layer, wherein the adjustment network layer includes multiple adjustment networks, the task head network layer includes multiple task head networks, the multiple adjustment networks correspond to the multiple task head networks one by one, and the multiple task head networks correspond to multiple perception tasks; The method comprises: Constructing a training sample set, wherein the training sample set includes samples with determined recognition results and samples with undetermined recognition results; Inputting the sample with determined recognition results into the entire multi-task learning network, and determining the optimal feature network layer parameters and the multi-task learning network after initial training through training; Fixing the parameters of the feature network layer to the preferred feature network layer parameters, inputting the samples with the determined recognition results into the multi-task learning network after initial training, and obtaining the preferred adjustment network layer parameters and the retrained multi-task learning network through training; Fixing the parameters of the feature network layer to the preferred feature network layer parameters, and fixing the parameters of the adjustment network layer to the preferred adjustment network layer parameters, inputting the samples with determined recognition results and the screening samples obtained by screening the samples with undetermined recognition results into the retrained multi-task learning network, and obtaining an adjusted multi-task learning network through training; Inputting the image to be sensed into the adjusted multi-task learning network to obtain a sensed result; The sample with the determined recognition result is input into the whole multi-task learning network, and the optimal feature network layer parameters are determined through training and the multi-task learning network after initial training includes: Setting a loss function of the multi-task learning network; The samples with determined recognition results are input into the entire multi-task learning network to perform initial training on the multi-task learning network until the loss function of the multi-task learning network converges, and the training is stopped to obtain the preferred feature network layer parameters and the multi-task learning network after initial training.
2. The method according to claim 1, characterized in that: During the initial training process, each time the weight value of each task head network is updated, the parameters of the feature network layer are also updated until the loss function of the multi-task learning network converges. The training is stopped and the preferred feature network layer parameters and the multi-task learning network after initial training are obtained.
3. The method according to claim 2, characterized in that The loss function of the multi-task learning network is: Among them, Loss represents the loss function value of the entire multi-task learning network, σ k -2 represents the weight value of the kth task head network, k represents the number of task head networks, L k Represents the loss function value of the k-th task head network.
4. The method according to claim 1, characterized in that: Fixing the parameters of the feature network layer as the preferred feature network layer parameters, inputting the samples with determined recognition results into the multi-task learning network after initial training, and obtaining the preferred adjustment network layer parameters and the retrained multi-task learning network after training includes: Setting the loss functions of each adjustment network, and fixing the parameters of the feature network layer to the preferred feature network layer parameters; The samples with determined recognition results are input into the initially trained multi-task learning network to retrain the initially trained multi-task learning network until the loss functions of the various adjustment networks are all converged, and the training is stopped to obtain the preferred adjustment network layer parameters and the retrained multi-task learning network.
5. The method according to claim 1, characterized in that The following method is used to screen the samples for which the recognition results are not determined to obtain the screened samples, including: Inputting the samples with undetermined recognition results into the retrained multi-task learning network, and outputting the perception results of each sample with undetermined recognition results and the confidence of each perception result; The samples whose confidence level is greater than a preset confidence threshold are selected as the screening samples.
6. The method according to claim 1, characterized in that The parameters of the feature network layer are fixed to the preferred feature network layer parameters, and the parameters of the adjustment network layer are fixed to the preferred adjustment network layer parameters, and the samples with determined recognition results and the screening samples obtained by screening the samples with undetermined recognition results are input into the retrained multi-task learning network, and the adjusted multi-task learning network obtained by training includes: Setting the loss function of each task head network, and respectively fixing the parameters of the feature network layer to the preferred feature network layer parameters, and fixing the parameters of the adjustment network layer to the preferred adjustment network layer parameters; The samples with determined recognition results and the screened samples are input into the retrained multi-task learning network to train the retrained multi-task learning network until the loss functions of the various task head networks converge, and the training is stopped to obtain the adjusted multi-task learning network.
7. The method according to claim 1, characterized in that The multi-task learning network satisfies one or more of the following: The feature network structure in the feature network layer adopts the darknet structure in the single-step strategy algorithm yolo; The structure of each adjustment network in the adjustment network layer adopts a bottleneck layer bottleneck network structure.
8. The method according to claim 1, characterized in that The task header network layer includes one or more of the following: Semantic segmentation head, low obstacle segmentation head, object detection head, garbage detection head, and traffic light detection head.
9. The method according to claim 8, characterized in that The task head network satisfies one or more of the following: The semantic segmentation head adopts a segmentation mask SegMaskPSP structure; The low obstacle segmentation head adopts a segmentation mask SegMaskPSP structure; The target detection head adopts a fully convolutional network FCN structure; The garbage detection head adopts a fully convolutional network FCN structure; The traffic light detection head adopts a fully convolutional network (FCN) structure.
10. A perception device based on a multi-task learning network, characterized in that: The multi-task learning network includes a feature network layer, an adjustment network layer, and a task head network layer, wherein the adjustment network layer includes multiple adjustment networks, the task head network layer includes multiple task head networks, the multiple adjustment networks correspond to the multiple task head networks one by one, and the multiple task head networks correspond to multiple perception tasks; The device comprises: A training sample set construction module, used to construct a training sample set, wherein the training sample set includes samples with determined recognition results and samples with undetermined recognition results; An initial training module, used to input the samples with determined recognition results into the entire multi-task learning network, and determine the optimal feature network layer parameters and the multi-task learning network after initial training through training; A retraining module, used for fixing the parameters of the feature network layer to the preferred feature network layer parameters, inputting the samples with the determined recognition results into the multi-task learning network after the initial training, and obtaining the preferred adjustment network layer parameters and the retrained multi-task learning network through training; A network adjustment module, used for fixing the parameters of the feature network layer to the preferred feature network layer parameters, and fixing the parameters of the adjustment network layer to the preferred adjustment network layer parameters, inputting the samples with determined recognition results and the screening samples obtained by screening the samples with undetermined recognition results into the retrained multi-task learning network, and obtaining an adjusted multi-task learning network through training; A perception result determination module, used for inputting the image to be perceived into the adjusted multi-task learning network to obtain a perception result; The initial training module further performs: Setting a loss function of the multi-task learning network; The samples with determined recognition results are input into the entire multi-task learning network to perform initial training on the multi-task learning network until the loss function of the multi-task learning network converges, and the training is stopped to obtain the preferred feature network layer parameters and the multi-task learning network after initial training.
11. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the perception method based on a multi-task learning network according to any one of claims 1 to 9 are performed.
12. A terminal comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor runs the computer program, the steps of the perception method based on the multi-task learning network according to any one of claims 1 to 9 are performed.
