Deep learning model training method and device, electronic equipment and storage medium
By generating a negative sample dataset and dynamically incorporating error-prone data into the training process, the method enhances deep learning model accuracy and reduces false positives, addressing the limitations of conventional methods in complex scenarios.
Patent Information
- Application Number
- CN202411129554.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-20
AI Technical Summary
Deep learning models face challenges in improving accuracy, particularly in complex scenarios due to high false positive rates and the difficulty in predicting unknown scenarios, which are not adequately addressed by conventional methods like optimizing loss or data enhancement.
A method involving the creation of a negative sample dataset by filtering out data prone to errors using a preset deep learning model, followed by dynamically selecting and incorporating negative samples into the training process based on an update frequency coefficient to enhance model training.
This approach improves the accuracy of deep learning models by reducing false positives and enhancing their performance in complex scenarios, ensuring efficient and effective training without increasing costs.
Smart Images

Figure CN119167160A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer application technology, and in particular to a deep learning model training method, device, electronic device and storage medium. Background Art
[0002] Deep learning is a branch of machine learning, and is a type of algorithm that attempts to use multi-processing layer computational models that contain complex structures or consist of multiple nonlinear transformations to perform high-level abstraction of data.
[0003] In deep learning, in order to quickly apply it to various specific industries, it is a challenge to continuously improve the accuracy of the model. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a deep learning model training method, device, electronic device and storage medium to improve the accuracy of the deep learning model. The specific technical solution is as follows:
[0005] In a first aspect, a deep learning model training method is provided, comprising:
[0006] Obtaining an update frequency coefficient, where the update frequency coefficient is used to represent an update interval for updating negative sample data;
[0007] According to the update interval, negative sample data is selected from the negative sample data set, wherein the negative sample data set includes data in which a first processing object screened out from at least one data set based on a preset deep learning model is inconsistent with an object actually included in the data, and the objects actually included in the data do not include a target object, and the first processing object is obtained by processing the data with the preset deep learning model;
[0008] The selected negative sample data is added as sample data to the training data set, and the preset deep learning model is trained based on the training data set.
[0009] Optionally, constructing the negative sample dataset includes:
[0010] Collect at least one dataset;
[0011] Processing the data in the data set by using a preset deep learning model to obtain a first processing object corresponding to the data;
[0012] When the first processing object is inconsistent with the object actually contained in the data, the data is used as candidate data, and when the objects actually contained in the candidate data include the target object, the candidate data is removed from the data set to obtain a negative sample data set.
[0013] Optionally, the method further comprises:
[0014] Processing the data in the data set by using a preset deep learning model, and obtaining a confidence level corresponding to the first processing object;
[0015] In the case where the first processing object is inconsistent with the object actually included in the data, taking the data as candidate data includes:
[0016] If the first processing object is inconsistent with the object actually contained in the data, and the confidence corresponding to the first processing object exceeds a first confidence threshold, the data is taken as candidate data.
[0017] Optionally, selecting negative sample data from the negative sample data set according to the update interval includes:
[0018] At each update interval, a preset number of negative sample data is selected from the negative sample data set, where the preset number is determined based on a negative sample number coefficient and the number of positive sample data.
[0019] Optionally, selecting negative sample data from a negative sample data set includes:
[0020] Randomly select a preset number of negative sample data from the negative sample data set;
[0021] and / or,
[0022] A negative sample data set is selected in which a second processing object is inconsistent with an object actually contained in the data and a confidence level corresponding to the second processing object exceeds a second confidence level threshold.
[0023] Optionally, the selecting a second processing object from the negative sample data set is inconsistent with an object actually included in the data, and negative sample data whose confidence level corresponding to the second processing object exceeds a second confidence level threshold includes:
[0024] The negative sample data in the negative sample data set is processed by a trained preset deep learning model to obtain a second processing object corresponding to the negative sample data and a confidence level corresponding to the second processing object, wherein the trained preset deep learning model includes a model obtained by training the preset deep learning model using a preset number of negative sample data and positive sample data randomly selected from the negative sample data set as sample data;
[0025] If the second processing object is inconsistent with the object actually included in the negative sample data, and the confidence corresponding to the second processing object exceeds a second confidence threshold, the negative sample data is used as the selected negative sample data.
[0026] Optionally, if the number of selected negative sample data does not reach the preset number, the negative sample data whose second processing objects are inconsistent with the objects actually contained in the negative sample data and whose confidences corresponding to the second processing objects exceed the second confidence threshold are sequentially selected as negative sample data in order of the confidences corresponding to the second processing objects from large to small, until the number of selected negative sample data reaches the preset number.
[0027] Optionally, the preset deep learning model includes at least one of the following models: an image detection model, an image recognition model, an image classification model, and the at least one data set includes an image data set, and the data included in the at least one data set is an image.
[0028] In a second aspect, a deep learning model training device is provided, comprising:
[0029] An acquisition module, used for acquiring an update frequency coefficient, where the update frequency coefficient is used for indicating an update interval for updating negative sample data;
[0030] A selection module, configured to select negative sample data from a negative sample data set according to the update interval, wherein the negative sample data set includes data in which a first processing object screened out from at least one data set based on a preset deep learning model is inconsistent with an object actually included in the data, and the objects actually included in the data do not include a target object, and the first processing object is obtained by processing the data with the preset deep learning model;
[0031] The training module is used to add the selected negative sample data as sample data to the training data set, and train the preset deep learning model based on the training data set.
[0032] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0033] Memory, used to store computer programs;
[0034] The processor is used to implement any method step described in the first aspect when executing the program stored in the memory.
[0035] The embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.
[0036] An embodiment of the present invention also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-described deep learning model training methods.
[0037] Beneficial effects of the embodiments of the present invention:
[0038] The deep learning model training method provided by the embodiment of the present invention can select negative sample data from the negative sample data set according to the update interval of the updated negative sample data represented by the update frequency coefficient, and add the selected negative sample data as sample data to the training data set, and train the preset deep learning model based on the training data set, that is, dynamically select negative sample data for model training, and the negative sample data set includes data that the first processing object screened out from at least one data set based on the preset deep learning model is inconsistent with the object actually contained in the data, and the object actually contained in the data does not include the target object. In the process of training the deep learning model, the first processing object screened out from at least one data set based on the preset deep learning model is considered to be inconsistent with the object actually contained in the data, and the object actually contained in the data does not include the target object. That is, in the process of training the deep learning model, training is performed on negative sample data that is prone to errors, so that the accuracy of the deep learning model can be improved.
[0039] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0041] Figure 1 A flowchart of a deep learning model training method provided by an embodiment of the present invention;
[0042] Figure 2 A flowchart of constructing a negative sample data set in an embodiment of the present invention;
[0043] Figure 3 A schematic diagram of comparison of results in an embodiment of the present invention;
[0044] Figure 4 Another result comparison schematic diagram in an embodiment of the present invention;
[0045] Figure 5 A schematic diagram of the structure of a deep learning model training device provided by an embodiment of the present invention;
[0046] Figure 6 Another structural schematic diagram of a deep learning model training device provided by an embodiment of the present invention;
[0047] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments 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 based on the present invention belong to the scope of protection of the present invention.
[0049] In order to improve the accuracy of a deep learning model, an embodiment of the present invention provides a deep learning model training method, device, electronic device and storage medium.
[0050] The deep learning model training method provided by an embodiment of the present invention is first described in detail below.
[0051] The deep learning model training method provided by the embodiment of the present invention can be applied to electronic devices. Specifically, the electronic devices can be servers, terminals, etc.
[0052] Reference Figure 1 , the deep learning model training method provided by the embodiment of the present invention includes:
[0053] S101, obtaining an update frequency coefficient, where the update frequency coefficient is used to represent an update interval for updating negative sample data;
[0054] S102, selecting negative sample data from a negative sample data set according to an update interval, wherein the negative sample data set includes data in which a first processing object screened out from at least one data set based on a preset deep learning model is inconsistent with an object actually included in the data, and the objects actually included in the data do not include a target object, and the first processing object is obtained by processing the data using the preset deep learning model;
[0055] S103: Add the selected negative sample data as sample data to the training data set, and train the preset deep learning model based on the training data set.
[0056] In an embodiment of the present invention, negative sample data is selected from a negative sample data set according to an update interval of the updated negative sample data represented by an update frequency coefficient, and the selected negative sample data is added to a training data set as sample data, and the preset deep learning model is trained based on the training data set, that is, negative sample data is dynamically selected for model training, and the negative sample data set includes data that the first processing object screened out from at least one data set based on the preset deep learning model is inconsistent with the object actually contained in the data, and the object actually contained in the data does not include the target object. In the process of training the deep learning model, the first processing object screened out from at least one data set based on the preset deep learning model is considered to be inconsistent with the object actually contained in the data, and the object actually contained in the data does not include the target object. That is, in the process of training the deep learning model, training is performed on negative sample data that is prone to error, so that the accuracy of the deep learning model can be improved.
[0057] Furthermore, the accuracy problem of deep learning models in complex scenarios can be solved quickly, and their smooth implementation can be accelerated. In addition, the deep learning model training method provided by the embodiment of the present invention does not conflict with other conventional methods, can be used in conjunction, and is simple to implement.
[0058] In S101, the update frequency coefficient can be preset. The update frequency coefficient is a positive integer, and its function is to update the negative sample data participating in the training at intervals during the training process.
[0059] For example, set the update frequency coefficient of the negative sample data involved in training: dynamic_r.
[0060] The value range of dynamic_r is a positive integer greater than 0. The larger the value, the lower the update frequency of the negative sample data participating in the training. The value of dynamic_r can be adjusted according to the actual situation for different tasks.
[0061] In an optional implementation, the update interval of the negative sample data represented by the update frequency coefficient is usually a few epochs, where an epoch represents the process of sending all the selected negative sample data into the deep learning model and obtaining the results). An epoch means that all the training data sets are trained at one time, which is also often called a training iteration.
[0062] For example, the update frequency coefficient of the negative sample data involved in the training is set: dynamic_r. During the training process, the negative sample data involved in the training will be updated at intervals (usually several epochs).
[0063] In S102, negative sample data is selected from the negative sample data set according to the update interval of the negative sample data represented by the update frequency coefficient.
[0064] It can also be understood that negative sample data is selected from the negative sample data set once every update interval; or, it can also be said that a batch of negative sample data is updated every update interval.
[0065] In an embodiment of the present invention, a negative sample data set includes data in which a first processing object screened out from at least one data set based on a preset deep learning model is inconsistent with an object actually contained in the data, and the objects actually contained in the data do not include a target object, and the first processing object is obtained by processing the data with a preset deep learning model.
[0066] In S103, the training data set also includes positive sample data, and the negative sample data in the training data set is used together with the positive sample data to train the preset deep learning model.
[0067] If the object actually contained in the data includes the target object, the data can be understood as positive sample data. The specific training method can adopt the training method of the deep learning model in the related technology, which is not limited in the embodiment of the present invention.
[0068] For ease of understanding, the process of constructing a negative sample data set is first described here, and then the process of selecting negative sample data from the negative sample data set according to the update interval of the negative sample data represented by the above update frequency coefficient is described.
[0069] Reference Figure 2 In an embodiment of the present invention, constructing a negative sample data set includes:
[0070] S201, collecting at least one data set;
[0071] The data set may be a public data set, and the specific data set may be selected according to the actual task.
[0072] In one possible implementation, the deep learning model training method provided by the embodiment of the present invention is applied to the field of image processing, and the data set is a public image data set, such as a computer vision system data set (Imagenet), a computer vision standard data set (PASCAL VOC), a data set for image recognition (Common Objects in context, COCO) data set, a data set for image classification (Caltech), and the like.
[0073] S202: Process the data in the data set by using a preset deep learning model to obtain a first processing object corresponding to the data.
[0074] The preset deep learning model here can be the deep learning model to be trained in the embodiment of the present invention. For example, a model that has been trained by other methods but the model accuracy still needs to be improved; or the deep learning model to be trained can also be understood as the current optimal model, etc.
[0075] For each data in the data set, the data can be input into the preset deep learning model, and the data in the data set can be processed by the preset deep learning model to obtain a first processing object corresponding to the data, wherein the first processing object corresponding to the data can be understood as the result obtained by the preset deep learning model processing the data in the data set, which represents the object contained in the data obtained by the preset deep learning model.
[0076] S203, when the first processing object is inconsistent with the object actually contained in the data, the data is used as candidate data, and when the objects actually contained in the candidate data include the target object, the candidate data is removed from the data set to obtain a negative sample data set.
[0077] If the target object is not included in the objects actually included in the candidate data, the candidate data is retained.
[0078] That is, the first processing object screened out from at least one data set based on the preset deep learning model is inconsistent with the object actually contained in the data, and the objects actually contained in the data do not include data of the target object.
[0079] The target object is determined according to the actual task, such as the face detection task, the target object is the face; the vehicle detection task, the target object is the vehicle, etc. The objects actually included in the data can be manually pre-marked and input into the electronic device.
[0080] The part of data in which the filtered first processing object is inconsistent with the object actually contained in the data can also be understood as error-prone data filtered out using a preset deep learning model.
[0081] If the object actually contained in the data includes the target object, the data can be understood as positive sample data. In the case where the first processing object is inconsistent with the object actually contained in the data, the data is used as candidate data, and if the object actually contained in the candidate data includes the target object, the candidate data is removed from the data set. It can also be understood that after using the preset deep learning model to screen out error-prone data, the positive sample data is removed from these error-prone data, so that the data obtained is error-prone data of the current model and has no positive samples.
[0082] Specifically, for a piece of data, after obtaining the first processing object corresponding to the data, the first processing object corresponding to the data can be compared with the object actually contained in the data. If the first processing object corresponding to the data is inconsistent with the object actually contained in the data, it is further determined whether the object actually contained in the data contains the target object. If the object actually contained in the data does not include the target object, the data is used as negative sample data in the negative sample data set. If the first processing object corresponding to the data is consistent with the object actually contained in the data, it is not further determined whether the object actually contained in the data includes the target object, that is, the determination of the data is terminated, and the data is not used as negative sample data in the negative sample data set.
[0083] Alternatively, for a piece of data, after obtaining the first processing object corresponding to the data, it is also possible to first determine whether the objects actually contained in the data include the target object. If the objects actually contained in the data do not include the target object, then further, the first processing object corresponding to the data is compared with the objects actually contained in the data. If the first processing object corresponding to the data is inconsistent with the objects actually contained in the data, then the data is used as negative sample data in a negative sample data set.
[0084] In one possible implementation, in S202, the data in the data set is processed by a preset deep learning model, and in addition to obtaining a first processing object corresponding to the data, a confidence level corresponding to the first processing object is also obtained. In this case, in S203, when the first processing object is inconsistent with the object actually contained in the data, the data is used as candidate data, which may include:
[0085] If the first processing object is inconsistent with the object actually contained in the data, and the confidence corresponding to the first processing object exceeds a first confidence threshold, the data is taken as candidate data.
[0086] The first confidence threshold may be determined according to tasks or requirements, experience, etc.
[0087] The confidence level corresponding to the first processing object indicates that the preset deep learning model processes the data in the data set and obtains the confidence level of the first processing object.
[0088] In accordance with the above Figure 2 After the negative sample data set is constructed in the illustrated embodiment, negative sample data can be selected from the negative sample data set according to the update interval of the negative sample data represented by the update frequency coefficient.
[0089] Specifically, at every update interval, a preset number of negative sample data are selected from the negative sample data set.
[0090] The preset number is determined based on the negative sample quantity coefficient and the number of positive sample data.
[0091] The negative sample number coefficient is a floating point number.
[0092] For example, set the coefficient of the number of negative samples participating in training (floating point number): train_neg_r. If the number of positive sample data is: train_nums, then the number of negative sample data participating in training is:
[0093] train_neg_nums=train_neg_r*train_nums
[0094] The value of train_neg_r is a floating point number greater than 0. The larger the train_neg_r is, the more negative samples will be added to the training, and the false positive rate of the model will be lower, but at the same time, the model detection rate will also gradually decrease. Usually, train_neg_r = 1.0 is a relatively appropriate parameter. For different tasks, the value of train_neg_r can be adjusted according to the actual situation.
[0095] At each update interval, a preset number of negative sample data are selected from the negative sample data set, which may include two strategies. In actual application, one or both of the two strategies may be selected according to actual needs.
[0096] A strategy that randomly selects a preset number of negative sample data from the negative sample dataset.
[0097] It can also be understood as randomly selecting a certain number of negative samples from the negative sample data set obtained above to participate in the training.
[0098] The advantages of this strategy are: high efficiency and ensuring the diversity of the training data set.
[0099] Another strategy is to select negative sample data from the negative sample data set, in which the second processing object is inconsistent with the object actually contained in the data, and the confidence level corresponding to the second processing object exceeds a second confidence threshold.
[0100] The second confidence threshold may be determined based on actual needs or experience, and may be the same as or different from the first confidence threshold.
[0101] This strategy can also be called difficult negative sample mining. Simply put, the model is used to select negative samples that are more prone to errors to participate in the next training.
[0102] In the embodiment of the present invention, the order and weight of the two strategies can be adjusted according to different requirements.
[0103] In one possible implementation, the first strategy is first used, that is, a preset number of negative sample data are randomly selected from the negative sample data set; and then the second strategy is used, that is, negative sample data whose second processing object is inconsistent with the object actually contained in the data and whose confidence level corresponding to the second processing object exceeds a second confidence threshold is selected from the negative sample data set.
[0104] For example, the first time or the first few times (such as the second or third time, which can be determined according to actual needs) when the update interval for updating the negative sample data represented by the above update frequency coefficient is reached and the negative sample data needs to be updated, the first strategy is used to select negative sample data from the negative sample data set. Subsequently, when the update interval for updating the negative sample data represented by the above update frequency coefficient is reached and the negative sample data needs to be updated, the second strategy is used to select negative sample data from the negative sample data set.
[0105] In the embodiment of the present invention, the first strategy is used first and then the second strategy can achieve better results: while ensuring the diversity and high efficiency of the training data set, negative sample data that are prone to errors (the second processing object is inconsistent with the object actually contained in the data, and the confidence corresponding to the second processing object exceeds the second confidence threshold) can be selected as training samples to improve the training of model performance.
[0106] For the second strategy, selecting the negative sample data whose second processing object is inconsistent with the object actually contained in the data and whose confidence level corresponding to the second processing object exceeds the second confidence level threshold from the negative sample data set may specifically include:
[0107] The negative sample data in the negative sample data set is processed by the trained preset deep learning model to obtain a second processing object corresponding to the negative sample data and a confidence level corresponding to the second processing object; if the second processing object is inconsistent with the object actually contained in the negative sample data, and the confidence level corresponding to the second processing object exceeds a second confidence level threshold, the negative sample data is used as the selected negative sample data.
[0108] In one possible implementation, a preset number of negative sample data may be selected in order of confidence from high to low.
[0109] Among them, the trained preset deep learning model includes a model obtained by training the preset deep learning model with a preset number of negative sample data and positive sample data randomly selected from the negative sample data set as sample data.
[0110] For example, when the update interval for updating negative sample data represented by the above-mentioned update frequency coefficient is reached for the first time or the first few times, the first strategy has been adopted to select negative sample data from the negative sample data set, and the selected negative sample data and positive sample data are used as sample data to train the preset deep learning model to obtain the trained preset deep learning model. If the update interval for updating negative sample data represented by the above-mentioned update frequency coefficient is reached again in the future and the negative sample data needs to be updated, at this time, the negative sample data in the negative sample data set can be processed by the trained preset deep learning model to obtain the second processing object corresponding to the negative sample data and the confidence corresponding to the second processing object. If the second processing object is inconsistent with the object actually contained in the negative sample data, and the confidence corresponding to the second processing object exceeds the second confidence threshold, the negative sample data is used as the selected negative sample data.
[0111] For the negative sample data in the negative sample data set, the negative sample data can be input into the trained preset deep learning model, and the negative sample data can be processed by the trained preset deep learning model to obtain the second processing object corresponding to the negative sample data. The second processing object corresponding to the negative sample data can be understood as the result obtained by the trained preset deep learning model processing the negative sample data, indicating the object contained in the negative sample data processed by the trained preset deep learning model.
[0112] The confidence level corresponding to the second processing object represents the confidence level of the second processing object obtained by processing the negative sample data in the negative sample data set by the trained preset deep learning model.
[0113] In practical applications, there may be the following situation: the number of negative sample data participating in the training has been determined to be a preset number, but the number of negative sample data selected in the manner of selecting the second processing object from the negative sample data set is inconsistent with the object actually contained in the data, and the confidence level corresponding to the second processing object exceeds the second confidence level threshold, and the number of negative sample data selected does not reach the preset number. For this situation:
[0114] If the number of selected negative sample data does not reach the preset number, then in order of the confidence corresponding to the second processing object from large to small, the negative sample data that is inconsistent with the second processing object actually contained in the negative sample data and whose confidence corresponding to the second processing object exceeds the second confidence threshold will be selected as the negative sample data until the number of selected negative sample data reaches the preset number.
[0115] That is, in the order of the confidence corresponding to the second processing object from large to small, part or all of the negative sample data in the negative sample data that is inconsistent with the second processing object and whose confidence corresponding to the second processing object exceeds the second confidence threshold is copied and selected again as the negative sample data.
[0116] It can also be understood that for difficult negative sample mining, if the number of negative sample data selected by the above method is less than train_neg_nums, the negative sample data is copied according to the principle of priority copying according to difficulty until the number of negative sample data reaches train_neg_nums.
[0117] In this way, it can be ensured that difficult negative samples are given a larger training weight, so that more difficult samples can be fitted during model training. Here, the difficult negative samples are the negative sample data whose second processing object selected from the negative sample data set is inconsistent with the object actually contained in the data, and whose confidence corresponding to the second processing object exceeds the second confidence threshold.
[0118] For example, the second processing object selected from the negative sample data set is inconsistent with the object actually contained in the data, and the negative sample data corresponding to the second processing object exceeds the second confidence threshold, including data 1, data 2, data 3, and data 4, that is, 4 data, and the preset number of negative sample data expected to be selected from the negative sample data set is 7, that is, train_neg_nums is 7, then in addition to using the selected 4 as the negative sample data selected from the negative sample data set, the confidence corresponding to the second processing object of these 4 data is further compared. If the order of the confidence corresponding to the second processing object from large to small is data 1> data 2> data 3> data 4, then data 1, data 2 and data 3 are selected. Because the second processing object selected from the negative sample data set is inconsistent with the object actually contained in the data, and the number of negative sample data corresponding to the second processing object whose confidence exceeds the second confidence threshold is 4, which is 3 less than the preset number, the order of the confidence corresponding to the second processing object from large to small is data 1> data 2> data 3> data 4, and data 1, data 2 and data 3 are selected again as the negative sample data selected from the negative sample data set. In this way, the negative sample data finally selected from the negative sample data set includes: data 1, data 2, data 3, data 4, data 1, data 2 and data 3. It can be understood that, when the second processing object selected from the negative sample data set is inconsistent with the object actually contained in the data, and the number of negative sample data selected for the negative sample data corresponding to the second processing object exceeds the second confidence threshold, which is less than the expected number of negative sample data selected and less than the preset number, data 1, data 2, and data 3 are copied in order of confidence from large to small, that is, according to the principle of priority copying according to difficulty, the negative sample data is copied until the number of negative sample data reaches train_neg_nums. It should be noted that the amount of data here is only for convenience of explanation. In actual applications, it may be more than the example here, which is allowed.
[0119] Image detection, recognition, and classification are widely used tasks in deep learning.
[0120] The deep learning model training method provided by the embodiment of the present invention can be specifically applied to fields such as image detection or image classification.
[0121] The preset deep learning model includes at least one of the following models: an image detection model, an image classification model, at least one data set includes an image data set, and at least one data set includes data that is an image.
[0122] In order to improve the accuracy of the model, methods often used include optimizing loss, trying different data enhancement methods, optimizing network structure, collecting more data sets, etc. Obviously, these methods can achieve good results, but in actual deployment, they often face many model accuracy problems, the most prominent of which is: too many model false positives, because in actual deployment, we never know how complex the real test scenario is, and the model often faces many unknown complex scenarios.
[0123] An embodiment of the present invention provides a deep learning model training method applied to the field of image detection to reduce the false detection rate and improve the accuracy of the image detection model.
[0124] When the deep learning model training method provided by the embodiment of the present invention is applied to the field of image detection, it can be understood as a training method for an image detection model.
[0125] Regarding the training method of the image detection model, the above-mentioned at least one data set includes an image data set, and the data included in at least one data set is an image. The preset image detection model processes the data in the data set, that is, performs image detection on the images in the image data set.
[0126] In the above S102, the negative sample data set includes an image in which a first processing object screened out from at least one image data set based on a preset image detection model is inconsistent with an object actually contained in the image, and the objects actually contained in the image do not include the target object, and the first processing object is obtained by detecting the image with the preset image detection model.
[0127] For each image in the image data set, the image can be input into the preset image detection model, and the image in the image data set is processed by the preset image detection model to obtain a first processing object corresponding to the image, and when the first processing object is inconsistent with the object actually contained in the image, the image is used as a candidate image, and when the object actually contained in the candidate image includes the target object, the candidate data is removed from the image data set to obtain a negative sample data set. The first processing object corresponding to the image can be understood as the result obtained by the preset image detection model detecting the image in the data set, indicating the object contained in the image processed by the preset image detection model.
[0128] Furthermore, negative sample data can be selected from the negative sample data set according to the update interval, and the selected negative sample data and positive sample data can be used as sample data to train the preset image detection model.
[0129] Specifically, the process of selecting negative sample data from the negative sample data set according to the update interval and using the selected negative sample data and positive sample data as sample data to train the preset image detection model can be referred to in the above embodiment.
[0130] In an embodiment of the present invention, negative sample data is selected from a negative sample data set according to an update interval of updating negative sample data represented by an update frequency coefficient, and the selected negative sample data is added to a training data set as sample data, and the preset deep learning model is trained based on the training data set, that is, negative sample data is dynamically selected for model training, and the negative sample data set includes an image in which a first processing object screened out from at least one image data set based on a preset image detection model is inconsistent with an object actually contained in the image, and the objects actually contained in the data do not include the target object. In the process of training the image detection model, the data in which the first processing object screened out from at least one image data set based on a preset image detection model is inconsistent with an object actually contained in the data, and the objects actually contained in the image do not include the target object is considered, that is, in the process of training the image detection model, training is performed on negative sample data that is prone to error, so that the false detection rate of the image detection model can be reduced and the accuracy of the image detection model can be improved.
[0131] When the deep learning model training method provided by the embodiment of the present invention is applied to the field of image recognition, it can be understood as a training method for an image recognition model.
[0132] Regarding the training method of the image recognition model, the above-mentioned at least one data set includes an image data set, and the data included in at least one data set is an image. The preset image recognition model processes the data in the data set, that is, performs image recognition on the images in the image data set.
[0133] In the above S102, the negative sample data set includes an image in which a first processing object screened out from at least one image data set based on a preset image recognition model is inconsistent with an object actually contained in the image, and the objects actually contained in the image do not include the target object, and the first processing object is obtained by recognizing the image by the preset image recognition model.
[0134] For each image in the image data set, the image can be input into the preset image recognition model, and the image in the image data set is processed by the preset image recognition model to obtain a first processing object corresponding to the image, and when the first processing object is inconsistent with the object actually contained in the image, the image is used as a candidate image, and when the object actually contained in the candidate image includes the target object, the candidate data is removed from the image data set to obtain a negative sample data set. The first processing object corresponding to the image can be understood as the result obtained by the preset image recognition model detecting the image in the data set, indicating the object contained in the image processed by the preset image recognition model.
[0135] Furthermore, negative sample data can be selected from the negative sample data set according to the update interval, and the selected negative sample data and positive sample data can be used as sample data to train the preset image recognition model.
[0136] Specifically, the process of selecting negative sample data from the negative sample data set according to the update interval and using the selected negative sample data and positive sample data as sample data to train the preset deep learning model can be referred to in the above embodiment.
[0137] In an embodiment of the present invention, negative sample data is selected from a negative sample data set according to an update interval of the updated negative sample data represented by an update frequency coefficient, and the selected negative sample data is added to a training data set as sample data, and the preset deep learning model is trained based on the training data set, that is, negative sample data is dynamically selected for model training, and the negative sample data set includes an image in which the first processing object screened out from at least one image data set based on a preset image recognition model is inconsistent with the object actually contained in the image, and the objects actually contained in the data do not include the target object. In the process of training the image recognition model, the data in which the first processing object screened out from at least one image data set based on a preset image detection model is inconsistent with the object actually contained in the data, and the objects actually contained in the image do not include the target object is considered, that is, in the process of training the image recognition model, training is performed on negative sample data that is prone to error, so that the misrecognition rate of the image recognition model can be reduced and the accuracy of the image recognition model can be improved.
[0138] When the deep learning model training method provided by the embodiment of the present invention is applied to the field of image classification, it can be understood as a training method for an image classification model.
[0139] For the training method of the image classification model, the above-mentioned at least one data set includes an image data set, and the data included in at least one data set are images. The preset image classification model processes the data in the data set, that is, classifies the images in the image data set.
[0140] In the above S102, the negative sample data set includes an image in which a first processing object screened out from at least one image data set based on a preset image classification model is inconsistent with an object actually contained in the image, and the objects actually contained in the image do not include the target object, and the first processing object is obtained by classifying the image with the preset image classification model.
[0141] For each image in the image data set, the image can be input into the preset image classification model, and the image in the image data set is processed by the preset image classification model to obtain a first processing object corresponding to the image, and when the first processing object is inconsistent with the object actually contained in the image, the image is used as a candidate image, and when the object actually contained in the candidate image includes the target object, the candidate data is removed from the image data set to obtain a negative sample data set. The first processing object corresponding to the image can be understood as the result obtained by the preset image classification model detecting the image in the data set, indicating the object contained in the image processed by the preset image classification model.
[0142] Furthermore, negative sample data can be selected from the negative sample data set according to the update interval, and the selected negative sample data and positive sample data can be used as sample data to train the preset image classification model. Specifically, the process of selecting negative sample data from the negative sample data set according to the update interval, and using the selected negative sample data and positive sample data as sample data to train the preset image detection model can be referred to in the above embodiment.
[0143] In an embodiment of the present invention, negative sample data is selected from a negative sample data set according to an update interval of updating negative sample data represented by an update frequency coefficient, and the selected negative sample data is added to a training data set as sample data, and the preset deep learning model is trained based on the training data set, that is, negative sample data is dynamically selected for model training, and the negative sample data set includes an image in which a first processing object screened out from at least one image data set based on a preset image classification model is inconsistent with an object actually contained in the image, and an image in which the object actually contained in the image does not include a target object is considered in the training process of the image classification model, that is, in the training process of the image classification model, training is performed on negative sample data that are prone to errors, so that the misclassification rate of the image classification model can be reduced and the accuracy of the image classification model can be improved.
[0144] The deep learning model training method provided by the embodiment of the present invention is described below with a specific example.
[0145] In deep learning models, whether it is a detection model, a recognition model or a classification model, many problems will be encountered in practical applications.
[0146] First, a large number of diverse data sets are usually required for training. However, the reality is that it is usually difficult to obtain such demanding data sets in a short period of time. Even if it is possible to obtain them, the cost will be very high. Secondly, in actual situations, due to the serious false detection (false recognition, false classification), false detection (false recognition, false classification) can only be reduced by increasing its threshold, which also reduces the detection rate of the model.
[0147] In order to reduce false detection (false recognition, false classification) and improve model accuracy without incurring high costs, an embodiment of the present invention provides a "dynamic negative sample training method", which mainly includes: (1) generating a negative sample data set; (2) involving the negative sample data set in dynamic training.
[0148] (1) Negative sample dataset creation
[0149] Datasets are crucial to models. A good dataset should be able to better drive the model to learn better features and improve the generalization of the model. Traditionally, datasets are usually datasets with positive samples. For example, if a problem is found in a scenario, data is collected in this scenario, or similar data is obtained through other means, and finally the data is annotated and added to the original dataset for training.
[0150] The negative sample data set collected in the solution of the embodiment of the present invention is essentially different from the traditional collection data set. The preparation of the negative sample data set in the embodiment of the present invention includes:
[0151] 1. Collect data sets (some public data sets can be used). Different data sets can greatly enrich the diversity of data sets;
[0152] 2. Clean the collected data sets: Use the current optimal model to filter out the data that are prone to errors; then remove the data sets with positive samples (positive sample targets, that is, the target objects mentioned above) from these error-prone data sets, and finally retain the data that are prone to errors in the current model and have no positive samples.
[0153] Specifically, as in the above embodiment, the data in the data set are processed by a preset deep learning model to obtain a first processing object corresponding to the data. When the first processing object is inconsistent with the object actually contained in the data, the data is used as candidate data. When the objects actually contained in the candidate data include the target object, the candidate data is eliminated from the data set to obtain a negative sample data set.
[0154] The first processed object filtered out (the result obtained by processing the data in the data set by the preset deep learning model, indicating the object contained in the data processed by the preset deep learning model) is inconsistent with the objects actually contained in the data. This part of data can also be understood as error-prone data filtered out using the preset deep learning model.
[0155] If the object actually contained in the data includes the target object, the data can be understood as positive sample data. In the case where the first processing object is inconsistent with the object actually contained in the data, the data is used as candidate data, and if the object actually contained in the candidate data includes the target object, the candidate data is removed from the data set. It can also be understood that after using the preset deep learning model to screen out error-prone data, the positive sample data is removed from these error-prone data, so that the data obtained is error-prone data of the current model and has no positive samples.
[0156] By repeating the above operations in this way, we can continuously obtain a large number of diverse negative sample data sets.
[0157] Specifically as mentioned above Figure 2 The process of constructing a negative sample dataset in the illustrated embodiment.
[0158] Compared with the traditional data set preparation, the preparation of the negative sample data set provided by the embodiment of the present invention has the following main differences and advantages:
[0159] First, the negative sample data set constructed in the embodiment of the present invention is a data set without positive samples, as mentioned above Figure 2 In the illustrated embodiment, data including the target object is removed from objects actually contained in the data;
[0160] Secondly, compared with the related art which usually collects data sets with positive samples, the cost of collecting negative sample data sets in the embodiments of the present invention is much easier than collecting data sets with positive samples (no complex data annotation is required), and the richness of the data sets is also easier to meet;
[0161] In addition, a large number of negative sample datasets with richer diversity can further improve the performance and generalization ability of the model;
[0162] Again, the negative sample dataset is reusable (can be reused in multiple projects without the need for additional large annotation costs).
[0163] In the embodiments of the present invention, negative sample datasets can be collected quickly and at low cost, that is, a method for preparing negative sample datasets that can quickly improve model accuracy is provided.
[0164] (2) Dynamic Negative Sample Training
[0165] Use the negative sample data set obtained above to participate in training. The specific steps are as follows:
[0166] 1. Set the coefficient of the number of negative samples participating in the training: train_neg_r, the number of positive sample training data sets: train_nums, and the number of negative samples participating in the training is:
[0167] train_neg_nums=train_neg_r*train_nums
[0168] The value of train_neg_r is a floating point number greater than 0. The larger the value of train_neg_r, the lower the model false positive rate (false recognition rate, false classification rate), but the model detection rate will also gradually decrease. Usually, train_neg_r = 1.0 is a relatively appropriate parameter. The value of train_neg_r can be adjusted according to the actual situation for different tasks.
[0169] 2. Set the update frequency coefficient of the negative sample data participating in the training: dynamic_r. During the training process, the negative sample data participating in the training will be updated at intervals (usually several epochs);
[0170] The value range of dynamic_r is a positive integer greater than 0. The larger the value, the lower the update frequency of the negative sample data set participating in the training. For different tasks, the value of train_neg_r can be adjusted according to the actual situation.
[0171] 3. Dynamic negative sample training:
[0172] The negative sample data set participating in the training is updated at intervals according to the value of the parameter dynamic_r. The method for updating the negative sample data set for training is: mining (selecting) a certain number of negative sample data (the number of negative samples determined by the above method) from the negative sample data set and adding them to the positive samples for training together. There are two methods for mining (selecting) negative sample data sets: A and B:
[0173] A: Randomly select a certain number of negative samples from the negative sample data set to participate in the training, that is, the first strategy of selecting a preset number of negative sample data from the negative sample data set at every update interval in the above embodiment. The advantages of this strategy are: high efficiency and ensuring the diversity of the training data set.
[0174] B: Difficult negative sample mining: Use the model to select negative samples that are more prone to errors to participate in the next training. If the number of selected negative samples is less than train_neg_nums, copy the negative samples to the number of train_neg_nums according to the principle of priority copying according to difficulty. The purpose of this is to ensure that difficult negative samples are given a larger training weight, so that more difficult samples can be fitted in model training. This strategy B is the second strategy of selecting a preset number of negative sample data from the negative sample data set at every update interval in the above embodiment.
[0175] The dynamic negative sample training process can also be understood as the process of using the negative sample data set obtained above to improve the model accuracy. In the training process, you can first choose the above strategy A, which is efficient and ensures that the training data set has multiple samples, and then choose strategy B, which can better improve the model accuracy and model generalization.
[0176] In specific implementation, using plan A and plan B successively during the training process can achieve better results, and the order and proportion of plan A and plan B can be adjusted according to different needs.
[0177] Specifically, a certain number of negative sample data sets are mined (selected) from the negative sample data set and added to the positive samples for training together. That is, at every update interval, a preset number of negative sample data are selected from the negative sample data set. The selected negative sample data and positive sample data are both used as sample data. The process of training the preset deep learning model has been described in detail in the above embodiments and will not be repeated here.
[0178] The deep learning model training method provided by the embodiment of the present invention and other traditional solutions can be used in conjunction with each other in parallel.
[0179] In order to more intuitively understand the beneficial effects of the embodiments of the present invention, the deep learning model training method provided by the embodiments of the present invention is used on an open source target detection (yolox detection) model in the embodiments of the present invention, and the scheme is compared with the training method in the related art.
[0180] As shown in Table 1, the method provided by the embodiment of the present invention and the method in the related art are compared from the mean average precision (mAP) and mAP0.5 (the mAP calculated when the IOU (the overlap degree between the predicted box and the true box or the ratio of the intersection of the predicted box and the true box to the union of the predicted box and the true box) threshold is 0.5).
[0181] Table 1
[0182] plan mAP (unit: %) mAP0.5 (unit: %) Related technologies 51.72 74.53 The present invention 54.55 79.06
[0183] The embodiment of the present invention also provides the difference between the method provided in the embodiment of the present invention and the method in the related art in the mAP (change in mAP value during training) curve and the mAP0.5 (change in mAP0.5 value during training) curve on the validation data set.
[0184] like Figure 3 As shown, the comparison of the mAP curves of the method provided by the embodiment of the present invention and the method in the related art, the horizontal axis of the curve represents the number of training iterations (number of epochs), and the vertical axis represents the mAP value. Among them, curve 301 represents the curve corresponding to the method provided by the embodiment of the present invention; curve 302 represents the curve corresponding to the method in the related art.
[0185] like Figure 4 As shown, the comparison of the mAP0.5 value curves of the method provided by the embodiment of the present invention and the method in the related art, the horizontal axis of the curve represents the number of training iterations (number of epochs), and the vertical axis represents the mAP0.5 value. Among them, curve 401 represents the curve corresponding to the method provided by the embodiment of the present invention; curve 402 represents the curve corresponding to the method in the related art.
[0186] From Table 1 above, Figure 3 and Figure 4 The comparison results shown show that: during the entire training process, the curve corresponding to the method provided by the embodiment of the present invention is always above the curve corresponding to the method in the related art, that is, the mAP / mAP0.5 of the method provided by the embodiment of the present invention is always significantly higher than that of the related art solution. The solution provided by the embodiment of the present invention has a significant improvement in the accuracy index (mAP / mAP0.5) based on the yolox detection model, and is also significantly more advantageous during the entire training process.
[0187] The embodiment of the present invention also provides an actual evaluation scenario, using the same hardware device and the same processing software, and evaluating by the number of false detections in actual tests, the results of which are shown in Table 2 below:
[0188] Table 2
[0189] plan Number of false detections (unit: piece) Related technologies 32 The present invention 5
[0190] From the experimental data shown in Table 2 above, it can be found that the solution provided by the embodiment of the present invention is obviously more advantageous in reducing model misdetection.
[0191] Corresponding to the deep learning model training method provided in the above embodiment, the embodiment of the present invention also provides a deep learning model training device, such as Figure 5 As shown, including:
[0192] An acquisition module 501 is used to acquire an update frequency coefficient, where the update frequency coefficient is used to represent an update interval for updating negative sample data;
[0193] A selection module 502 is used to select negative sample data from a negative sample data set according to an update interval, wherein the negative sample data set includes data in which a first processing object screened out from at least one data set based on a preset deep learning model is inconsistent with an object actually included in the data, and the objects actually included in the data do not include a target object, and the first processing object is obtained by processing the data with the preset deep learning model;
[0194] The training module 503 is used to add the selected negative sample data as sample data to the training data set, and train the preset deep learning model based on the training data set.
[0195] Alternatively, if Figure 6 As shown, the device also includes:
[0196] A collection module 601, configured to collect at least one data set;
[0197] A negative sample data set construction module 602 is used to process the data in the data set through a preset deep learning model to obtain a first processing object corresponding to the data; when the first processing object is inconsistent with the object actually contained in the data, the data is used as candidate data, and when the objects actually contained in the candidate data include the target object, the candidate data is eliminated from the data set to obtain a negative sample data set.
[0198] Optionally, a negative sample data set module 602 is constructed, which is specifically used to process the data in the data set through a preset deep learning model, and obtain the confidence corresponding to the first processing object; if the first processing object is inconsistent with the object actually contained in the data, and the confidence corresponding to the first processing object exceeds the first confidence threshold, the data is used as candidate data.
[0199] Optionally, the selection module 502 is specifically configured to select a preset number of negative sample data from the negative sample data set at each update interval, where the preset number is determined based on a negative sample number coefficient and the number of positive sample data.
[0200] Optionally, the selection module 502 is specifically used to randomly select a preset number of negative sample data from the negative sample data set; and / or select negative sample data from the negative sample data set whose second processing object is inconsistent with the object actually contained in the data, and whose confidence corresponding to the second processing object exceeds a second confidence threshold.
[0201] Optionally, the selection module 502 is specifically used to process the negative sample data in the negative sample data set through the trained preset deep learning model to obtain a second processing object corresponding to the negative sample data and a confidence level corresponding to the second processing object, wherein the trained preset deep learning model includes a preset number of negative sample data and positive sample data randomly selected from the negative sample data set as sample data, and the model obtained by training the preset deep learning model; if the second processing object is inconsistent with the object actually contained in the negative sample data, and the confidence level corresponding to the second processing object exceeds the second confidence level threshold, the negative sample data is used as the selected negative sample data.
[0202] Optionally, the selection module 502 is specifically used to select the negative sample data that is inconsistent with the second processing object actually contained in the negative sample data and whose confidence corresponding to the second processing object exceeds a second confidence threshold in order from large to small if the number of selected negative sample data does not reach a preset number, until the number of selected negative sample data reaches a preset number.
[0203] Optionally, the preset deep learning model includes at least one of the following models: an image detection model, an image recognition model, an image classification model, at least one data set includes an image data set, and the data included in at least one data set is an image.
[0204] The embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, it includes a processor 701 , a communication interface 702 , a memory 703 and a communication bus 704 , wherein the processor 701 , the communication interface 702 , and the memory 703 communicate with each other via the communication bus 704 .
[0205] Memory 703, used for storing computer programs;
[0206] The processor 701 is used to implement the steps of the above-mentioned deep learning model training method when executing the program stored in the memory 703.
[0207] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0208] The communication interface is used for communication between the above electronic device and other devices.
[0209] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0210] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0211] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, which stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned deep learning model training methods are implemented.
[0212] In another embodiment provided by the present invention, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any of the deep learning model training methods in the above embodiments.
[0213] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0214] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0215] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, computer-readable storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0216] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A deep learning model training method, characterized in that: include: Acquire an update frequency coefficient, where the update frequency coefficient is used to represent an update interval for updating negative sample data; According to the update interval, negative sample data is selected from the negative sample data set, wherein the negative sample data set includes data in which a first processing object screened out from at least one data set based on a preset deep learning model is inconsistent with an object actually included in the data, and the objects actually included in the data do not include a target object, and the first processing object is obtained by processing the data with the preset deep learning model; The selected negative sample data is added as sample data to the training data set, and the preset deep learning model is trained based on the training data set.
2. The method according to claim 1, characterized in that Constructing the negative sample data set includes: Collect at least one dataset; Processing the data in the data set by using a preset deep learning model to obtain a first processing object corresponding to the data; When the first processing object is inconsistent with the object actually contained in the data, the data is used as candidate data, and when the objects actually contained in the candidate data include the target object, the candidate data is removed from the data set to obtain a negative sample data set.
3. The method according to claim 2, characterized in that The method further comprises: Processing the data in the data set by using a preset deep learning model, and obtaining a confidence level corresponding to the first processing object; In the case where the first processing object is inconsistent with the object actually included in the data, taking the data as candidate data includes: If the first processing object is inconsistent with the object actually contained in the data, and the confidence corresponding to the first processing object exceeds a first confidence threshold, the data is taken as candidate data.
4. The method according to claim 1, characterized in that: The selecting negative sample data from the negative sample data set according to the update interval includes: At each update interval, a preset number of negative sample data is selected from the negative sample data set, where the preset number is determined based on a negative sample number coefficient and the number of positive sample data.
5. The method according to claim 4, characterized in that The selecting negative sample data from the negative sample data set includes: Randomly select a preset number of negative sample data from the negative sample data set; and / or, A negative sample data set is selected in which a second processing object is inconsistent with an object actually contained in the data and a confidence level corresponding to the second processing object exceeds a second confidence level threshold.
6. The method according to claim 5, characterized in that The selecting of the second processing object from the negative sample data set is inconsistent with the object actually contained in the data, and the negative sample data whose confidence level corresponding to the second processing object exceeds a second confidence level threshold includes: The negative sample data in the negative sample data set is processed by a trained preset deep learning model to obtain a second processing object corresponding to the negative sample data and a confidence level corresponding to the second processing object, wherein the trained preset deep learning model includes a model obtained by training the preset deep learning model using a preset number of negative sample data and positive sample data randomly selected from the negative sample data set as sample data; If the second processing object is inconsistent with the object actually included in the negative sample data, and the confidence corresponding to the second processing object exceeds a second confidence threshold, the negative sample data is used as the selected negative sample data.
7. The method according to claim 6, characterized in that If the number of selected negative sample data does not reach the preset number, then in order of the confidence levels corresponding to the second processing objects from large to small, the negative sample data whose second processing objects are inconsistent with the objects actually included in the negative sample data and whose confidence levels corresponding to the second processing objects exceed the second confidence threshold are sequentially selected as negative sample data until the number of selected negative sample data reaches the preset number.
8. The method according to any one of claims 1 to 7, characterized in that: The preset deep learning model includes at least one of the following models: an image detection model, an image recognition model, and an image classification model. The at least one data set includes an image data set, and the data included in the at least one data set is an image.
9. A deep learning model training device, characterized in that: include: An acquisition module, used for acquiring an update frequency coefficient, where the update frequency coefficient is used for indicating an update interval for updating negative sample data; A selection module, configured to select negative sample data from a negative sample data set according to the update interval, wherein the negative sample data set includes data in which a first processing object screened out from at least one data set based on a preset deep learning model is inconsistent with an object actually included in the data, and the objects actually included in the data do not include a target object, and the first processing object is obtained by processing the data with the preset deep learning model; The training module is used to add the selected negative sample data as sample data to the training data set, and train the preset deep learning model based on the training data set.
10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 8 when executing a program stored in a memory.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 8 are implemented.
