Target detection network training method, device, electronic device and storage medium
By obtaining and processing the characteristics and labeling data of historical positive samples in the target detection network training, updating network parameters, and increasing the number of positive samples, the problem of poor balance between positive samples and negative samples is solved, and network performance is improved.
Patent Information
- Application Number
- CN202011242004.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-09
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2040-11-09
AI Technical Summary
The existing object detection network has poor balance between positive and negative samples during training, resulting in poor performance.
By obtaining incremental training data, including the characteristics and labeled data of historical positive samples, processing and updating network parameters, increasing the number of positive samples participating in training, to achieve better balance between positive samples and negative samples.
It effectively avoids the poor performance problems caused by poor balance between positive and negative samples, and improves the training effect of the target detection network.
Smart Images

Figure CN112508052B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of neural networks, and specifically to target detection network training methods, devices, electronic devices and storage media. Background Art
[0002] Positive and negative sample balance is a commonly used technical means when training the target detection network. The effect of positive and negative sample balance will directly affect the performance of the target detection network after training.
[0003] At present, the commonly used method is: the ratio of the number of positive samples to the number of negative samples is a priori ratio. For example, when training the target detection network RCNN, the ratio of the number of positive samples to the number of negative samples is 1:3, and the number of negative samples is 3 times the number of positive samples. In addition, the number of negative samples cannot be reduced indefinitely in order to balance the positive and negative samples, otherwise it will affect the target detection network to learn relevant features from the negative samples.
[0004] The essence of balancing positive and negative samples is to avoid excessive influence of negative samples on the learning process of the target detection network. Since the number of positive samples is still small compared to the number of negative samples in each training process of the target detection network, the corresponding features learned by the target detection network from positive samples are still small compared to negative samples, and the influence of negative samples on the learning process of the target detection network is still too large, and the effect of balancing positive and negative samples is not good. Summary of the invention
[0005] Embodiments of the present application provide a target detection network training method, device, electronic device and storage medium.
[0006] The present application provides a method for training a target detection network, including:
[0007] Acquire incremental training data corresponding to the current training process, where the incremental training data corresponding to the current training process includes: features corresponding to at least one historical positive sample and labeled data corresponding to at least one historical positive sample;
[0008] Processing features corresponding to historical positive samples in incremental training data corresponding to a current training process to obtain processed incremental training data corresponding to the current training process, wherein the processed incremental training data includes: processed features corresponding to at least one historical positive sample and labeled data corresponding to at least one historical positive sample;
[0009] Based on the training data of the current training process, the total network loss of the current training process is calculated, and based on the total network loss, the parameter values of the parameters of the target detection network are updated, wherein the training data of the current training process includes: the training data of each positive sample generated in the current training process, the processed incremental training data corresponding to the current training process, and the training data of each negative sample generated in the current training process.
[0010] The present application provides a target detection network training device, including:
[0011] An acquisition unit is configured to acquire incremental training data corresponding to a current training process, wherein the incremental training data corresponding to the current training process includes: features corresponding to at least one historical positive sample and annotation data corresponding to at least one historical positive sample;
[0012] A processing unit is configured to process features corresponding to historical positive samples in incremental training data corresponding to a current training process to obtain processed incremental training data corresponding to the current training process, wherein the processed incremental training data includes: processed features corresponding to at least one historical positive sample and labeled data corresponding to at least one historical positive sample;
[0013] The training unit is configured to calculate the total network loss of the current training process based on the training data of the current training process, and update the parameter values of the parameters of the target detection network based on the total network loss, wherein the training data of the current training process includes: the training data of each positive sample generated in the current training process, the processed incremental training data corresponding to the current training process, and the training data of each negative sample generated in the current training process.
[0014] The target detection network training method and device provided in the embodiments of the present application realize that in the current training process, not only the training data of the positive samples generated in the current training process, but also the features corresponding to the historical positive samples and the labeled data corresponding to the historical positive samples are involved in the training, which is equivalent to increasing the number of positive samples participating in the training in each training process. Thus, a better balance between positive and negative samples can be obtained, thereby avoiding the situation where the performance of the target detection network after training is poor due to the poor balance between positive and negative samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0016] Figure 1 A flow chart of a target detection network training method provided in an embodiment of the present application is shown;
[0017] Figure 2 A structural block diagram of a target detection network training device provided in an embodiment of the present application is shown;
[0018] Figure 3 A structural block diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0019] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0020] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0021] Figure 1 A flow chart of a target detection network training method provided in an embodiment of the present application is shown, and the method includes:
[0022] Step 101, obtaining incremental training data corresponding to the current training process.
[0023] In this application, the training process is a process of training the target detection network once. The current training process is a process of training the target detection network currently being performed.
[0024] Historical positive samples do not refer to a specific positive sample. Historical positive samples are relative to a certain training process. In a training process, before the start of the training process, all positive samples generated are equivalent to historical positive samples of the training process.
[0025] When training the target detection network, both positive samples and negative samples are anchor boxes generated by the target detection network. Which anchor boxes among all the anchor boxes generated by the target detection network are used as positive samples and which anchor boxes are used as negative samples can be determined based on the intersection-over-union (IOU) of the anchor box and the corresponding annotation box, i.e., IOU, the corresponding threshold, and the relevant IOU value range.
[0026] In the present application, any existing method of determining whether an anchor box is a positive sample or a negative sample may be used to determine each positive sample and each negative sample.
[0027] In the present application, the incremental training data corresponding to the current training process includes: features corresponding to at least one historical positive sample, and labeled data corresponding to at least one historical positive sample.
[0028] For example, for the current training process, at least one historical sample in the incremental training data corresponding to the current training process may be at least one historical positive sample among all positive samples generated in the previous training process of the current training process, used to train the target detection network in the current training process.
[0029] For each historical positive sample, the historical positive sample is an anchor box, which is determined to be a historical positive sample because its IOU with a label box is greater than the threshold used to determine the positive sample. The label box whose IOU with the historical positive sample is greater than the threshold used to determine the positive sample is the label box corresponding to the historical positive sample.
[0030] For each historical positive sample, the feature corresponding to the historical positive sample is a feature extracted from the area surrounded by the historical positive sample and used to predict the type of the object in the area surrounded by the historical positive sample.
[0031] For each historical positive sample, the annotation data corresponding to the historical positive sample includes: an annotation box corresponding to the historical positive sample, and an annotation type corresponding to the historical positive sample, that is, an annotation type of an object in the annotation box corresponding to the historical positive sample.
[0032] In some embodiments, the incremental training data corresponding to the current training process includes: training data of each historical training stage in a preset number of historical training stages before the current training stage to which the current training process belongs.
[0033] In the present application, when the entire training process of the target detection network consists of multiple training stages (iterations), the incremental training data corresponding to the current training process includes: the training data of each historical training stage in a preset number of historical training stages before the current training stage to which the current training process belongs.
[0034] The number of images involved in training is the same in each training stage. For example, the number of images involved in training in a training stage is two.
[0035] In a training phase, the target detection network is trained using one image each time, and after the training is completed, the training process is completed.
[0036] The training phase to which the current training process belongs may be referred to as the current training phase. The incremental training data corresponding to the current training process includes: training data of each historical training phase in a preset number of historical training phases before the current training phase to which the current training process belongs.
[0037] It should be understood that the historical training stage does not refer to a specific training stage. The historical training stage is relative to the current training stage. After the current training stage ends, the current training stage will also become a historical training stage.
[0038] The preset number of historical training stages before the current training stage is the preset number of historical training stages that have ended before the current training stage ends.
[0039] For example, the preset number is K, the current training stage is the Nth training stage, and the previous K historical training stages of the current training stage consist of the NKth to N-1th training stages.
[0040] For each of the historical training stages in the preset number of historical training stages before the current training stage to which the current training process belongs, the training data of the historical training stage includes: features corresponding to each historical positive sample generated in the historical training stage, and annotation data corresponding to each historical positive sample generated in the historical training stage.
[0041] In some embodiments, obtaining the incremental training data corresponding to the current training process includes: obtaining the incremental training data corresponding to the current training process from the positive sample training data storage area; and also includes: after the current training stage ends, deleting the training data of all historical positive samples generated in the target historical training stage in the positive sample training data storage area, and storing the training data of the positive samples generated in the current training stage in the positive sample training data storage area to update the training data stored in the positive sample training data storage area.
[0042] In the present application, the positive sample training data storage area is used to store positive sample training data generated by a preset number of training stages.
[0043] In the present application, each time after the current training stage ends, the training data stored in the positive sample training data storage area is updated. A historical training stage can be randomly selected from all historical training stages as the target historical training stage. Deleting the training data of all historical positive samples generated in the target historical training stage in the positive sample training data storage area, and storing the training data of all positive samples generated in the current training stage in the positive sample training data storage area, is equivalent to replacing the training data of all historical positive samples generated in the target historical training stage in the positive sample training data storage area with the training data of all positive samples generated in the current training stage.
[0044] In some embodiments, the target historical training phase is the historical training phase that is farthest in time from the current training phase.
[0045] In the present application, each time the current training phase ends, the training data stored in the positive sample training data storage area may be updated in a first-in-first-out manner.
[0046] Each time the current training phase ends, the training data stored in the positive sample training data storage area is updated, the training data of the historical training phase farthest from the current training phase in time in the positive sample training data storage area is deleted, and the training data of the positive samples generated in the current training phase is stored in the positive sample training data storage area. This is equivalent to replacing the training data of the historical training phase farthest from the current training phase in time in the positive sample training data storage area with the training data of the positive samples generated in the current training phase.
[0047] For example, the preset number is K, the current training stage is the Nth training stage, and the first K historical training stages of the current training stage are composed of the NKth to N-1th training stages. The training data of the historical training stage farthest from the current training stage in time in the positive sample training data storage area is the training data of the NKth training stage. After the Nth training stage is completed, the training data of all positive samples generated in the current training stage replaces the training data of all historical positive samples generated in the NKth training stage in the positive sample training data storage area.
[0048] In some embodiments, the positive sample training data storage area is a module in the target detection network for storing positive sample training data.
[0049] Step 102, processing the features corresponding to the historical positive samples in the incremental training data corresponding to the current training process to obtain the processed incremental training data corresponding to the current training process.
[0050] The processed incremental training data includes: processed features corresponding to at least one historical positive sample and labeled data corresponding to at least one historical positive sample.
[0051] For each historical positive sample, the annotation data corresponding to the historical positive sample includes: an annotation box corresponding to the historical positive sample and an annotation type corresponding to the historical positive sample. The annotation type corresponding to the historical positive sample may indicate the type of the object in the annotation box corresponding to the historical positive sample.
[0052] The features corresponding to the historical samples are extracted from the area surrounded by the historical samples during the historical training process before updating the parameter values of the parameters of the target detection network.
[0053] Features corresponding to the positive samples generated in the current training process are extracted from the area surrounded by the positive samples generated in the current training process before updating the parameter values of the parameters of the target detection network in the current training process.
[0054] In the historical training process, the parameter values of the parameters of the target detection network can be referred to as the historical parameter values of the parameters of the target detection network. In the current training process, the parameter values of the parameters of the target detection network can be referred to as the current parameter values of the parameters of the target detection network.
[0055] The features corresponding to the historical positive samples are the features of the historical positive samples in the historical training process. The features corresponding to the historical positive samples are processed, and the processed features corresponding to the historical positive samples obtained are the features of the historical positive samples in the current training process.
[0056] In the present application, processing the features corresponding to historical positive samples can make the distribution of the processed features corresponding to the historical positive samples, that is, the distribution of the features of the historical positive samples in the current training process, consistent with the distribution of the features corresponding to the positive samples generated in the current training process.
[0057] The correlation between the features of the historical positive samples in the historical training process and the features of the historical positive samples in the current training process can be determined in advance. According to the correlation, the features corresponding to the historical positive samples are processed.
[0058] As an example, the correlation between the features of historical positive samples in the historical training process and the features of historical positive samples in the current training process can be expressed using the Taylor formula.
[0059]
[0060] μ(θ t ) represents the features of the historical positive samples in the current training process, that is, the processed features corresponding to the historical positive samples, μ(θ p ) represents the characteristics of historical positive samples in the historical training process.
[0061] θt represents the current parameter value of the feature-related parameters in the target detection network during the current training process, and θp represents the historical parameter value of the feature-related parameters in the target detection network during the historical training process.
[0062] The part on the right side of the equal sign of the above formula exemplarily includes the first-order term after the Taylor formula is demonstrated, and the other order terms after the first-order term refer to the first-order term shown and the definitions of the other order terms after the first-order term in the Taylor formula.
[0063] The distribution of features corresponding to the samples is related to the parameter values of the parameters of the target detection network. The distribution of processed features corresponding to historical positive samples can be consistent with the distribution of features corresponding to the positive samples.
[0064] Step 103, based on the training data of the current training process, calculate the total network loss of the current training process, and based on the total network loss, update the parameter values of the parameters of the target detection network.
[0065] The training data of the current training process includes: the training data of the current training process includes: the training data of each positive sample generated in the current training process, the processed incremental training data corresponding to the current training process, and the training data of each negative sample generated in the current training process.
[0066] For each positive sample generated in the current training process, the training data of the positive sample generated in the current training process includes: the annotation box corresponding to the positive sample, and the annotation type corresponding to the positive sample. The annotation type corresponding to the positive sample indicates the type of object surrounded by the annotation box corresponding to the positive sample. When determining which anchor boxes among all anchor boxes generated by the target detection network are positive samples and which anchor boxes are negative samples, it can be determined based on the intersection-and-union ratio (IOU) of the anchor box and the corresponding annotation box, i.e., IOU, and the corresponding threshold and the corresponding intersection-and-union ratio value range. The positive sample can be determined as a positive sample because the IOU of the annotation box corresponding to the positive sample is greater than the threshold used to determine the positive sample.
[0067] For each negative sample generated in the current training process, the training data of the negative sample generated in the current training process includes: a label box corresponding to the negative sample and a label type corresponding to the negative sample. The label type corresponding to the negative sample indicates the type of object surrounded by the label box corresponding to the negative sample. When determining which anchor boxes among all anchor boxes generated by the target detection network are used as positive samples and which anchor boxes are used as negative samples, the negative sample can be determined as a negative sample because the IOU of the label box corresponding to the negative sample is less than the threshold used to determine the positive sample and the IOU of the negative sample and the label box corresponding to the negative sample is within the IOU interval associated with the negative sample.
[0068] In the present application, the loss function used for training the existing target detection network can be used to calculate the total network loss based on the training data of the current training process, and the parameter values of the parameters of the target detection network can be updated based on the total network loss.
[0069] In the present application, the training data of each positive sample generated in the current training process and the processed incremental training data corresponding to the current training process all participate in the training of the network. Therefore, the features corresponding to each positive sample generated in the current training process and the processed features corresponding to the historical positive samples all participate in the training of the network, and all will have an impact on the training of the target detection network and the update of the parameter values of the parameters of the target detection network. Not only the training data of the positive samples generated in the current training process, but also the features corresponding to the historical positive samples and the labeled data corresponding to the historical positive samples also participate in the training, which is equivalent to increasing the number of positive samples participating in the training, so that a better balance effect between positive and negative samples can be obtained, thereby avoiding the situation where the performance of the target detection network after training is poor due to the poor balance effect between positive and negative samples.
[0070] In some embodiments, calculating the total network loss of the current training process based on the training data of the current training process includes: calculating the total regression loss and the total type loss of the positive samples generated in the current training process based on the training data of each positive sample generated in the current training process; calculating the total regression loss and the total type loss of the negative samples generated in the current training process based on the training data of each negative sample generated in the current training process; calculating the total type loss of historical positive samples based on the processed incremental training data corresponding to the current training process; calculating the total regression loss of the current training process based on the total regression loss of the positive samples generated in the current training process and the total regression loss of the negative samples generated in the current training process; calculating the total type loss of the current training process based on the total type loss of historical positive samples, the total type loss of the positive samples generated in the current training process, and the total type loss of the negative samples generated in the current training process; calculating the total network loss of the current training process based on the total regression loss of the current training process and the total type loss of the current training process.
[0071] For each positive sample generated in the current training process, the training data of the positive sample includes: the positive sample and the labeled data corresponding to the positive sample.
[0072] For each positive sample generated in the current training process, the unit for predicting the type in the target detection network can make a prediction based on the features extracted from the area surrounded by the positive sample, i.e., the features corresponding to the positive sample, to obtain the predicted type corresponding to the positive sample. For each positive sample generated in the current training process, the annotation data corresponding to the positive sample includes: the annotation box corresponding to the positive sample, and the annotation type corresponding to the positive sample. The positive sample can be determined as a positive sample because the IOU with the annotation box corresponding to the positive sample is greater than the threshold used to determine the positive sample. The annotation type corresponding to the positive sample indicates the type of the object surrounded by the annotation box corresponding to the positive sample.
[0073] For each negative sample generated in the current training process, the training data of the negative sample includes: the negative sample and the labeled data corresponding to the negative sample.
[0074] For each negative sample generated in the current training process, the unit for predicting the type in the target detection network can make a prediction based on the features extracted from the area surrounded by the negative sample, that is, the features corresponding to the negative sample, to obtain the predicted type corresponding to the negative sample.
[0075] For each negative sample generated in the current training process, the annotation data corresponding to the negative sample includes: the annotation box corresponding to the negative sample, and the annotation type corresponding to the negative sample. The negative sample is determined to be a negative sample because the IOU of the annotation box corresponding to the negative sample is less than the threshold used to determine the positive sample and the IOU of the negative sample and the annotation box corresponding to the negative sample is within the IOU interval related to the negative sample. The annotation type corresponding to the negative sample indicates the type of the object surrounded by the annotation box corresponding to the negative sample.
[0076] In the present application, the regression loss of the positive samples generated in the current training process can be calculated based on each positive sample generated in the current training process and the annotation box corresponding to each positive sample. For example, the sum of the regression losses corresponding to all positive samples generated in the current training process can be used as the total regression loss of the positive samples generated in the current training process. The regression loss corresponding to the positive sample generated in the current training process is the regression loss of the positive sample generated in the current training process and the annotation box corresponding to the positive sample.
[0077] According to each negative sample generated in the current training process and each labeled box corresponding to the negative sample, the regression loss of the negative sample generated in the current training process is calculated. For example, the sum of the regression losses corresponding to all negative samples generated in the current training process can be used as the total regression loss of the negative samples generated in the current training process. The regression loss corresponding to the negative sample generated in the current training process is the regression loss of the negative sample generated in the current training process and the labeled box corresponding to the negative sample.
[0078] Then, the total regression loss of the current training process can be calculated according to the regression loss of the positive samples generated in the current training process and the regression loss of the negative samples generated in the current training process. For example, the sum or weighted sum of the total regression loss of the positive samples generated in the current training process and the total regression loss of the negative samples generated in the current training process can be used as the total regression loss of the current training process.
[0079] In the present application, for each processed feature corresponding to a historical positive sample in the processed incremental training data, the target detection network can make a prediction based on the processed feature corresponding to the historical positive sample to obtain a prediction type corresponding to the historical positive sample.
[0080] The total type loss of the historical positive samples can be calculated based on the predicted type corresponding to each historical positive sample and the labeled type in the labeled data corresponding to each historical positive sample in the processed incremental training data. For example, the sum of the type losses corresponding to all historical positive samples can be used as the total type loss of the historical positive samples. The type loss corresponding to the historical positive samples is the type loss of the predicted type corresponding to the historical positive samples and the labeled type in the labeled data corresponding to the historical positive samples.
[0081] The total type loss of the positive samples generated in the current training process can be calculated according to the predicted type corresponding to each positive sample generated in the current training process and the labeled type corresponding to each positive sample. For example, the sum of the type losses corresponding to all positive samples generated in the current training process can be used as the total type loss of the positive samples generated in the current training process. The type loss corresponding to the positive samples generated in the current training process is the loss of the predicted type corresponding to the positive samples generated in the current training process and the labeled type corresponding to the positive samples generated in the current training process.
[0082] The total type loss of negative samples generated in the current training process can be calculated according to the prediction type corresponding to each negative sample generated in the current training process and the label type corresponding to each negative sample. For example, the sum of the type losses corresponding to all negative samples generated in the current training process can be used as the total type loss of negative samples generated in the current training process. The type loss corresponding to the negative samples generated in the current training process is the loss of the prediction type corresponding to the negative samples generated in the current training process and the label type corresponding to the negative samples generated in the current training process.
[0083] The total type loss of the current training process may be calculated based on the total type loss of historical positive samples, the total type loss of positive samples generated in the current training process, and the total type loss of negative samples generated in the current training process. For example, the total type loss of historical positive samples, the total type loss of positive samples generated in the current training process, and the total type loss of negative samples generated in the current training process may be taken as the total type loss of the current training process.
[0084] The total network loss of the current training process can be calculated according to the total regression loss of the current training process and the total type loss of the current training process. For example, the sum or weighted sum of the total regression loss of the current training process and the total type loss of the current training process can be used as the total network loss of the current training process. Then, the parameter values of the parameters of the target detection network can be updated based on the total network loss of the current training process.
[0085] Please refer to Figure 2 , which shows a structural block diagram of a target detection network training device provided in an embodiment of the present application. The target detection network training device includes: an acquisition unit 201, a processing unit 202, and a training unit 203.
[0086] The acquisition unit 201 is configured to acquire incremental training data corresponding to the current training process, where the incremental training data corresponding to the current training process includes: features corresponding to at least one historical positive sample, and annotation data corresponding to at least one historical positive sample;
[0087] The processing unit 202 is configured to process features corresponding to historical positive samples in the incremental training data corresponding to the current training process to obtain processed incremental training data corresponding to the current training process, wherein the processed incremental training data includes: processed features corresponding to at least one historical positive sample and labeled data corresponding to at least one historical positive sample;
[0088] The training unit 203 is configured to calculate the total network loss of the current training process based on the training data of the current training process, and update the parameter values of the parameters of the target detection network based on the total network loss, wherein the training data of the current training process includes: the training data of each positive sample generated in the current training process, the processed incremental training data corresponding to the current training process, and the training data of each negative sample generated in the current training process.
[0089] In some embodiments, the incremental training data corresponding to the current training process includes: the training data of each historical training stage in a preset number of historical training stages before the current training stage to which the current training process belongs, wherein, for each of the historical training stages, the training data of the historical training stage includes: features corresponding to each historical positive sample generated in the historical training stage, and annotation data corresponding to each historical positive sample.
[0090] In some embodiments, the acquisition unit is further configured to acquire the incremental training data corresponding to the current training process, including: acquiring the incremental training data corresponding to the current training process from the positive sample training data storage area; the device also includes: an updating unit, which is configured to delete the training data of all historical positive samples generated in the target historical training stage in the positive sample training data storage area after the current training stage ends, so as to update the training data stored in the positive sample training data storage area, and store the training data of the positive samples generated in the current training stage in the positive sample training data storage area, so as to update the training data stored in the positive sample training data storage area.
[0091] In some embodiments, the target historical training phase is the historical training phase that is farthest in time from the current training phase.
[0092] In some embodiments, the positive sample training data storage area is a module in the target detection network for storing positive sample training data.
[0093] In some embodiments, the training unit 203 is further configured to calculate the total regression loss and the total type loss of the positive samples generated in the current training process based on the training data of each positive sample generated in the current training process; calculate the total regression loss and the total type loss of the negative samples generated in the current training process based on the training data of each negative sample generated in the current training process; calculate the total type loss of historical positive samples based on the processed incremental training data corresponding to the current training process; calculate the total regression loss of the current training process based on the total regression loss of the positive samples generated in the current training process and the total regression loss of the negative samples generated in the current training process; calculate the total type loss of the current training process based on the total type loss of historical positive samples, the total type loss of the positive samples generated in the current training process, and the total type loss of the negative samples generated in the current training process; calculate the total network loss of the current training process based on the total regression loss of the current training process and the total type loss of the current training process.
[0094] Figure 3is a structural block diagram of an electronic device provided by this embodiment. The electronic device includes a processing component 222, which further includes one or more processors, and a memory resource represented by a memory 332, which is used to store instructions that can be executed by the processing component 322, such as an application. The application stored in the memory 332 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 322 is configured to execute instructions to perform the above method.
[0095] The electronic device may also include a power supply component 326 configured to perform power management of the electronic device, a wired or wireless network interface 350 configured to connect the electronic device to a network, and an input / output (I / O) interface 358. The electronic device may operate based on an operating system stored in the memory 332, such as Windows Server™, MacOS X™, Unix™, Linux™, FreeBSD™ or the like.
[0096] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory including instructions, and the instructions can be executed by an electronic device to complete the above method. Optionally, the storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0097] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0098] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A target detection network training method, It is characterized in that The method comprises: Acquire incremental training data corresponding to the current training process, where the incremental training data corresponding to the current training process includes: features corresponding to at least one historical positive sample and labeled data corresponding to at least one historical positive sample; Processing features corresponding to historical positive samples in incremental training data corresponding to a current training process to obtain processed incremental training data corresponding to the current training process, wherein the processed incremental training data includes: processed features corresponding to at least one historical positive sample and labeled data corresponding to at least one historical positive sample; Based on the training data of the current training process, the total network loss of the current training process is calculated, and based on the total network loss, the parameter values of the parameters of the target detection network are updated, wherein the training data of the current training process includes: the training data of each positive sample generated in the current training process, the processed incremental training data corresponding to the current training process, and the training data of each negative sample generated in the current training process; The calculating of the total network loss of the current training process based on the training data of the current training process includes: Based on the training data of each positive sample generated in the current training process, calculate the total regression loss and total type loss of the positive samples generated in the current training process; Based on the training data of each negative sample generated in the current training process, calculate the total regression loss and total type loss of the negative samples generated in the current training process; Based on the processed incremental training data corresponding to the current training process, calculate the total type loss of historical positive samples; Calculate the total regression loss of the current training process based on the total regression loss of the positive samples generated in the current training process and the total regression loss of the negative samples generated in the current training process; Calculate the total type loss of the current training process based on the total type loss of the historical positive samples, the total type loss of the positive samples generated in the current training process, and the total type loss of the negative samples generated in the current training process; Based on the total regression loss of the current training process and the total type loss of the current training process, the total network loss of the current training process is calculated.
2. The method according to claim 1, It is characterized in that The incremental training data corresponding to the current training process includes: the training data of each historical training stage in a preset number of historical training stages before the current training stage to which the current training process belongs, wherein, for each of the historical training stages, the training data of the historical training stage includes: the features corresponding to each historical positive sample generated in the historical training stage, and the annotation data corresponding to each historical positive sample.
3. The method according to claim 2, It is characterized in that Acquiring the incremental training data corresponding to the current training process includes: acquiring the incremental training data corresponding to the current training process from a positive sample training data storage area; and the method further includes: After the current training stage is finished, the training data of historical positive samples generated in the target historical training stage in the positive sample training data storage area is deleted, and the training data of positive samples generated in the current training stage is stored in the positive sample training data storage area to update the training data stored in the positive sample training data storage area.
4. The method according to claim 3, It is characterized in that The target historical training stage is the historical training stage that is farthest from the current training stage in time.
5. The method according to any one of claims 3 to 4, It is characterized in that The positive sample training data storage area is a module in the target detection network for storing positive sample training data.
6. A target detection network training device, It is characterized in that The device comprises: An acquisition unit is configured to acquire incremental training data corresponding to a current training process, wherein the incremental training data corresponding to the current training process includes: features corresponding to at least one historical positive sample and annotation data corresponding to at least one historical positive sample; A processing unit is configured to process features corresponding to historical positive samples in incremental training data corresponding to a current training process to obtain processed incremental training data corresponding to the current training process, wherein the processed incremental training data includes: processed features corresponding to at least one historical positive sample and labeled data corresponding to at least one historical positive sample; A training unit is configured to calculate a total network loss of the current training process based on training data of the current training process, and update parameter values of parameters of the target detection network based on the total network loss, wherein the training data of the current training process includes: training data of each positive sample generated in the current training process, processed incremental training data corresponding to the current training process, and training data of each negative sample generated in the current training process; The training unit is specifically configured as follows: Based on the training data of each positive sample generated in the current training process, calculate the total regression loss and total type loss of the positive samples generated in the current training process; Based on the training data of each negative sample generated in the current training process, calculate the total regression loss and total type loss of the negative samples generated in the current training process; Based on the processed incremental training data corresponding to the current training process, calculate the total type loss of historical positive samples; Calculate the total regression loss of the current training process based on the total regression loss of the positive samples generated in the current training process and the total regression loss of the negative samples generated in the current training process; Calculate the total type loss of the current training process based on the total type loss of the historical positive samples, the total type loss of the positive samples generated in the current training process, and the total type loss of the negative samples generated in the current training process; Based on the total regression loss of the current training process and the total type loss of the current training process, the total network loss of the current training process is calculated.
7. The device according to claim 6, It is characterized in that The incremental training data corresponding to the current training process includes: the training data of each historical training stage in a preset number of historical training stages before the current training stage to which the current training process belongs, wherein, for each of the historical training stages, the training data of the historical training stage includes: the features corresponding to each historical positive sample generated in the historical training stage, and the annotation data corresponding to each historical positive sample.
8. An electronic device, include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method as claimed in any one of claims 1 to 5. 9 . A storage medium, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in claim 1 .
Citation Information
Patent Citations
Unbalanced sample data classification method and system
CN107563453A
Ship object recognition method based on multilayer convolution neural network
CN107609601A
Self-adaptive electricity-stealing-preventing monitoring method and system based on electricity consumption information acquisition system
CN108198408A
Aircraft target detection method and system, electronic device and storage medium
CN108764082A
A small-scale pedestrian detection and recognition method based on a cascade convolutional network
CN109919045A
