Search

CN-116051904-B - Target detection model training method, device, computer equipment and medium

CN116051904BCN 116051904 BCN116051904 BCN 116051904BCN-116051904-B

Abstract

The invention discloses a target detection model training method, a device, computer equipment and a medium, and relates to the technical field of computers, wherein the method comprises the steps of dividing an image data set to be trained to obtain different model training sets; the method comprises the steps of determining the proportion value of a detection target in a model training set according to the labeling information of the model training set, calculating to obtain the confidence coefficient proportion and the confidence coefficient loss weight value of the target detection model according to the proportion value, and finishing the training of the target detection model.

Inventors

  • HAN GUODONG
  • SUN JUNLIANG
  • DONG BAOLEI
  • LI RONGKANG

Assignees

  • 济南博观智能科技有限公司

Dates

Publication Date
20260505
Application Date
20230215

Claims (7)

  1. 1. A method for training a target detection model, comprising: Dividing an image data set to be trained to obtain different model training sets; determining a proportion value of a detection target in the model training set according to the labeling information of the model training set; According to the proportion value, calculating to obtain a confidence coefficient proportion and a confidence coefficient loss weight value of a target detection model, and finishing training of the target detection model, wherein the confidence coefficient proportion is the confidence coefficient proportion of a feature map in the target detection model, the confidence coefficient loss weight value is the confidence coefficient loss weight value of a loss function in the target detection model, and the confidence coefficient loss is obtained by calculating the confidence coefficient proportion of the feature map in the target detection model; The determining the proportion value of the detection target in the model training set according to the labeling information of the model training set comprises the following steps: determining the category attribute of the detection target in the model training set according to the labeling information of the model training set; determining a proportion value of the number of the detection targets corresponding to the category attribute to the number of all the detection targets according to the category attribute; the determining the category attribute of the detection target in the model training set according to the labeling information of the model training set comprises the following steps: Determining the area of a detection target in the model training set according to the labeling information of the model training set; according to the areas, classifying each detection target to obtain the corresponding class attribute; And classifying each detection target according to the area to obtain the corresponding category attribute, wherein the category attribute comprises: determining a proportion value of the area of the detection target to the area of the image; Classifying each detection target according to the ratio value to obtain the corresponding class attribute; The calculation formula of the confidence loss weight value is as follows: ; Wherein, the For the confidence loss weight value, m is an initial value, t1, t2 and t3 are three training parameters, the proportion value of o1 is the confidence proportion of the small feature map, the proportion value of o2 is the confidence proportion of the medium feature map, and the proportion value of o3 is the confidence proportion of the large feature map.
  2. 2. The method for training a target detection model according to claim 1, wherein the calculating a confidence ratio and a confidence loss weight value of the target detection model according to the ratio value, and completing training the target detection model, comprises: Obtaining a confidence coefficient proportion and a confidence coefficient loss weight value for training the target detection model by using the model training set according to the proportion value; And counting the confidence coefficient proportion and the confidence coefficient loss weight value to obtain the confidence coefficient proportion and the confidence coefficient loss weight value of the target detection model, and completing training of the target detection model.
  3. 3. The method of claim 2, wherein said counting said confidence ratio and said confidence loss weight value to obtain said confidence ratio and confidence loss weight value for said target detection model, and completing said training of said target detection model, comprises: calculating all the confidence coefficient proportion and the confidence coefficient loss weight value to obtain the mean value and the variance of the confidence coefficient proportion and the confidence coefficient loss weight; And obtaining a confidence coefficient proportion and a confidence coefficient loss weight value for training the target detection model by using the image data set according to the mean value and the variance.
  4. 4. The method for training a target detection model according to claim 1, wherein the calculating obtains a confidence ratio and a confidence loss weight value of the target detection model, and the training of the target detection model is completed, further comprising: And counting the confidence coefficient proportion and the confidence coefficient loss weight value for training the target detection model by using the image data set by using an exponential moving average method to obtain the confidence coefficient proportion and the confidence coefficient loss weight value of the target detection model, and completing training of the target detection model.
  5. 5. An object detection model training device, characterized by comprising: the data set dividing module is used for dividing the image data set to be trained to obtain different model training sets; The proportion calculation module is used for determining a proportion value of a detection target in the model training set according to the labeling information of the model training set; The calculation module is used for calculating to obtain the confidence coefficient proportion of the target detection model and the confidence coefficient loss weight value according to the proportion value, and finishing the training of the target detection model, wherein the confidence coefficient proportion is the confidence coefficient proportion of the feature map in the target detection model; The proportion calculation module specifically comprises: The class unit is used for determining class attributes of detection targets in the model training set according to the labeling information of the model training set; a proportion calculating unit, configured to determine, according to the category attribute, a proportion value of the number of detection targets corresponding to the category attribute to the number of all detection targets; the category unit specifically comprises: The judging subunit is used for determining the area of the detection target in the model training set according to the labeling information of the model training set; The dividing subunit is used for classifying each detection target according to the area to obtain the corresponding category attribute; the dividing subunit is specifically configured to determine a ratio value of the area of the detection target to the area of the image, and perform category division on each detection target according to the ratio value to obtain the corresponding category attribute; The calculation formula of the confidence loss weight value is as follows: ; Wherein, the For the confidence loss weight value, m is an initial value, t1, t2 and t3 are three training parameters, the proportion value of o1 is the confidence proportion of the small feature map, the proportion value of o2 is the confidence proportion of the medium feature map, and the proportion value of o3 is the confidence proportion of the large feature map.
  6. 6. A computer device, comprising: A memory for storing a computer program; A processor for implementing the object detection model training method according to any one of claims 1 to 4 when executing the computer program.
  7. 7. A computer readable storage medium having stored therein computer executable instructions which when loaded and executed by a processor implement the steps of the object detection model training method according to any of claims 1 to 4.

Description

Target detection model training method, device, computer equipment and medium Technical Field The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for training a target detection model, a computer device, and a medium. Background Object detection is one of the most important research directions in the current computer vision field. The object detection is to determine the category and the position of the object of interest in the image, and the detection of small objects has become a research hot spot in the object detection due to the characteristics of low detection rate and high false detection rate. The existing detection method for the small target is that the size of position loss is automatically adjusted by changing a loss function, so that a target frame is returned more accurately, but uncertainty exists in the improvement of the detection precision of the small target in the mode, the precision can be improved, the precision can be reduced, and the small target cannot be detected accurately. And the other type of characteristic weighted fusion is adopted to extract the characteristics of a characteristic map by adopting different network structures, then the weighted fusion operation is carried out, the characteristics of a specific area can be enhanced by the weighted fusion characteristics, and richer target information is obtained, so that the detection and identification precision of small targets are improved, but the mode not only occupies more storage space, but also consumes performance, and the reasoning is influenced and time is consumed. In addition, in actual use, the method has large uncertainty, and is difficult to accurately perform feature weighted extraction on the target. Disclosure of Invention The invention aims to provide a training method, a device, computer equipment and a medium for a target detection model, wherein the method can calculate the confidence coefficient proportion and the confidence coefficient loss weight value of the target detection model according to the proportion value of the detection target, so that the confidence coefficient proportion and the confidence coefficient loss weight value are not fixed any more, the method can perform self-adjustment according to the proportion value of the detection target so as to improve the detection precision, increase the robustness and the detection accuracy of the model, and the method acts on a training stage, does not change any in the reasoning stage of the target detection model, and does not add extra burden to the reasoning of the target detection model. According to one aspect of the present invention, there is provided a target detection model training method including: Dividing an image data set to be trained to obtain different model training sets; determining a proportion value of a detection target in the model training set according to the labeling information of the model training set; And calculating the confidence coefficient proportion and the confidence coefficient loss weight value of the target detection model according to the proportion value, and finishing training of the target detection model. Optionally, the calculating, according to the ratio value, a confidence ratio and a confidence loss weight value of the target detection model, and completing training of the target detection model include: Obtaining a confidence coefficient proportion and a confidence coefficient loss weight value for training the target detection model by using the model training set according to the proportion value; And counting the confidence coefficient proportion and the confidence coefficient loss weight value to obtain the confidence coefficient proportion and the confidence coefficient loss weight value of the target detection model, and completing training of the target detection model. Optionally, the calculating the confidence ratio and the confidence loss weight value to obtain the confidence ratio and the confidence loss weight value of the target detection model, and completing training of the target detection model includes: calculating all the confidence coefficient proportion and the confidence coefficient loss weight value to obtain the mean value and the variance of the confidence coefficient proportion and the confidence coefficient loss weight; And obtaining a confidence coefficient proportion and a confidence coefficient loss weight value for training the target detection model by using the image data set according to the mean value and the variance. Optionally, the calculating the confidence ratio and the confidence loss weight value to obtain the calculated confidence ratio and the confidence loss weight value of the target detection model, and completing training of the target detection model, further includes: And counting the confidence coefficient proportion and the confidence coefficient loss weight value for training the targe