Multi-dataset target detection training method, system, storage medium and electronic device
By using two detection models to clean and merge the historical data sets, the high cost problem caused by the unlabeled detection categories in the historical data is solved, efficient model training and deployment is achieved, and the model's detection effect on historical categories is improved.
Patent Information
- Application Number
- CN202210163241.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-22
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-02-22
AI Technical Summary
When the existing technology adds new detection categories to historical data without labeling, the model has poor detection effects on historical categories, increasing the cost of model maintenance, machine deployment and manpower labeling.
Two detection models are used to clean the historical data sets, and pseudo-notation is performed using semi-supervised methods. Combined with data augmentation technology, accurate annotation files are generated, and multiple data sets are merged into the third detection model for training, reducing the consumption of manpower and machine resources.
Without increasing costs, the model's detection effect on historical categories is improved, the cost of manpower labeling and machine deployment is reduced, and the model's detection efficiency and speed is improved.
Smart Images

Figure CN114743063B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of target detection technology, and in particular to a multi-dataset target detection training method, system, storage medium and electronic equipment. Background Art
[0002] With the development of artificial intelligence (AI), computer vision is increasingly being used in our daily lives. Object detection, as one of the most important tasks in computer vision, holds a significant impact. However, common object detection methods limit the number of detected categories by default. However, in practice, it is often impossible to determine whether new categories have been added. When new categories are added, historical data may not be labeled for these new categories. If the model is directly trained on datasets containing these new categories, the large number of unlabeled categories in the historical dataset will result in poor detection performance for these historical categories.
[0003] To address the above issues, existing solutions mainly include the following two methods: 1. Training different object detectors for multiple datasets and deploying them, but this increases the cost of maintaining multiple models and wastes machine resources; 2. Directly annotating new categories in historical data and adding new categories to be detected to all existing data, but this method requires a lot of time and manpower.
[0004] Therefore, when the two existing methods solve the problem that the model has poor detection effect on historical categories due to the lack of labeling of new detection categories in historical data, they will increase additional model maintenance costs, machine deployment costs or human labeling costs, resulting in higher costs. Summary of the Invention
[0005] The main purpose of the present invention is to provide a multi-dataset target detection training method and system, which uses two detection models to clean the new categories in the historical data set, and merges multiple data sets into a third detection model for training, so as to solve the problem of high cost caused by the existing technology when new detection categories in historical data are not labeled.
[0006] To achieve the above objectives, a first aspect of the present invention provides a multi-dataset target detection training method, comprising:
[0007] Input the newly added category data set and the corresponding first annotation file into the first detection model and the second detection model respectively to perform detection model training;
[0008] Use the trained first detection model and the second detection model to clean the newly added categories in the historical data set to obtain the cleaned historical data set and the corresponding second annotation file;
[0009] The newly added category data set and the historical data set after data cleaning are merged, and the merged data set and the corresponding third annotation file are input into the third detection model for model training, and deployed after the training is completed.
[0010] Optionally, the step of inputting the newly added category dataset and the corresponding first annotation file into the first detection model and the second detection model respectively to perform detection model training includes:
[0011] Inputting the newly added category dataset and the corresponding first annotation file into the first detection model according to the first input resolution of the image;
[0012] Inputting the newly added category dataset and the corresponding first annotation file into the second detection model according to the second input resolution of the image;
[0013] After inputting into the first detection model and the second detection model respectively, the detection model training of the newly added category is performed.
[0014] Optionally, the semi-supervised method is used to clean the newly added categories in the historical data set using the trained first detection model and the second detection model, including:
[0015] Using a semi-supervised approach, the trained first and second detection models are used to pseudo-label the newly added categories in the historical dataset and output target detection boxes.
[0016] For the target detected by both the first detection model and the second detection model, the IOU and the confidence score are calculated according to the target detection frame, and the relationship between the IOU and the confidence score and the preset threshold is determined respectively.
[0017] Furthermore, the determining of the relationship between the IOU and the confidence score and a preset threshold value includes:
[0018] If the IOU is greater than the first threshold, and the confidence scores of the first detection model and the second detection model are both greater than the second threshold, the target is retained, and the location information and category information of the target are recorded in the second annotation file corresponding to the historical data set;
[0019] Otherwise, perform first data augmentation on the target with less historical category data in the historical data set, fill it into the position of the target detection frame, and record the position information and category information of the target with less data into the second annotation file corresponding to the historical data set;
[0020] The first data enhancement includes any one or more of random scaling, random flipping, random contrast transformation, random noise and mixup.
[0021] Furthermore, retaining the target and recording the location information and category information of the target into a second annotation file corresponding to the historical data set includes:
[0022] Determining whether the confidence scores of the first detection model and the second detection model are equal;
[0023] If they are not equal, the location information and category information of the target detection box corresponding to the larger confidence score are recorded in the second annotation file corresponding to the historical dataset;
[0024] If they are equal, the position information and category information of the target detection box of one of the detection models are randomly selected and recorded in the second annotation file corresponding to the historical dataset.
[0025] Furthermore, a third annotation file corresponding to the merged dataset is obtained based on the first annotation file corresponding to the newly added category dataset and the second annotation file corresponding to the historical dataset;
[0026] The step of inputting the merged data set and the corresponding third annotation file into the third detection model to perform model training, and deploying the model after the training is completed, includes:
[0027] Performing second data enhancement on the merged dataset and the corresponding third annotated file, inputting the data into a third detection model according to a third input resolution of the image, and performing model training;
[0028] The second data enhancement includes any one or more of color change, mixup, mosaic, and random flip.
[0029] Furthermore, after the training is completed, the deployment includes:
[0030] Convert the trained third detection model to TensorRT and use fp16 quantization acceleration to improve the model running speed;
[0031] Use Docker deployment.
[0032] A second aspect of the present invention provides a multi-dataset object detection training system, comprising:
[0033] A detection model training unit, configured to input the newly added category data set and the corresponding first annotation file into the first detection model and the second detection model respectively, to perform detection model training;
[0034] A data cleaning unit is used to use the trained first detection model and the second detection model to perform data cleaning on the newly added categories in the historical data set in a semi-supervised manner, thereby obtaining a cleaned historical data set and a corresponding second annotation file;
[0035] The data set merging unit is used to merge the newly added category data set and the historical data set after data cleaning, and input the merged data set and the corresponding third annotation file into the third detection model for model training, and deploy after the training is completed.
[0036] A third aspect of the present invention provides a computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the multi-dataset target detection training method provided in any one of the first aspects.
[0037] The fourth aspect of the present invention provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the multi-dataset target detection training method provided in any one of the first aspects.
[0038] In the multi-dataset target detection training method and system provided in the embodiments of the present invention, the trained first detection model and the second detection model are used to clean the newly added categories in the historical data set, without the need for manual intervention in the cleaning, thereby reducing the labor labeling cost. In addition, the multiple data sets are merged into the third detection model for model training and deployment, without the need to train multiple different target detectors for deployment, thereby reducing the model maintenance cost and the machine deployment cost, achieving the technical effect of improving the model's detection effect on historical categories when the newly added detection categories in the historical data are not labeled, thereby solving the problem of high costs incurred by the existing technology when the newly added detection categories in the historical data are not labeled. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 A flowchart of a multi-dataset target detection training method according to an embodiment of the present invention is provided;
[0041] Figure 2 A data cleaning flow chart for newly added categories of historical data provided by one embodiment of the present invention;
[0042] Figure 3 A schematic diagram of a confidence score for detecting a newly added category provided by an embodiment of the present invention;
[0043] Figure 4 A schematic diagram of filling an image after data augmentation using historical categories with less data, provided by an embodiment of the present invention;
[0044] Figure 5 A block diagram of a multi-dataset target detection training system provided by one embodiment of the present invention;
[0045] Figure 6 A block diagram of an electronic device provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0047] It should be noted that the terms "first," "second," and the like in the specification and claims of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate for the embodiments of the present invention described herein. In addition, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatuses.
[0048] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0049] General target detection limits the specific number of categories to be detected by default. However, in actual needs, it is impossible to determine whether new categories have been added. When new detection categories are added, historical data does not have labels for the newly added categories to be detected. If the newly added category dataset is directly merged for model training, the presence of a large number of unlabeled new categories in the historical dataset will cause the model to have poor detection performance for historical categories. Existing solutions to solve the problem of poor detection performance of historical categories due to the lack of labels for new detection categories in historical data will increase additional model maintenance costs, machine deployment costs, or human labeling costs, resulting in high costs.
[0050] In order to solve the above problems, the embodiment of the present invention provides a multi-dataset target detection training method, such as Figure 1 As shown, the method includes the following steps S101 to S103:
[0051] Step S101: inputting the newly added category dataset and the corresponding first annotation file into the first detection model and the second detection model respectively to perform detection model training;
[0052] For the newly added category data set, based on the provided newly added category data set and the first annotation file, two relatively large detection models, namely the first detection model and the second detection model, are first trained using a relatively large network structure or different detection algorithms; by training the two detection models, a balance can be achieved between the accuracy of subsequent annotation and the cost of training data consumption, thereby improving the annotation accuracy while avoiding excessive training time and cost.
[0053] Among them, the first annotation file corresponding to the newly added category data set contains the newly added category annotations and historically known category annotations, and the first detection model and the second detection model include any two of YOLOX-L, yolov5l6, Focal-L and Swin TransformerV2; in an embodiment of the present invention, the technical solution of the present invention is explained by taking the first detection model using yolov5l6 and the second detection model using Swin Transformer V2 as an example.
[0054] Specifically, step S101 includes:
[0055] Inputting the newly added category dataset and the corresponding first annotation file into the first detection model according to the first input resolution of the image;
[0056] Inputting the newly added category dataset and the corresponding first annotation file into the second detection model according to the second input resolution of the image;
[0057] After inputting into the first detection model and the second detection model respectively, the detection model training of the newly added category is performed.
[0058] Among them, the input resolution of the image is determined according to the type of detection model, the first input resolution of the image is determined according to the first detection model, and the second input resolution of the image is determined according to the second detection model; when the first detection model adopts yolov5l6, the corresponding first input resolution of the image is 1280*1280, when the second detection model adopts SwinTransformer V2, the corresponding second input resolution of the image is 1536*1536. The prepared new category dataset and the first annotation file are input into the two networks for detection model training.
[0059] For example, suppose there is a historical object detection dataset containing the bicycle category, and a detection model has been trained. Now, the business needs to add a pedestrian category. The newly added category dataset contains both pedestrian category annotations and historically known bicycle category annotations. In other words, the historical target category includes bicycles, and the newly added target category is pedestrians.
[0060] Pedestrian detection model training is performed. For the newly added pedestrian data and the corresponding annotation files, the first detection model yolov5l6 and the second detection model Swin Transformer V2 are fine-tuned respectively. Among them, the input resolution of yolov5l6 is 1280*1280, and the input resolution of Swin Transformer V2 is 1536*1536. After training, the models are named detectmodel_YL5L and detectmodel_STV2 respectively.
[0061] Step S102: Using a semi-supervised approach, the first detection model and the second detection model after training are used to perform data cleaning on the newly added categories in the historical data set to obtain the historical data set after data cleaning and the corresponding second annotation file; wherein, the second annotation file corresponding to the historical data set after data cleaning contains historically known category annotations and newly added category annotations.
[0062] The embodiment of the present invention adopts a semi-supervised approach and uses two detection models to clean new categories in historical data. This eliminates the need for manual intervention and time-consuming cleaning, reduces labor costs, and saves time.
[0063] Specifically, the semi-supervised method in step S102 is used to clean the newly added categories in the historical data set using the trained first detection model and the second detection model, including:
[0064] A semi-supervised approach is adopted, and the first detection model and the second detection model after training are used to pseudo-label the new categories in the historical data set, predict the historical data set, and output the target detection box; the two detection models are used to more effectively mine the new categories in the historical data set, reducing the cost of manual labeling.
[0065] For targets detected by both the first detection model and the second detection model, the IOU (Intersection over Union) and the confidence score are calculated based on the target detection frame, and the relationship between the IOU and the confidence score and the preset threshold is determined respectively.
[0066] The determining of the relationship between the IOU and the confidence score and a preset threshold value includes:
[0067] If the IOU is greater than the first threshold, and the confidence scores of the first detection model and the second detection model are both greater than the second threshold, the target is retained, and the location information and category information of the target are recorded in the second annotation file corresponding to the historical data set; the values of the first threshold and the second threshold are determined according to the first detection model and the second detection model used. For example, when the two detection models use yolov5l6 and Swin Transformer V2 respectively, the corresponding first threshold is 0.5, and the second threshold is 0.8; when the two detection models use Focal-L and YOLOX-L respectively, the corresponding first threshold is 0.55, and the second threshold is 0.75; in an embodiment of the present invention, the first detection model uses yolov5l6 and the second detection model uses Swin Transformer V2, and the corresponding first threshold can be 0.5, and the second threshold can be 0.8; for targets detected by both models, if the IOU is greater than 0.5, and the confidence scores of yolov5l6 and Swin Transformer V2 are both greater than 0.8, the target is retained;
[0068] Otherwise, the first data enhancement is performed on the target with less historical category data in the historical data set, and the target detection frame position is filled in, and the position information and category information of the target with less data is recorded in the second annotation file corresponding to the historical data set; after detecting the position of the target detection frame, the target with less historical category data in the historical data set is used to perform a certain amount of data enhancement and then fill this position, and the target detection frame of the newly added category is covered with the target with less historical category data, and the annotation information of this target with less historical category data is recorded in the second annotation file.
[0069] For new categories with low detection scores by the first and second detection models, due to their low confidence scores, historical categories with less data are directly used to perform relevant transformations and fill in the images. Historical categories with small samples are used to cover the new categories with low confidence scores, which increases the coverage of small samples and improves the detection of small samples.
[0070] The first data enhancement includes any one or more of random scaling, random flipping, random contrast transformation, random noise and mixup.
[0071] Furthermore, retaining the target and recording the location information and category information of the target into a second annotation file corresponding to the historical data set includes:
[0072] Determining whether the confidence scores of the first detection model and the second detection model are equal;
[0073] If they are not equal, the location information and category information of the target detection box corresponding to the larger confidence score will be recorded in the second annotation file corresponding to the historical dataset; the location information of the bbox (bounding box) with the higher score in the two models will be recorded in the corresponding second annotation file, where bbox is the target detection box, which is a rectangle marking the target on the image;
[0074] If they are equal, the position information and category information of the target detection box of one of the detection models are randomly taken and recorded in the second annotation file corresponding to the historical dataset. If the confidence scores of the two models are equal, the position information and category information of the bbox of one of the models are randomly taken and recorded in the second annotation file.
[0075] For example, the trained detection models detectmodel_YL5L and detectmodel_STV2 are used to add annotations to the new categories in the historical dataset. The flowchart is as follows: Figure 2 As shown, in Figure 2 In the example, for the pictures included in the historical dataset, the pictures are input into the trained pedestrian detection models, including the yolov5l6 pedestrian detection model and the detectmodel_STV2 pedestrian detection model; then it is determined whether the IOU is greater than 0.5 and the scores are greater than 0.8. If so, the pedestrian category and coordinate position detected by the model are saved to an XML file. If not, this area is filled with pictures with fewer categories and the location and category information are recorded. Specifically:
[0076] If the IOU of the two models is greater than 0.5 when detectmodel_YL5L and detectmodel_STV2 predict the historical data set, and the confidence scores of the detected pedestrians are both greater than 0.8, the location information of the detected pedestrian and bbox with the larger score [x1, y1, x2, y2] is retained, where (x1, y1) and (x2, y2) are the coordinates of the upper left corner and lower right corner of the target respectively;
[0077] For those who do not meet the above conditions, such as Figure 3 As shown in , the confidence score of the detected pedestrian is 0.75, which is less than 0.8. When the number of bicycle category images in the historical dataset is small, bicycle category data is randomly selected from the crop (historical dataset), the target is transformed to the detected position, and the bicycle category data is used to cover the pedestrian category data at the detected position, as shown in Figure 4 As shown, the bicycle category data with less data is randomly flipped and covered to the detection position, and the corresponding category information and the position information of the rectangular box are recorded.
[0078] Step S103: Merge the newly added category dataset with the cleaned historical dataset, and input the merged dataset and the corresponding third annotation file into the third detection model for model training. After training, the model is deployed. When the newly added category dataset and the cleaned historical dataset are merged, the corresponding first annotation file is also merged with the first annotation file to obtain the third annotation file corresponding to the merged dataset.
[0079] The embodiment of the present invention directly merges multiple data sets into one third detection model for training. After the training is completed, the third detection model is deployed without the need to train multiple different target detectors for deployment, thereby reducing maintenance costs and machine deployment costs. When new detection categories are not labeled in historical data, the technical effect of the model on the detection effect of historical categories can be improved, solving the problem of high costs incurred by existing technologies when new detection categories are not labeled in historical data.
[0080] When the third detection model is deployed, in order to achieve a balance between model deployment speed and effect, the third detection model adopts any one of yolov5m and YOLOX-m; in an embodiment of the present invention, the technical solution of the present invention is explained by taking the third detection model adopting yolov5m as an example.
[0081] Merging the first annotation file and the second annotation file according to the first annotation file corresponding to the newly added category dataset and the second annotation file corresponding to the historical dataset to obtain a third annotation file corresponding to the merged dataset;
[0082] The step S103 of inputting the merged data set and the corresponding third annotated file into the third detection model to perform model training, and deploying the model after the training is completed, includes:
[0083] Performing a second data enhancement on the merged dataset and the corresponding third annotation file, and inputting the image into the third detection model according to the third input resolution to perform model training; the third input resolution of the image is determined according to the third detection model. When the third detection model adopts yolov5m, the corresponding third input resolution of the image is 640*640;
[0084] The second data enhancement includes any one or more of color change, mixup, mosaic, and random flip.
[0085] Specifically, the deployment after the training is completed includes:
[0086] Convert the trained third detection model to TensorRT and use fp16 quantization acceleration to improve the model running speed;
[0087] Use Docker for deployment.
[0088] In this embodiment of the present invention, the detection model trained by yolov5m is accelerated by TensorRT, quantized by fp16, and finally deployed on a T4 machine using Docker. This can greatly improve the speed of the model in predicting images and facilitate subsequent expansion.
[0089] From the above description, it can be seen that the present invention achieves the following technical effects:
[0090] The present invention adopts a semi-supervised approach and uses the trained first and second detection models to clean the newly added categories in the historical data set, without the need for manual intervention in cleaning, thus reducing the cost of manual labeling.
[0091] Furthermore, by merging multiple data sets into the third detection model for model training and deployment, there is no need to train multiple different object detectors for deployment, which reduces model maintenance costs and machine deployment costs. This achieves the technical effect of improving the model's detection performance for historical categories when new detection categories are not labeled in historical data, thereby solving the problem of high costs incurred by existing technologies when new detection categories are not labeled in historical data.
[0092] For newly added categories with low detection scores from the first and second detection models, due to their low confidence scores, we directly use historical categories with less data to perform relevant transformations and fill in the images. This uses historical categories with small samples to cover the newly added categories with low confidence scores, increasing the coverage of small samples and improving the detection of small samples.
[0093] The trained third detection model is accelerated by TensorRT, quantized using fp16, and finally deployed on a T4 machine using Docker. This can greatly improve the speed of the model in predicting images and facilitate subsequent expansion.
[0094] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0095] The embodiment of the present invention also provides a multi-dataset target detection training system for implementing the multi-dataset target detection training method. Figure 5 As shown, the system includes:
[0096] The detection model training unit 51 is used to input the newly added category data set and the corresponding first annotation file into the first detection model and the second detection model respectively to perform detection model training;
[0097] A data cleaning unit 52 is configured to perform data cleaning on the newly added categories in the historical data set using the trained first detection model and the second detection model in a semi-supervised manner, thereby obtaining a cleaned historical data set and a corresponding second annotation file;
[0098] The data set merging unit 53 is used to merge the newly added category data set and the historical data set after data cleaning, and input the merged data set and the corresponding third annotation file into the third detection model for model training, and deploy after the training is completed.
[0099] The embodiment of the present invention further provides an electronic device, such as Figure 6 As shown, the electronic device includes one or more processors 61 and a memory 62. Figure 6 A processor 61 is taken as an example.
[0100] The controller may further include an input device 63 and an output device 64 .
[0101] The processor 61, the memory 62, the input device 63 and the output device 64 may be connected via a bus or other means. Figure 6 The bus connection is taken as an example.
[0102] The processor 61 can be a central processing unit (CPU), or 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, or a combination of the above chips. The general-purpose processor can be a microprocessor or any conventional processor.
[0103] Memory 62, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as the program instructions / modules corresponding to the control method in the embodiments of the present invention. Processor 61 executes the non-transitory software programs, instructions, and modules stored in memory 62 to execute various server functional applications and data processing, thereby implementing the multi-dataset object detection training method of the above-mentioned method embodiment.
[0104] The memory 62 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the processing device operated by the server, etc. In addition, the memory 62 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 62 may optionally include a memory remotely located relative to the processor 61, and these remote memories may be connected to a network connection device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0105] The input device 63 can receive input digital or character information and generate key signal input related to user settings and function control of the processing device of the server. The output device 64 can include a display device such as a display screen.
[0106] One or more modules are stored in the memory 62 and when executed by one or more processors 61, perform the following operations: Figure 1 The method shown.
[0107] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments of the motor control method. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (FM), a hard disk drive (HDD), or a solid-state drive (SSD). The storage medium can also include a combination of the above-mentioned types of memory.
[0108] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A multi-dataset target detection training method, characterized in that: include: Input the newly added category data set and the corresponding first annotation file into the first detection model and the second detection model respectively to perform detection model training; Use the trained first detection model and the second detection model to clean the newly added categories in the historical data set to obtain the cleaned historical data set and the corresponding second annotation file; The newly added category data set and the historical data set after data cleaning are merged, and the merged data set and the corresponding third annotation file are input into the third detection model for model training, and deployed after the training is completed.
2. The method according to claim 1, characterized in that The step of inputting the newly added category data set and the corresponding first annotation file into the first detection model and the second detection model respectively to perform detection model training includes: Inputting the newly added category dataset and the corresponding first annotation file into the first detection model according to the first input resolution of the image; Inputting the newly added category dataset and the corresponding first annotation file into the second detection model according to the second input resolution of the image; After inputting into the first detection model and the second detection model respectively, the detection model training of the newly added category is performed.
3. The method according to claim 1, characterized in that Use the trained first and second detection models to clean the newly added categories in the historical dataset, including: Using a semi-supervised approach, the trained first and second detection models are used to pseudo-label the newly added categories in the historical dataset and output target detection boxes. For the target detected by both the first detection model and the second detection model, the IOU and the confidence score are calculated according to the target detection frame, and the relationship between the IOU and the confidence score and the preset threshold is determined respectively.
4. The method according to claim 3, characterized in that The determining of the relationship between the IOU and the confidence score and a preset threshold value includes: If the IOU is greater than the first threshold, and the confidence scores of the first detection model and the second detection model are both greater than the second threshold, the target is retained, and the location information and category information of the target are recorded in the second annotation file corresponding to the historical data set; Otherwise, perform first data augmentation on the target with less historical category data in the historical data set, fill it into the position of the target detection frame, and record the position information and category information of the target with less data into the second annotation file corresponding to the historical data set; The first data enhancement includes any one or more of random scaling, random flipping, random contrast transformation, random noise and mixup.
5. The method according to claim 4, characterized in that The step of retaining the target and recording the location information and category information of the target into a second annotation file corresponding to the historical data set includes: Determining whether the confidence scores of the first detection model and the second detection model are equal; If they are not equal, the location information and category information of the target detection box corresponding to the larger confidence score are recorded in the second annotation file corresponding to the historical dataset; If they are equal, the position information and category information of the target detection box of one of the detection models are randomly selected and recorded in the second annotation file corresponding to the historical dataset.
6. The method according to claim 1, characterized in that Obtain a third annotation file corresponding to the merged dataset based on the first annotation file corresponding to the newly added category dataset and the second annotation file corresponding to the historical dataset; The step of inputting the merged data set and the corresponding third annotation file into the third detection model to perform model training, and deploying the model after the training is completed, includes: Performing second data enhancement on the merged dataset and the corresponding third annotated file, inputting the data into a third detection model according to a third input resolution of the image, and performing model training; The second data enhancement includes any one or more of color change, mixup, mosaic, and random flip.
7. The method according to claim 6, characterized in that After the training is completed, the deployment includes: Convert the trained third detection model to TensorRT and use fp16 quantization acceleration to improve the model running speed; Use Docker for deployment.
8. A multi-dataset target detection training system, characterized in that: include: A detection model training unit, configured to input the newly added category data set and the corresponding first annotation file into the first detection model and the second detection model respectively, to perform detection model training; A data cleaning unit is used to use the trained first detection model and the second detection model to perform data cleaning on the newly added categories in the historical data set in a semi-supervised manner, thereby obtaining a cleaned historical data set and a corresponding second annotation file; The data set merging unit is used to merge the newly added category data set and the historical data set after data cleaning, and input the merged data set and the corresponding third annotation file into the third detection model for model training, and deploy after the training is completed.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the multi-dataset target detection training method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the multi-dataset target detection training method described in any one of claims 1-7.
Citation Information
Patent Citations
Dataset construction method and device, mobile terminal and readable storage medium
CN108764372A
Method and device for updating model of online system
CN108932299A