Detection model training methods, devices, equipment and storage media

CN114463656BActive Publication Date: 2026-08-14BEIJING 360 INTELLIGENT TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-22
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]本发明的主要目的在于提供一种检测模型训练方法、装置、设备及存储介质,旨在解决现有技术中对海量训练样本进行人工标记费时费力,模型训练效率低的技术问题

Benefits of technology

[0025]在本发明中,通过预设图像检测模型对预设图像样本集进行识别,获得所述预设图像样本集中各图像样本对应的分值;根据预设标准值和所述分值对各图像样本进行筛选,获得目标图像样本;将所述目标图像样本作为待训练检测网络的输入样本,以对所述待训练检测网络进行训练,获得目标检测模型。在本发明中,通过预设图像检测模型对海量的图像样本进行筛选、标记;再选取识别结果中分值较高的图像样本作为待训练检测网络的输入样本,从而减少人工标记工作,节约人力,提高了模型训练效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114463656B_ABST
    Figure CN114463656B_ABST
Patent Text Reader

Abstract

This invention discloses a detection model training method, apparatus, device, and storage medium, relating to the field of target detection technology. The method includes: identifying a preset image sample set using a preset image detection model to obtain a score corresponding to each image sample in the preset image sample set; filtering each image sample according to a preset standard value and the score to obtain target image samples; and using the target image samples as input samples for training a detection network to obtain a target detection model. In this invention, a massive number of image samples are filtered and labeled using a preset image detection model; then, image samples with higher scores from the identification results are selected as input samples for training the detection network, thereby reducing manual labeling work, saving manpower, and improving model training efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology, and in particular to a detection model training method, apparatus, device, and storage medium. Background Technology

[0002] To improve the recognition accuracy of detection models, common approaches include increasing the number of parameters in the model itself (using a larger model to improve accuracy) or iterating the model repeatedly with a large number of training samples. On the other hand, to ensure real-time detection, the detection model usually needs to run on the front end, but due to limited front-end computing power, a large model cannot be used. To improve the front-end's detection accuracy, a large number of training samples are typically used to train the detection model. However, manually labeling massive amounts of training samples is time-consuming and labor-intensive, resulting in low model training efficiency.

[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main objective of this invention is to provide a detection model training method, apparatus, device, and storage medium, aiming to solve the technical problems of time-consuming and laborious manual labeling of massive training samples and low model training efficiency in the prior art.

[0005] To achieve the above objectives, the present invention provides a detection model training method, which includes the following steps: A preset image sample set is identified by a preset image detection model to obtain the score corresponding to each image sample in the preset image sample set; The image samples are filtered according to the preset standard value and the score to obtain the target image sample; The target image sample is used as the input sample for the detection network to be trained, so as to train the detection network and obtain the target detection model.

[0006] Optionally, the step of filtering each image sample according to a preset standard value and the score to obtain the target image sample includes: The score corresponding to each regression box in each image sample is determined based on the score; Determine whether the score corresponding to each regression box in each image sample is greater than or equal to the preset standard value; When a target regression box exists that is greater than or equal to the preset standard value, the image sample corresponding to the target regression box is taken as the target image sample.

[0007] Optionally, when a target regression box exists that is greater than or equal to the preset standard value, the image sample corresponding to the target regression box is used as the target image sample, which includes: When there is a target regression box that is greater than or equal to the preset standard value, the image sample corresponding to the target regression box is taken as the candidate image sample; Calculate the proportion of the target regression box in the regression box of the candidate image sample; Determine whether the percentage value is less than a preset percentage value; When the proportion value is less than the preset proportion value, the candidate image sample is used as the target image sample.

[0008] Optionally, after determining whether the percentage value is less than a preset percentage value, the method further includes: When the percentage value is greater than or equal to the preset percentage value, it is determined whether the score corresponding to each regression box in the candidate image sample is less than the first preset reference value, and the first preset reference value is greater than the preset standard value; When a reference regression box with a value smaller than the first preset reference value exists, the label information corresponding to the reference regression box in the candidate image sample is deleted to obtain the target image sample.

[0009] Optionally, the step of using the candidate image sample as the target image sample when the proportion value is less than the preset proportion value includes: When the proportion value is less than the preset proportion value, the number of target regression boxes in the candidate image samples is obtained; Determine whether the number of target regression boxes is greater than or equal to a preset number; When the number of target regression boxes is greater than or equal to the preset number, the label information corresponding to non-target regression boxes in the candidate image samples is deleted to obtain the target image samples.

[0010] Optionally, after determining whether the number of target regression boxes is greater than a preset number, the method further includes: When the number of target regression boxes is less than the preset number, it is determined whether the score corresponding to each regression box in the candidate image sample is less than the second preset reference value, and the second preset reference value is less than the preset standard value; When a reference regression box with a value smaller than the second preset reference value exists, the label information corresponding to the reference regression box in the candidate image sample is deleted to obtain the target image sample.

[0011] Optionally, before identifying the preset image sample set using a preset image detection model to obtain the score corresponding to each image sample in the preset image sample set, the method further includes: Obtain a pre-trained detection network and pre-trained image samples, wherein the number of parameters in the pre-trained detection network is greater than the number of parameters in the detection network to be trained; The pre-trained image samples are used as input samples to train the pre-trained detection network and obtain a preset image detection model.

[0012] Optionally, the step of using the target image sample as input sample to train the detection network to obtain the target detection model includes: A training image sample set is established based on the target image sample and the pre-training image sample; The image sample set to be trained is used as the input sample for the detection network to be trained, so as to train the detection network and obtain the target detection model.

[0013] Optionally, before identifying the preset image sample set using a preset image detection model to obtain the score corresponding to each image sample in the preset image sample set, the method further includes: Retrieve driving videos from a preset dashcam database; The driving video is image extracted according to a preset sampling time interval, and a preset image sample set is established based on the extracted driving images.

[0014] Optionally, the step of using the target image sample as input sample to train the detection network to obtain the target detection model includes: The target image sample is used as the input sample of the detection network to be trained, so that the detection network to be trained can identify the target image sample and obtain the identification result; Obtain the labeling information corresponding to the target image sample, and determine the error parameter based on the labeling information and the recognition result; The training parameters in the detection network to be trained are adjusted according to the error parameters to train the detection network and obtain the target detection model.

[0015] Optionally, before adjusting the training parameters in the detection network to be trained according to the error parameters to train the detection network and obtain the target detection model, the method further includes: The recognition accuracy of the detection network to be trained is determined based on the error parameters. Determine whether the recognition accuracy is greater than or equal to the preset accuracy; When the recognition accuracy is less than the preset accuracy, the step of adjusting the training parameters in the detection network to be trained according to the error parameters is performed to train the detection network to obtain the target detection model.

[0016] Optionally, after using the target image samples as input samples to train the detection network and obtain the target detection model, the method further includes: The vehicle image to be detected is acquired, and the vehicle image is detected by the target detection model to obtain vehicle driving parameters. The vehicle driving parameters are compared with preset thresholds, and an alarm is triggered when the vehicle driving parameters reach the preset thresholds.

[0017] Furthermore, to achieve the above objectives, the present invention also proposes a detection model training device, the detection model training device comprising: The pre-identification module is used to identify a preset image sample set through a preset image detection model and obtain the score corresponding to each image sample in the preset image sample set; The filtering module is used to filter each image sample according to a preset standard value and the score to obtain the target image sample; The training module is used to use the target image samples as input samples to train the detection network and obtain the target detection model.

[0018] Optionally, the filtering module is further configured to determine the score corresponding to each regression box in each image sample based on the score; The filtering module is also used to determine whether the score corresponding to each regression box in each image sample is greater than or equal to a preset standard value. The filtering module is further configured to use the image sample corresponding to the target regression box as the target image sample when there is a target regression box that is greater than or equal to the preset standard value.

[0019] Optionally, the filtering module is further configured to, when there is a target regression box that is greater than or equal to the preset standard value, use the image sample corresponding to the target regression box as a candidate image sample; The filtering module is also used to calculate the proportion of the target regression box in the regression box of the candidate image sample; The filtering module is also used to determine whether the percentage value is less than a preset percentage value; The filtering module is further configured to use the candidate image sample as the target image sample when the proportion value is less than the preset proportion value.

[0020] Optionally, the detection model training device further includes a pre-training module: The pre-training module is used to acquire a pre-trained detection network and pre-trained image samples, wherein the number of parameters of the pre-trained detection network is greater than the number of parameters of the detection network to be trained. The pre-training module is further configured to use the pre-trained image samples as input samples for the pre-trained detection network to train the pre-trained detection network and obtain a preset image detection model.

[0021] Optionally, the detection model training device further includes an image acquisition module: The image acquisition module is used to acquire driving videos from a preset dashcam database; The image acquisition module is also used to extract images from the driving video according to a preset sampling time interval, and to establish a preset image sample set based on the extracted driving images.

[0022] Optionally, the training module is further configured to establish a set of image samples to be trained based on the target image samples and the pre-trained image samples; The training module is further configured to use the image sample set to be trained as input samples for the detection network to be trained, so as to train the detection network to obtain the target detection model.

[0023] Furthermore, to achieve the above objectives, the present invention also proposes a detection model training device, which includes a memory, a processor, and a detection model training program stored in the memory and executable on the processor. The detection model training program is configured to implement the steps of the detection model training method described above.

[0024] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing a detection model training program, which, when executed by a processor, implements the steps of the detection model training method described above.

[0025] In this invention, a preset image detection model is used to identify a preset image sample set to obtain the score corresponding to each image sample in the preset image sample set; the image samples are then filtered according to a preset standard value and the scores to obtain target image samples; the target image samples are used as input samples for training a detection network to obtain a target detection model. In this invention, a preset image detection model is used to filter and label a massive number of image samples; then, image samples with higher scores from the recognition results are selected as input samples for training the detection network, thereby reducing manual labeling work, saving manpower, and improving model training efficiency. Attached Figure Description

[0026] Figure 1 This is a schematic diagram of the structure of the detection model training device for the hardware operating environment involved in the embodiments of the present invention; Figure 2This is a flowchart illustrating the first embodiment of the detection model training method of the present invention; Figure 3 This is a flowchart illustrating the second embodiment of the detection model training method of the present invention; Figure 4 This is a flowchart illustrating the third embodiment of the detection model training method of the present invention; Figure 5 This is a structural block diagram of the first embodiment of the detection model training device of the present invention.

[0027] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0028] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0029] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of the detection model training device for the hardware operating environment involved in the embodiments of the present invention.

[0030] like Figure 1 As shown, the detection model training device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen, and optionally, it may also include a standard wired interface or a wireless interface. In this invention, the wired interface of the user interface 1003 may be a USB interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed random access memory (RAM) or a non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.

[0031] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the detection model training device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0032] like Figure 1As shown, the memory 1005, which is identified as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a detection model training program.

[0033] exist Figure 1 In the detection model training device shown, the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; the user interface 1003 is mainly used to connect to the user equipment; the detection model training device calls the detection model training program stored in the memory 1005 through the processor 1001 and executes the detection model training method provided in the embodiment of the present invention.

[0034] Based on the above hardware structure, an embodiment of the detection model training method of the present invention is proposed.

[0035] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the detection model training method of the present invention, which presents the first embodiment of the detection model training method of the present invention.

[0036] In the first embodiment, the detection model training method includes the following steps: Step S10: Identify the preset image sample set using a preset image detection model to obtain the score corresponding to each image sample in the preset image sample set.

[0037] It should be understood that the execution subject of this embodiment is the detection model training device, which has functions such as image processing, data communication and program execution. The detection model training device can be a computer or server or other computer equipment. Of course, it can also be other devices with similar functions. This embodiment does not limit it.

[0038] It should be noted that the preset image sample set is usually on a high order of magnitude. For example, the preset image sample set may include 100,000 or 1 million images, which may include vehicle driving images, etc.

[0039] Understandably, for large sample sets, manual labeling is time-consuming and labor-intensive, thus reducing model training efficiency. Therefore, this embodiment uses a pre-set image detection model to identify the sample set and filters samples based on the identification results, thereby replacing the manual labeling process. The pre-set image detection model is a pre-trained image detection model with high recognition accuracy.

[0040] It should be noted that the score corresponding to each image sample can be considered as the confidence level for that image sample. When the preset image detection model identifies and classifies the features in each image sample, it also outputs the confidence level of the classification result. For example, the features in an image sample may include people, vehicles, or buildings. The preset image detection model's identification results for the image samples are: feature A has a 50% probability of belonging to a person, feature B has an 85% probability of belonging to a vehicle, and feature C has a 15% probability of belonging to a building. This probability can be used as the confidence level.

[0041] Step S20: Filter each image sample according to the preset standard value and score to obtain the target image sample.

[0042] It is understandable that model recognition results will have some errors compared to manual labeling. To ensure the accuracy of the selected target image samples, it is necessary to screen the image samples to avoid affecting the recognition accuracy and convergence speed of the detection network being trained.

[0043] In practical implementation, image samples with lower scores can be discarded, while those with higher scores can be retained. For example, if the preset standard value is 80%, then image samples with scores greater than or equal to 80% will be selected as target image samples. Of course, the above data is only an example, and specific values ​​can be set according to user needs; this implementation does not impose any limitations on this.

[0044] Step S30: Use the target image sample as the input sample of the detection network to be trained, so as to train the detection network and obtain the target detection model.

[0045] It should be noted that the target image samples retain the recognition results of the preset detection model, which include the classification results of features in the image samples. To ensure the accuracy of the detection network to be trained, the target image samples also have a high order of magnitude, such as 100,000 or 500,000 images.

[0046] Understandably, iterating through a large number of input samples to train the detection network can improve the accuracy of the object detection model. In practice, target image samples are used as input samples to the detection network to be trained, enabling the network to recognize the target image samples and obtain recognition results. The labeling information corresponding to the target image samples is then obtained, and error parameters are determined based on the labeling information and the recognition results. Finally, the training parameters in the detection network are adjusted according to the error parameters to train the network and obtain the object detection model.

[0047] It should be noted that the labeling information refers to the classification results of the preset image detection model on the features in the target image sample, and the classification results can be referred to the above. The detection network to be trained compares and analyzes its own classification results with the classification results of the preset image detection model to obtain error parameters, so as to adjust the training parameters in the detection network to be trained and perform iteration. The parameter adjustment method of the detection network is a mature technology, and will not be described in detail in this embodiment.

[0048] Understandably, during the iterative process of training the detection network, the recognition accuracy of the network continuously increases, and the convergence condition can be determined based on the recognition accuracy. Specifically, the recognition accuracy of the detection network to be trained is determined based on the error parameters; it is then determined whether the recognition accuracy is greater than or equal to a preset accuracy; if the recognition accuracy is less than the preset accuracy, the training parameters in the detection network to be trained are adjusted according to the error parameters to train the network and obtain the target detection model. The preset accuracy can be set to 85%, but the specific value can be set according to user needs, and this implementation does not impose any limitations on this.

[0049] In the first embodiment, a preset image sample set is identified using a preset image detection model to obtain the score corresponding to each image sample in the preset image sample set; the image samples are then filtered according to a preset standard value and the scores to obtain target image samples; the target image samples are used as input samples for training a detection network to obtain a target detection model. In this embodiment, a preset image detection model is used to filter and label a massive number of image samples; then, image samples with higher scores from the identification results are selected as input samples for training the detection network, thereby reducing manual labeling work, saving manpower, and improving model training efficiency.

[0050] Reference Figure 3 , Figure 3 This is a flowchart illustrating the second embodiment of the detection model training method of the present invention. Based on the first embodiment described above, a second embodiment of the detection model training method of the present invention is proposed.

[0051] In the second embodiment, step S20 includes: Step S201: Determine the score corresponding to each regression box in each image sample based on the score.

[0052] Understandably, when the preset detection model identifies each image sample, it usually labels each feature in the image sample with regression boxes, classifies the features, and outputs the confidence level of the classification result.

[0053] It should be noted that the score corresponding to the regression box can be the classification probability output by the regression box, while the score corresponding to the image sample can include the classification probability output by each regression box in the image sample. For example, in an image sample, feature A corresponds to regression box A, which outputs a probability of 50% for a person; feature B corresponds to regression box B, which outputs a probability of 85% for a car; and feature C corresponds to regression box C, which outputs a probability of 15% for a building.

[0054] Step S202: Determine whether the score corresponding to each regression box in each image sample is greater than or equal to the preset standard value.

[0055] It is understandable that model recognition results have some error compared to manual labeling. To ensure the accuracy of the selected target image samples, it is necessary to filter the image samples to avoid affecting the recognition accuracy and convergence speed of the detection network being trained. For example, image samples with lower scores can be removed, and image samples with higher scores can be retained. To improve the efficiency and reliability of the filtering results, when filtering the scores of image samples, the scores of each regression box in the image sample can be specifically filtered.

[0056] Step S203: When there is a target regression box that is greater than or equal to the preset standard value, the image sample corresponding to the target regression box is taken as the target image sample.

[0057] Understandably, a higher score for the regression box indicates higher accuracy in the feature classification result corresponding to that box, thus ensuring the reliability of the labeling information in the filtered target image samples. In practice, a preset standard value of 80% can be set. If the score of the regression box is greater than 80%, it indicates that the feature classification result corresponding to that box is highly reliable, and the image sample containing that feature can be used as the target image sample. Of course, the above data is only an example; specific values ​​can be set according to user needs, and this implementation does not impose any limitations on this.

[0058] It should be noted that the classification results of target image samples actually have a certain degree of uncertainty. Due to potential errors in the preset detection model itself, even if the image sample has a high score, there may still be bias. Therefore, to reduce random bias in image samples, the number of features in the image sample can be limited. Specifically, when there is a target regression box greater than or equal to a preset standard value, the image sample corresponding to the target regression box is used as a candidate image sample; the proportion of the target regression box in the regression box of the candidate image sample is calculated; it is determined whether the proportion is less than a preset proportion value; if the proportion is less than the preset proportion value, the candidate image sample is used as the target image sample. The proportion value can be set to 30% or 40%, and the specific value can be freely set according to user needs; this implementation does not impose any restrictions on this.

[0059] Understandably, the lower the proportion of the target regression box in the regression boxes of the candidate image samples, the more uniform the distribution of classification results in the candidate image samples, and the lower the risk of random bias. Conversely, the higher the proportion, the higher the risk of random bias, requiring further control. Specifically, when the proportion is greater than or equal to a preset proportion, it is determined whether the score corresponding to each regression box in the candidate image samples is less than a first preset reference value, which is greater than a preset standard value. If there is a reference regression box with a score less than the first preset reference value, the label information corresponding to the reference regression box in the candidate image samples is deleted to obtain the target image sample.

[0060] Understandably, increasing the decision score of the regression box can reduce the proportion of the target regression box in the regression boxes of the candidate image samples. For example, a preset standard value can be set to 80%. If the proportion of the target regression box in the candidate image samples is high, setting a first preset reference value of 90% can reduce the proportion of the target regression box. Simultaneously, when acquiring target image samples, it is necessary to delete the labeling information of unnecessary feature pairs to avoid interfering with subsequent training. The labeling information can be the classification result.

[0061] It should be noted that, when considering random bias in image samples, the utilization rate of the image samples should also be taken into account. Typically, an image sample contains multiple features; if fewer features are ultimately used, the utilization rate of the image sample is low. For example, if an image sample contains 10 features, but only one bounding box has a score greater than a preset standard value, its target bounding box accounts for only 10% of the total, indicating a low utilization rate for the image sample.

[0062] In this embodiment, if the number of target regression boxes in the image samples is small, the utilization rate of the image samples is improved by lowering the preset standard value to obtain more features. Specifically, when the proportion is less than the preset proportion value, the number of target regression boxes in the candidate image samples is obtained; it is determined whether the number of target regression boxes is greater than or equal to the preset number; when the number of target regression boxes is greater than or equal to the preset number, the label information corresponding to non-target regression boxes in the candidate image samples is deleted to obtain the target image samples.

[0063] It should be noted that, to ensure the utilization rate of image samples, a minimum number of features for each image sample can be set, such as a preset number of 3, or other values. If the number of target regression boxes in an image sample is greater than or equal to 3, it means that the utilization rate of the image sample has reached the predetermined standard. The label information of the unnecessary feature pairs can then be deleted to obtain the target image sample.

[0064] Understandably, if the number of target regression boxes in an image sample is less than 3, it indicates that the utilization rate of the image sample has not reached the predetermined standard, and the number of features needs to be increased. Specifically, when the number of target regression boxes is less than a preset number, it is determined whether the score corresponding to each regression box in the candidate image sample is less than a second preset reference value. If the second preset reference value is less than a preset standard value, and there is a reference regression box with a score less than the second preset reference value, the label information corresponding to the reference regression box in the candidate image sample is deleted to obtain the target image sample.

[0065] Understandably, reducing the decision score of the regression boxes can increase the number of target regression boxes in the candidate image samples. For example, a preset standard value can be set to 80%. If the number of target regression boxes in the candidate image samples is small, setting a second preset reference value to 70% can increase the number of target regression boxes in the candidate image samples. At the same time, the label information of unnecessary feature pairs is deleted to obtain the target image samples.

[0066] In the second embodiment, when screening each image sample, the scores of each feature box in the image sample are judged to select image samples with higher credibility as target image samples. At the same time, the random error and utilization rate of the image samples are considered when screening image samples, thereby ensuring the credibility of the image samples and improving the convergence speed of the detection network to be trained.

[0067] Reference Figure 4 , Figure 4 This is a flowchart illustrating the third embodiment of the detection model training method of the present invention. Based on the first and second embodiments described above, a third embodiment of the detection model training method of the present invention is proposed. This embodiment is described based on the first embodiment.

[0068] In the third embodiment, before step S10, the method further includes: Step S01: Obtain a pre-trained detection network and pre-trained image samples. The number of parameters in the pre-trained detection network is greater than the number of parameters in the detection network to be trained.

[0069] It should be noted that in this embodiment, the detection network to be trained is a small network applied to the front end. To improve the training efficiency of the detection network to be trained, a pre-trained detection network with a larger number of parameters can be used to train a preset image detection model, so that the preset image detection model has higher accuracy, thereby achieving knowledge transfer and improving the accuracy of the detection network to be trained. In specific implementation, the detection network to be trained can be a MobileNet-V2 network, and the pre-trained detection network can be a ResNet152 network.

[0070] Step S02: Use the pre-trained image samples as input samples for the pre-trained detection network to train the pre-trained detection network and obtain a preset image detection model.

[0071] Understandably, for detection networks with a large number of parameters, fewer samples can be used to achieve convergence during training. Therefore, the pre-training image samples can be manually labeled, and their order of magnitude can be set according to user needs, such as 5,000 or 10,000 images.

[0072] In this embodiment, to further improve the training speed and accuracy of the detection network to be trained, step S30 includes: Step S301: Establish a training image sample set based on the target image sample and the pre-training image sample.

[0073] Understandably, pre-training image samples are manually labeled, giving them higher reliability compared to target image samples. Therefore, target image samples and pre-training image samples can be merged to create a training image sample set, thereby improving the reliability of the samples.

[0074] Step S302: Use the image sample set to be trained as the input sample of the detection network to be trained, so as to train the detection network to obtain the target detection model.

[0075] It is understandable that object detection models trained on a large number of samples have high accuracy and can be used to implement image-based object detection functions. For example, when the image sample is a vehicle driving image, the object detection model has the function of recognizing objects such as vehicles, and can be used to implement driving detection functions. In specific implementation, driving videos from a preset driving recorder database are acquired; images are extracted from the driving videos according to a preset sampling time interval, and a preset image sample set is established based on the extracted driving images.

[0076] Understandably, the pre-set dashcam database stores videos taken by the vehicle during its journey, and the features involved in these videos are mostly vehicles, people, or buildings. Therefore, a pre-set image sample set constructed from dashcam videos is beneficial for improving the detection accuracy of vehicle detection models. Furthermore, objects in videos typically change slowly, so the features involved in two consecutive seconds may be the same. Therefore, a sampling time interval can be set when extracting images. The pre-set sampling time interval can be set to 5 seconds, meaning that one frame is extracted from the dashcam video every 5 seconds as an image sample to establish the pre-set image sample set.

[0077] It should be noted that vehicle detection can be used for vehicle collision warning by accurately predicting the position of vehicles ahead in the video frame, thereby precisely measuring the distance to vehicles ahead. To ensure real-time detection, vehicle detection needs to run at the front end; therefore, a large number of image samples are required to improve detection accuracy. Thus, using the aforementioned target detection model as the vehicle detection model can improve the accuracy of vehicle detection.

[0078] Understandably, after obtaining the vehicle detection model, the vehicle terminal can use this model to identify real-time driving footage, providing basic information for vehicle early warning. Specifically, an image of the vehicle to be detected is acquired, and the image is detected using the target detection model to obtain vehicle driving parameters; these parameters are compared with a preset threshold, and an alarm is triggered when the parameters reach the preset threshold.

[0079] It should be noted that vehicle driving parameters can include information such as vehicle type, vehicle speed, and distance to other vehicles. The vehicle terminal can also determine its own distance from the vehicle in front based on the vehicle driving parameters, predict the probability of collision based on its own vehicle speed, and issue an alarm when the probability of collision exceeds a threshold.

[0080] In the third embodiment, a preset image detection model is trained using a detection network with a large number of parameters to achieve knowledge transfer. Simultaneously, the training samples of the preset image detection model are also used as input samples for the detection network to be trained, which improves the training efficiency and accuracy of the network. Furthermore, using the obtained target detection model for vehicle detection ensures both the accuracy and speed of vehicle detection, thereby guaranteeing vehicle driving safety.

[0081] Furthermore, this embodiment of the invention also proposes a storage medium storing a detection model training program, which, when executed by a processor, implements the steps of the detection model training method described above.

[0082] Since this storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.

[0083] In addition, refer to Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the detection model training device of the present invention. To achieve the above objectives, the present invention also proposes a detection model training device.

[0084] In this embodiment, the detection model training device includes: The pre-identification module 10 is used to identify a preset image sample set through a preset image detection model and obtain the score corresponding to each image sample in the preset image sample set.

[0085] The filtering module 20 is used to filter each image sample according to the preset standard value and the score to obtain the target image sample.

[0086] The training module 30 is used to use the target image samples as input samples for the detection network to be trained, so as to train the detection network to obtain the target detection model.

[0087] In this embodiment, the pre-identification module identifies a preset image sample set using a preset image detection model to obtain the score corresponding to each image sample in the preset image sample set; the filtering module filters each image sample according to a preset standard value and the score to obtain target image samples; the training module uses the target image samples as input samples for training the detection network to obtain the target detection model. In this embodiment, a massive number of image samples are filtered and labeled using a preset image detection model; then, image samples with higher scores from the identification results are selected as input samples for training the detection network, thereby reducing manual labeling work, saving manpower, and improving model training efficiency.

[0088] In one embodiment, the screening module 20 is further configured to determine the score corresponding to each regression box in each image sample based on the score; determine whether the score corresponding to each regression box in each image sample is greater than or equal to a preset standard value; and when there is a target regression box that is greater than or equal to the preset standard value, use the image sample corresponding to the target regression box as the target image sample.

[0089] In one embodiment, the filtering module 20 is further configured to: when there is a target regression box that is greater than or equal to the preset standard value, use the image sample corresponding to the target regression box as a candidate image sample; calculate the proportion of the target regression box in the regression box of the candidate image sample; determine whether the proportion is less than a preset proportion value; and when the proportion is less than the preset proportion value, use the candidate image sample as the target image sample.

[0090] In one embodiment, the filtering module 20 is further configured to determine whether the score corresponding to each regression box in the candidate image sample is less than a first preset reference value when the percentage value is greater than or equal to the preset percentage value, wherein the first preset reference value is greater than the preset standard value; and when there is a reference regression box that is less than the first preset reference value, delete the label information corresponding to the reference regression box in the candidate image sample to obtain the target image sample.

[0091] In one embodiment, the filtering module 20 is further configured to: obtain the number of target regression boxes in the candidate image samples when the proportion value is less than the preset proportion value; determine whether the number of target regression boxes is greater than or equal to a preset number; and delete the label information corresponding to non-target regression boxes in the candidate image samples when the number of target regression boxes is greater than or equal to the preset number, thereby obtaining target image samples.

[0092] In one embodiment, the filtering module 20 is further configured to, when the number of target regression boxes is less than the preset number, determine whether the score corresponding to each regression box in the candidate image sample is less than a second preset reference value, wherein the second preset reference value is less than the preset standard value; and when there is a reference regression box that is less than the second preset reference value, delete the label information corresponding to the reference regression box in the candidate image sample to obtain the target image sample.

[0093] In one embodiment, the detection model training device further includes a pre-training module, which is used to acquire a pre-trained detection network and pre-trained image samples, wherein the number of parameters of the pre-trained detection network is greater than the number of parameters of the detection network to be trained; and uses the pre-trained image samples as input samples of the pre-trained detection network to train the pre-trained detection network and obtain a preset image detection model.

[0094] In one embodiment, the pre-training module is further configured to establish a set of image samples to be trained based on the target image samples and the pre-training image samples; and to use the set of image samples to be trained as input samples for the detection network to be trained, so as to train the detection network to obtain a target detection model.

[0095] In one embodiment, the detection model training device further includes an image acquisition module, which is used to acquire driving videos from a preset driving recorder database; extract images from the driving videos according to a preset sampling time interval; and establish a preset image sample set based on the extracted driving images.

[0096] In one embodiment, the training module 30 is further configured to use the target image sample as an input sample for the detection network to be trained, so that the detection network to be trained can identify the target image sample and obtain a recognition result; obtain the label information corresponding to the target image sample, and determine the error parameter according to the label information and the recognition result; adjust the training parameters in the detection network to be trained according to the error parameter, so as to train the detection network to be trained and obtain a target detection model.

[0097] In one embodiment, the training module 30 is further configured to determine the recognition accuracy of the detection network to be trained based on the error parameters; determine whether the recognition accuracy is greater than or equal to a preset accuracy; and when the recognition accuracy is less than the preset accuracy, execute the step of adjusting the training parameters in the detection network to be trained based on the error parameters to train the detection network to obtain a target detection model.

[0098] In one embodiment, the detection model training device further includes a detection module, which is used to acquire an image of a vehicle to be detected, and to detect the image of the vehicle to be detected using the target detection model to obtain vehicle driving parameters; compare the vehicle driving parameters with a preset threshold, and issue an alarm when the vehicle driving parameters reach the preset threshold.

[0099] Other embodiments or specific implementations of the detection model training device described in this invention can be found in the above-described method embodiments, and will not be repeated here.

[0100] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system 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 system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0101] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In the unit claims listing several devices, several of these devices may be embodied by the same hardware item. The use of the terms first, second, and third, etc., does not indicate any order and can be interpreted as names.

[0102] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0103] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for training a detection model, characterized in that, The method includes the following steps: A preset image sample set is identified by a preset image detection model to obtain the score corresponding to each image sample in the preset image sample set; The image samples are filtered according to the preset standard value and the score to obtain the target image sample; The target image sample is used as the input sample of the detection network to be trained, so as to train the detection network and obtain the target detection model. The step of filtering each image sample according to a preset standard value and the score to obtain the target image sample includes: The score corresponding to each regression box in each image sample is determined based on the score; Determine whether the score corresponding to each regression box in each image sample is greater than or equal to the preset standard value; When there is a target regression box that is greater than or equal to the preset standard value, the image sample corresponding to the target regression box is taken as the candidate image sample; Calculate the proportion of the target regression box in the regression box of the candidate image sample; Determine whether the percentage value is less than a preset percentage value; When the proportion value is less than the preset proportion value, the candidate image sample is used as the target image sample.

2. The detection model training method as described in claim 1, characterized in that, After determining whether the percentage value is less than a preset percentage value, the method further includes: When the percentage value is greater than or equal to the preset percentage value, it is determined whether the score corresponding to each regression box in the candidate image sample is less than the first preset reference value, and the first preset reference value is greater than the preset standard value; When a reference regression box with a value smaller than the first preset reference value exists, the label information corresponding to the reference regression box in the candidate image sample is deleted to obtain the target image sample.

3. The detection model training method as described in claim 1, characterized in that, The step of using the candidate image sample as the target image sample when the proportion value is less than the preset proportion value includes: When the proportion value is less than the preset proportion value, the number of target regression boxes in the candidate image samples is obtained; Determine whether the number of target regression boxes is greater than or equal to a preset number; When the number of target regression boxes is greater than or equal to the preset number, the label information corresponding to non-target regression boxes in the candidate image samples is deleted to obtain the target image samples.

4. The detection model training method as described in claim 3, characterized in that, After determining whether the number of target regression boxes is greater than a preset number, the method further includes: When the number of target regression boxes is less than the preset number, it is determined whether the score corresponding to each regression box in the candidate image sample is less than the second preset reference value, and the second preset reference value is less than the preset standard value; When a reference regression box with a value smaller than the second preset reference value exists, the label information corresponding to the reference regression box in the candidate image sample is deleted to obtain the target image sample.

5. The detection model training method according to any one of claims 1-4, characterized in that, Before the step of identifying the preset image sample set using a preset image detection model and obtaining the score corresponding to each image sample in the preset image sample set, the method further includes: Obtain a pre-trained detection network and pre-trained image samples, wherein the number of parameters in the pre-trained detection network is greater than the number of parameters in the detection network to be trained; The pre-trained image samples are used as input samples to train the pre-trained detection network and obtain a preset image detection model.

6. The detection model training method as described in claim 5, characterized in that, The step of using the target image samples as input samples to train the detection network and obtain the target detection model includes: A training image sample set is established based on the target image sample and the pre-training image sample; The image sample set to be trained is used as the input sample for the detection network to be trained, so as to train the detection network and obtain the target detection model.

7. The detection model training method as described in claim 1, characterized in that, Before the step of identifying the preset image sample set using a preset image detection model and obtaining the score corresponding to each image sample in the preset image sample set, the method further includes: Retrieve driving videos from a preset dashcam database; The driving video is image extracted according to a preset sampling time interval, and a preset image sample set is established based on the extracted driving images.

8. The detection model training method as described in claim 1, characterized in that, The step of using the target image samples as input samples to train the detection network and obtain the target detection model includes: The target image sample is used as the input sample of the detection network to be trained, so that the detection network to be trained can identify the target image sample and obtain the identification result; Obtain the labeling information corresponding to the target image sample, and determine the error parameter based on the labeling information and the recognition result; The training parameters in the detection network to be trained are adjusted according to the error parameters to train the detection network and obtain the target detection model.

9. The detection model training method as described in claim 8, characterized in that, Before adjusting the training parameters in the detection network according to the error parameters to train the detection network and obtain the target detection model, the method further includes: The recognition accuracy of the detection network to be trained is determined based on the error parameters. Determine whether the recognition accuracy is greater than or equal to the preset accuracy; When the recognition accuracy is less than the preset accuracy, the step of adjusting the training parameters in the detection network to be trained according to the error parameters is performed to train the detection network to obtain the target detection model.

10. The detection model training method as described in claim 1, characterized in that, After using the target image samples as input samples to train the detection network and obtain the target detection model, the method further includes: The vehicle image to be detected is acquired, and the vehicle image is detected by the target detection model to obtain vehicle driving parameters. The vehicle driving parameters are compared with preset thresholds, and an alarm is triggered when the vehicle driving parameters reach the preset thresholds.

11. A detection model training device, characterized in that, The detection model training device includes: The pre-identification module is used to identify a preset image sample set through a preset image detection model and obtain the score corresponding to each image sample in the preset image sample set; The filtering module is used to filter each image sample according to a preset standard value and the score to obtain the target image sample; The training module is used to use the target image samples as input samples for the detection network to be trained, so as to train the detection network to obtain the target detection model. The step of filtering each image sample according to a preset standard value and the score to obtain the target image sample includes: The score corresponding to each regression box in each image sample is determined based on the score; Determine whether the score corresponding to each regression box in each image sample is greater than or equal to the preset standard value; When there is a target regression box that is greater than or equal to the preset standard value, the image sample corresponding to the target regression box is taken as the candidate image sample; Calculate the proportion of the target regression box in the regression box of the candidate image sample; Determine whether the percentage value is less than a preset percentage value; When the proportion value is less than the preset proportion value, the candidate image sample is used as the target image sample.

12. The detection model training device as described in claim 11, characterized in that, The detection model training device also includes a pre-training module: The pre-training module is used to acquire a pre-trained detection network and pre-trained image samples, wherein the number of parameters of the pre-trained detection network is greater than the number of parameters of the detection network to be trained. The pre-training module is further configured to use the pre-trained image samples as input samples for the pre-trained detection network to train the pre-trained detection network and obtain a preset image detection model.

13. The detection model training device as described in claim 11, characterized in that, The detection model training device also includes an image acquisition module: The image acquisition module is used to acquire driving videos from a preset dashcam database; The image acquisition module is also used to extract images from the driving video according to a preset sampling time interval, and to establish a preset image sample set based on the extracted driving images.

14. The detection model training device as described in claim 13, characterized in that, The training module is also used to establish a training image sample set based on the target image sample and the pre-training image sample; The training module is further configured to use the image sample set to be trained as input samples for the detection network to be trained, so as to train the detection network to obtain the target detection model.

15. A detection model training device, characterized in that, The detection model training device includes: a memory, a processor, and a detection model training program stored in the memory and executable on the processor. When the detection model training program is executed by the processor, it implements the steps of the detection model training method as described in any one of claims 1 to 10.

16. A storage medium, characterized in that, The storage medium stores a detection model training program, which, when executed by a processor, implements the steps of the detection model training method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Model training method and device, computer equipment and storage medium

    CN111210024A