A model training method and device, equipment and storage medium
By training the basic model, performing model detection, and synthesizing extended datasets, the problems of overfitting and misidentification in image processing are solved, the recognition accuracy is improved, the manual cost is reduced, and the ability to distinguish between foreground and background scenes is enhanced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2026-04-07
AI Technical Summary
Overfitting occurs in image processing, leading to increased false recognition and error rates, high manual costs, and the YOLO algorithm cannot effectively distinguish between foreground and background and filter independent false detection results.
The base model is trained by acquiring an object detection dataset, the trained model is used to detect the dataset and an expanded dataset is obtained, random samples are synthesized to expand the dataset, improve data diversity, and the model is retrained using the expanded dataset.
It improved the model's recognition accuracy, reduced the error rate and labor costs, enhanced the ability to differentiate between front and back scenic areas, and reduced false detections.
Smart Images

Figure CN115908784B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a model training method and device, equipment and storage medium. BACKGROUND
[0002] At present, in the process of image processing and model training, a serious overfitting phenomenon may be caused. The defects are as follows: in actual image processing, there are false recognitions and false errors, which increase the error rate of image processing and increase the labor cost and risk control cost. 1) The workload is relatively large. When the artificial reviews various sensitive targets, a large number of non-sensitive targets are detected, and the artificial needs to spend more effort to distinguish whether the identified target is correct or not. 2) Non-maximum suppression. In the YOLO (You Only Look Once) algorithm, a large number of bounding box prediction candidates are given in the prediction stage, but many of these candidates actually belong to the same target, so a filtering method is needed to find out which targets are behind these predictions. Non-maximum suppression method can well filter the repeated prediction in the prediction stage, but it is difficult to deal with relatively independent false detection results. 3) It is difficult to distinguish the foreground and background well. This is the root cause of the relatively independent false detection results. A small amount of errors occur due to the lack of good distinction between foreground and background in the foreground and background classification stage of the YOLO detection head. There is no good false detection suppression scheme in the YOLO original framework. SUMMARY
[0003] Therefore, the purpose of the present application is to provide a model training method, device, equipment and storage medium, which can improve the accuracy of identification and reduce the error rate and artificial cost. The specific scheme is as follows:
[0004] In a first aspect, the present application discloses a model training method, comprising:
[0005] Obtaining a target detection data set, and training a basic target detection model using the target detection data set to obtain a trained model;
[0006] Detecting the target detection data set using the trained model to obtain target data;
[0007] Obtaining an extended data set based on the target data, and training the basic target detection model using the extended data set to obtain a target model.
[0008] Optionally, the target detection data set is obtained, comprising:
[0009] Obtain the object detection dataset from the business side; the object detection dataset includes a first labeled dataset, a second unlabeled dataset, and an open dataset.
[0010] Optionally, training the basic object detection model using the object detection dataset to obtain the trained model includes:
[0011] The basic object detection model is trained using the labeled first dataset to obtain the trained model.
[0012] Optionally, the step of using the trained model to detect the target data in the target detection dataset to obtain target data includes:
[0013] The trained model is used to detect the unlabeled second dataset and the open dataset respectively to obtain a first positive ROI set and a negative ROI set; the first positive ROI set includes the positive ROIs of the unlabeled second dataset and the positive ROIs of the open dataset, and the negative ROI set includes the negative ROIs of the unlabeled second dataset and the negative ROIs of the open dataset.
[0014] Optionally, obtaining the expanded dataset based on the target data includes:
[0015] An ROI object library is formed based on the first positive ROI set and the second positive ROI set extracted from the labeled first dataset;
[0016] Obtain the original image carrying the negative ROI corresponding to each negative ROI in the negative ROI set;
[0017] A background library is obtained based on all the original images;
[0018] A synthesis pool is obtained based on the ROI object library and the background library, and an expanded dataset is obtained based on the synthesis pool.
[0019] Optionally, obtaining the expanded dataset based on the synthesis pool includes:
[0020] A synthetic sample set is obtained based on the synthetic pool;
[0021] The labeled first dataset is merged with the synthetic sample set to obtain the expanded dataset.
[0022] Optionally, obtaining the synthetic sample set based on the synthetic pool includes:
[0023] A first number of target objects are randomly selected from the ROI object library according to a first preset random mechanism;
[0024] A second number of target backgrounds are randomly selected from the background library according to a second preset random mechanism;
[0025] The target object and the target background are synthesized according to a preset synthesis rule to obtain a synthesized sample set.
[0026] Secondly, this application discloses a model training device, comprising:
[0027] The dataset acquisition module is used to acquire object detection datasets;
[0028] The first model training module is used to train the basic object detection model using the object detection dataset to obtain the trained model.
[0029] The dataset detection module is used to detect the target detection dataset using the trained model to obtain the target data;
[0030] The second model training module is used to obtain an expanded dataset based on the target data and to train the basic target detection model using the expanded dataset to obtain the target model.
[0031] Thirdly, this application discloses an electronic device, comprising:
[0032] Memory, used to store computer programs;
[0033] A processor for executing the computer program to implement the steps of the model training method disclosed above.
[0034] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the model training method disclosed above.
[0035] As can be seen, this application provides a model training method, comprising: acquiring an object detection dataset, and training a basic object detection model using the object detection dataset to obtain a trained model; using the trained model to detect the object detection dataset to obtain object data; acquiring an expanded dataset based on the object data, and training the basic object detection model using the expanded dataset to obtain a target model. Therefore, this application improves the accuracy of object detection by using the trained model obtained after training the basic object detection model to detect the object detection dataset, expanding the dataset based on the obtained target data, and then using the expanded dataset to train the model. This results in a target model with improved recognition accuracy and reduced error rate and manual labor costs. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0037] Figure 1 This is a flowchart of a model training method disclosed in this application;
[0038] Figure 2 This is a schematic diagram of the existing model training method disclosed in this application;
[0039] Figure 3 This is a schematic diagram of a model training method disclosed in this application;
[0040] Figure 4 This is a flowchart of a specific model training method disclosed in this application;
[0041] Figure 5 This is a schematic diagram illustrating the sample set acquisition method disclosed in this application;
[0042] Figure 6 This is a schematic diagram of the ROI test results disclosed in this application;
[0043] Figure 7 A schematic diagram of the model training device provided in this application;
[0044] Figure 8 This application provides a structural diagram of an electronic device. Detailed Implementation
[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] Currently, image processing and model training can lead to significant overfitting. This results in several drawbacks: In practical image processing, misidentification and false alarms occur, increasing the error rate and consequently raising labor and risk control costs. When manually reviewing sensitive targets, many non-sensitive targets are detected, requiring more effort to distinguish correct from incorrect identifications. In the YOLO algorithm, the prediction phase provides numerous candidate predictions, necessitating a filtering method to identify the true targets behind these predictions. While nonmaximum suppression effectively filters duplicate predictions, it struggles with relatively independent false detections. Furthermore, it fails to achieve good foreground / background scene differentiation. A small number of errors occur due to the YOLO detection head's inability to properly distinguish foreground and background, and the original YOLO framework lacks effective false detection suppression mechanisms. Therefore, this application provides a model training method that improves recognition accuracy and reduces the error rate and labor costs.
[0047] This invention discloses a model training method, see [link to relevant documentation]. Figure 1 As shown, the method includes:
[0048] Step S11: Obtain the object detection dataset and use the object detection dataset to train the basic object detection model to obtain the trained model.
[0049] In this embodiment, an object detection dataset is acquired, and a basic object detection model is trained using this dataset to obtain a trained model. The object detection dataset includes a labeled first dataset, an unlabeled second dataset, and an open dataset. For example, a manually labeled object detection dataset can be obtained from the business side. This dataset includes a labeled training dataset (i.e., the labeled first dataset), an unlabeled eval dataset (i.e., the unlabeled second dataset), and an arbitrary open dataset (e.g., the ImageNet dataset). It is understood that object detection is a typical AI (Artificial Intelligence) task, and different tasks have different dataset formats; this solution refers to the dataset for the object detection task.
[0050] It is understandable that in reproduction technologies, such as Figure 2As shown, a model is trained using a labeled dataset, and the trained model is directly deployed online. At this point, manual review of the model's performance is required to identify false positives and iterate the model based on these false positives. Specifically, the main function of the labeled dataset training module is to train the model on a labeled dataset. For example, if using the YOLOv5 model, the optimization method chosen during training is SGD (Stochastic Steepest Descent). The model typically converges after about 300 training cycles, and the converged model is the output of this module. The trained model is then deployed to the production environment and logged, collecting and storing the input and output of all inferred examples. After deployment, the detected examples are typically reported to a workbench, where manual review verifies the accuracy of the reported results, recording both correct and incorrect cases. The resulting case data includes sets of correctly and incorrectly reported cases, which can be used as supplementary training sets and negative example datasets, respectively. The deployed model is then further optimized. However, existing technologies have the following drawbacks: 1. The workload is relatively large. 1. Limited initial model training samples lead to several problems: 1. Weak ability to differentiate between before and after detection, resulting in numerous false positives detected during manual review after model deployment; 2. Long iteration cycle. While the model can be iterated based on online false positives, this requires significant manpower for annotation, both of which lengthen the iteration cycle and result in poor deployment performance. For example, each round of annotation and training requires 3 people for 1 week; 3. Low accuracy. The original labeled dataset is typically limited in size, and the amount of positive and negative supervision during training is insufficient, leading to low model accuracy, such as a detection accuracy of approximately 75%–85%. This results in missed positive cases and false negatives online, negatively impacting business operations.
[0051] Furthermore, such as Figure 3 As shown, this scheme first trains the basic detection model in the initial training stage, then detects and expands the unstandardized samples in the data augmentation stage, and uses a random synthesis mechanism to expand the original samples. Finally, in the final training stage, the basic detection model is retrained using the expanded samples to obtain the final target model.
[0052] Step S12: Use the trained model to detect the target data set to obtain target data.
[0053] In this embodiment, a basic object detection model is trained using the object detection dataset to obtain a trained model. Then, the trained model is used to detect objects on the object detection dataset to obtain object data. It is understood that by detecting objects on the object detection dataset, positive ROIs (regions of interest) and negative ROIs are obtained, which are then used to expand the dataset.
[0054] Step S13: Obtain the expanded dataset based on the target data, and train the basic target detection model using the expanded dataset to obtain the target model.
[0055] In this embodiment, the trained model is used to detect the target detection dataset to obtain target data. Then, an expanded dataset is obtained based on the target data, and the basic target detection model is trained using the expanded dataset to obtain the target model. It is understood that newly synthesized samples can incorporate more random factors into the random synthesis mechanism, thereby expanding the dataset to a larger scale and obtaining an expanded dataset. This allows the model to fully utilize its recognition capabilities for specific tasks without modifying the model itself, improving the accuracy of image recognition. The target model in this scheme includes a maximum suppression process to avoid the repeated reporting of a single target in the detection head module. Simultaneously, this scheme achieves good foreground / background separation. Since the basic model's learning process focuses on the recognition of positive targets, and the foreground / background separation is complex and variable, it is difficult to learn strong foreground / background separation capabilities on a limited dataset containing only positive targets. This scheme detects a large number of easily misdetected parts in a self-selected open dataset and a business scenario dataset, and merges these easily misdetected parts with positive samples, thereby enabling the model to learn more accurate background discrimination capabilities.
[0056] As can be seen, this application provides a model training method, comprising: acquiring an object detection dataset, and training a basic object detection model using the object detection dataset to obtain a trained model; using the trained model to detect the object detection dataset to obtain object data; acquiring an expanded dataset based on the object data, and training the basic object detection model using the expanded dataset to obtain a target model. Therefore, this application improves the accuracy of object detection by using the trained model obtained after training the basic object detection model to detect the object detection dataset, expanding the dataset based on the obtained target data, and then using the expanded dataset to train the model. This results in a target model with improved recognition accuracy and reduced error rate and manual labor costs.
[0057] SeeFigure 4 As shown, this embodiment of the invention discloses a model training method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution.
[0058] Step S21: Obtain the target detection dataset from the business side.
[0059] Step S22: Train the basic object detection model using the labeled first dataset to obtain the trained model.
[0060] In this embodiment, after obtaining the object detection dataset from the business side, the basic object detection model is trained using the labeled first dataset to obtain the trained model. For example, a Baseline model (basic object detection model) is trained based on the train dataset to obtain the trained model. It should be noted that the Baseline model refers to the first version of a model, whose main function is to achieve preliminary inference and prediction. The requirements for accuracy and performance are not high, and it provides a reference for subsequent model iteration and optimization.
[0061] Step S23: Use the trained model to detect the unlabeled second dataset and the open dataset respectively to obtain the first positive ROI set and the negative ROI set.
[0062] In this embodiment, a basic object detection model is trained using the labeled first dataset. After obtaining the trained model, the trained model is used to detect objects in the unlabeled second dataset and the open dataset, respectively, to obtain a first positive ROI set and a negative ROI set. It is understood that the first positive ROI set includes the positive ROIs of the unlabeled second dataset and the positive ROIs of the open dataset, and the negative ROI set includes the negative ROIs of the unlabeled second dataset and the negative ROIs of the open dataset.
[0063] like Figure 5 The trained baseline model is used to detect open datasets (unlabeled) and unlabeled eval datasets (i.e., unlabeled business datasets) to obtain the first positive ROI set and the negative ROI set in the two detection result sets. It can be understood that the target bounding box detected from the image is called the Region of Interest (ROI). Detection models typically detect targets that are either accurate or inaccurate. Inaccurate targets are usually identified as background objects in the image; these are negative ROIs. Conversely, accurate target regions are positive ROIs.
[0064] Step S24: Based on the first positive ROI set and the second positive ROI set extracted from the labeled first dataset, form an ROI object library.
[0065] In this embodiment, the trained model is used to detect the unlabeled second dataset and the open dataset respectively, obtaining a first positive ROI set and a negative ROI set. Then, an ROI object library is formed based on the first positive ROI set and the second positive ROI set extracted from the labeled first dataset. It can be understood that the ROI object library includes the original positive ROIs extracted from the labeled business dataset, positive ROIs detected from the unlabeled business dataset using the trained baseline model, and positive ROIs detected from the unlabeled open dataset using the trained baseline model. It should be noted that the ROI object library only contains local images of positive ROIs, such as... Figure 6 The small plot of the positive ROI is shown.
[0066] Step S25: Obtain the original image carrying the negative ROI corresponding to each negative ROI in the negative ROI set, and obtain the background library based on all the original images.
[0067] In this embodiment, after forming an ROI object library based on the first positive ROI set and the second positive ROI set extracted from the labeled first dataset, the original image carrying the negative ROI corresponding to each negative ROI in the negative ROI set is obtained, and a background library is obtained based on all the original images. It is understood that, as... Figure 6 The small image of the negative ROI shown is not the background image to be stored in the background library, but rather the original image containing the negative ROI corresponding to the small image of the negative ROI. That is, the ROI object library only contains the original image (also called the complete image) of the negative ROI, which is the original large image.
[0068] Step S26: Obtain a synthesis pool based on the ROI object library and the background library, and obtain a synthesis sample set based on the synthesis pool.
[0069] In this embodiment, the original image carrying the negative ROI corresponding to each negative ROI in the negative ROI set is obtained. After obtaining a background library based on all the original images, a synthesis pool is obtained based on the ROI object library and the background library, and a synthesis sample set is obtained based on the synthesis pool. It can be understood that the synthesis pool, which combines the ROI object library and the background library to form a new dataset, provides materials for the synthesis of data samples. The resource pool formed by integrating a large number of materials is called the synthesis pool.
[0070] Furthermore, obtaining the synthetic sample set based on the synthesis pool includes: synthesizing new samples by incorporating a random mechanism to form a new synthetic sample set. Specifically, a first number of target objects are randomly selected from the ROI object library according to a first preset random mechanism; a second number of target backgrounds are randomly selected from the background library according to a second preset random mechanism; and the target objects and target backgrounds are synthesized according to preset synthesis rules to obtain the synthetic sample set. It should be noted that other random mechanisms can also be used for synthesizing samples during the process of obtaining the synthetic sample set based on the synthesis pool.
[0071] Step S27: Combine the labeled first dataset with the synthetic sample set to obtain the expanded dataset.
[0072] In this embodiment, after obtaining the synthetic sample set based on the synthetic pool, the labeled first dataset is merged with the synthetic sample set to obtain the expanded dataset. Specifically, the original training dataset and the synthetic sample set are merged to expand the training dataset and achieve data augmentation. It is understandable that for AI models, a larger dataset is better, but due to the limited size and richness of datasets, this is often difficult to achieve in reality. This solution uses a limited real dataset to create more samples to expand the dataset; this process of creating fake data achieves data augmentation.
[0073] Step S28: Train the base object detection model using the expanded dataset to obtain the object model.
[0074] For details regarding steps S21 and S28, please refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
[0075] As can be seen, this application embodiment obtains an object detection dataset from the business side; trains a basic object detection model using the labeled first dataset to obtain a trained model; uses the trained model to detect the unlabeled second dataset and the open dataset respectively to obtain a first positive ROI set and a negative ROI set; forms an ROI object library based on the first positive ROI set and the second positive ROI set extracted from the labeled first dataset; obtains the original image carrying the negative ROI corresponding to each negative ROI in the negative ROI set, and obtains a background library based on all the original images; obtains a synthesis pool based on the ROI object library and the background library, and obtains a synthesis sample set based on the synthesis pool; merges the labeled first dataset and the synthesis sample set to obtain the expanded dataset; and trains the basic object detection model using the expanded dataset to obtain an object model, thereby improving the accuracy of recognition and reducing the error rate and labor costs.
[0076] See Figure 7 As shown in the embodiments, this application also discloses a model training device, including:
[0077] Dataset acquisition module 11 is used to acquire the object detection dataset;
[0078] The first model training module 12 is used to train the basic object detection model using the object detection dataset to obtain the trained model;
[0079] The dataset detection module 13 is used to detect the target detection dataset using the trained model to obtain the target data;
[0080] The second model training module 14 is used to obtain an expanded dataset based on the target data and to train the basic target detection model using the expanded dataset to obtain the target model.
[0081] As can be seen, this application includes: acquiring an object detection dataset, and training a basic object detection model using the object detection dataset to obtain a trained model; using the trained model to detect the object detection dataset to obtain object data; acquiring an expanded dataset based on the object data, and training the basic object detection model using the expanded dataset to obtain a target model. Therefore, this application improves the accuracy of object detection by using the trained model obtained after training the basic object detection model to detect the object detection dataset, expanding the dataset based on the obtained target data, and then using the expanded dataset to train the model. This results in a target model with improved recognition accuracy and reduced error rate and manual costs.
[0082] In some specific embodiments, the dataset acquisition module 11 specifically includes:
[0083] The dataset acquisition unit is used to acquire the target detection dataset from the business side; the target detection dataset includes a first labeled dataset, a second unlabeled dataset, and an open dataset.
[0084] In some specific embodiments, the first model training module 12 specifically includes:
[0085] The first model training unit is used to train the basic object detection model using the labeled first dataset to obtain the trained model.
[0086] In some specific embodiments, the dataset detection module 13 specifically includes:
[0087] The dataset detection unit is used to detect the unlabeled second dataset and the open dataset using the trained model to obtain a first positive ROI set and a negative ROI set; the first positive ROI set includes the positive ROIs of the unlabeled second dataset and the positive ROIs of the open dataset, and the negative ROI set includes the negative ROIs of the unlabeled second dataset and the negative ROIs of the open dataset.
[0088] In some specific embodiments, the second model training module 14 specifically includes:
[0089] The ROI object library acquisition unit is used to form an ROI object library based on the first positive ROI set and the second positive ROI set extracted from the labeled first dataset;
[0090] The original image acquisition unit is used to acquire the original image carrying the negative ROI corresponding to each negative ROI in the negative ROI set;
[0091] The background library acquisition unit is used to obtain a background library based on all the original images;
[0092] A synthesis pool construction unit is used to obtain a synthesis pool based on the ROI object library and the background library;
[0093] The target object random sampling unit is used to randomly sample a first number of target objects from the ROI object library according to a first preset random mechanism;
[0094] The target background random extraction unit is used to randomly extract a second number of target backgrounds from the background library according to a second preset random mechanism;
[0095] A synthetic sample set acquisition unit is used to synthesize the target object and the target background according to a preset synthesis rule to obtain a synthetic sample set;
[0096] A dataset expansion unit is used to merge the labeled first dataset with the synthetic sample set to obtain the expanded dataset;
[0097] The second model training unit is used to train the base object detection model using the expanded dataset to obtain the object model.
[0098] Furthermore, embodiments of this application also provide an electronic device. Figure 8 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0099] Figure 8 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the model training method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0100] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0101] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0102] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including computer programs capable of performing the model training method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0103] Furthermore, this application also discloses a storage medium storing a computer program, which, when loaded and executed by a processor, implements the model training method steps disclosed in any of the foregoing embodiments.
[0104] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0105] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0106] The above provides a detailed description of the model training method, apparatus, device, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A model training method, characterized in that, include: Obtain the object detection dataset and use the object detection dataset to train the basic object detection model to obtain the trained model; The target detection dataset includes a labeled first dataset, an unlabeled second dataset, and an open dataset; The trained model is used to detect the target data in the target detection dataset to obtain the target data; Based on the target data, an expanded dataset is obtained, and the base target detection model is trained using the expanded dataset to obtain the target model; The step of using the trained model to detect the target data in the target detection dataset to obtain target data includes: The trained model is used to detect the unlabeled second dataset and the open dataset respectively to obtain a first positive ROI set and a negative ROI set; the first positive ROI set includes the positive ROIs of the unlabeled second dataset and the positive ROIs of the open dataset, and the negative ROI set includes the negative ROIs of the unlabeled second dataset and the negative ROIs of the open dataset; The process of obtaining the expanded dataset based on the target data includes: An ROI object library is formed based on the first positive ROI set and the second positive ROI set extracted from the labeled first dataset; Obtain the original image carrying the negative ROI corresponding to each negative ROI in the negative ROI set; A background library is obtained based on all the original images; A synthesis pool is obtained based on the ROI object library and the background library, and an expanded dataset is obtained based on the synthesis pool; The process of obtaining the expanded dataset based on the synthesis pool includes: A synthetic sample set is obtained based on the synthetic pool; The labeled first dataset is merged with the synthetic sample set to obtain the expanded dataset.
2. The model training method according to claim 1, characterized in that, The acquisition of the target detection dataset includes: Obtain the target detection dataset from the business side.
3. The model training method according to claim 1, characterized in that, The step of training the basic object detection model using the object detection dataset to obtain the trained model includes: The basic object detection model is trained using the labeled first dataset to obtain the trained model.
4. The model training method according to claim 1, characterized in that, The process of obtaining a synthetic sample set based on the synthetic pool includes: A first number of target objects are randomly selected from the ROI object library according to a first preset random mechanism; A second number of target backgrounds are randomly selected from the background library according to a second preset random mechanism; The target object and the target background are synthesized according to a preset synthesis rule to obtain a synthesized sample set.
5. A model training device, characterized in that, include: The dataset acquisition module is used to acquire the object detection dataset; the object detection dataset includes a labeled first dataset, an unlabeled second dataset, and an open dataset; The first model training module is used to train the basic object detection model using the object detection dataset to obtain the trained model. The dataset detection module is used to detect the target detection dataset using the trained model to obtain the target data; The second model training module is used to obtain an expanded dataset based on the target data and to train the basic target detection model using the expanded dataset to obtain the target model. The dataset detection module includes: The dataset detection unit is used to detect the unlabeled second dataset and the open dataset using the trained model to obtain a first positive ROI set and a negative ROI set; the first positive ROI set includes the positive ROIs of the unlabeled second dataset and the positive ROIs of the open dataset, and the negative ROI set includes the negative ROIs of the unlabeled second dataset and the negative ROIs of the open dataset; The second model training module is specifically used for: forming an ROI object library based on the first positive ROI set and the second positive ROI set extracted from the labeled first dataset; obtaining the original image carrying the negative ROI corresponding to each negative ROI in the negative ROI set; obtaining a background library based on all the original images; obtaining a synthesis pool based on the ROI object library and the background library; and obtaining an expanded dataset based on the synthesis pool. The process of obtaining the expanded dataset based on the synthesis pool includes: A synthetic sample set is obtained based on the synthetic pool; The labeled first dataset is merged with the synthetic sample set to obtain the expanded dataset.
6. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the model training method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the model training method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Target detection method and device, electronic equipment and storage medium
CN113095434A
Image processing method and device thereof, electronic equipment and machine readable storage medium
CN113989843A