Search

CN-116740537-B - Training method, target detection device, medium and robot

CN116740537BCN 116740537 BCN116740537 BCN 116740537BCN-116740537-B

Abstract

The invention provides a training method, a target detection method, a device, a medium and a robot, wherein the training method of a target detection model comprises the steps of obtaining a training set, wherein the training set comprises a positive sample, a reference sample, a negative sample and a spliced sample obtained by splicing the positive sample, the reference sample and the negative sample; the method comprises the steps of obtaining a support set, training a preset detection model by adopting a positive sample, a reference sample and a negative sample to obtain a first training model, training the first training model by adopting a split sample to obtain a second training model, and training the second training model by adopting the support set to obtain a target detection model.

Inventors

  • KE RUI
  • ZHANG ZIYI
  • SHAN RUIJIE
  • CHE ZHENGPING
  • Li Mianjie

Assignees

  • 美的集团(上海)有限公司
  • 美的集团股份有限公司

Dates

Publication Date
20260508
Application Date
20230707

Claims (11)

  1. 1. A method of training a target detection model, comprising: acquiring a training set, wherein the training set comprises a positive sample, a reference sample, a negative sample and a spliced sample obtained by splicing the positive sample, the reference sample and the negative sample; Acquiring a support set; training a preset detection model by adopting the positive sample, the reference sample and the negative sample to obtain a first training model; training the first training model by adopting the split sample to obtain a second training model; Training the second training model by adopting the support set to obtain the target detection model; The acquiring the training set includes: obtaining a basic data set, wherein the basic data set comprises a first class data set, and the number of samples of each class in the first class data set is larger than or equal to a first numerical value; Determining, based on the first class data set, first and second images of the same item classification and a third image of a different item classification than the first image; taking one of the first image and the second image as the positive sample and the other as the reference sample, and the third image as the negative sample; The first image, the second image and the third image are spliced to obtain a spliced sample, and the spliced sample comprises the first image, the second image and the third image; the acquiring a support set includes: Obtaining a basic data set, wherein the basic data set comprises a second class data set, and the number of samples of each class in the second class data set is smaller than a first numerical value; the support set is determined from the second class of data sets.
  2. 2. The method for training the target detection model according to claim 1, wherein the preset detection model includes a feature extraction module and a target detection module, the training the preset detection model using the positive sample, the reference sample and the negative sample to obtain a first training model includes: the feature extraction module is used for carrying out feature extraction on the positive sample, the reference sample and the negative sample to obtain a corresponding first feature vector, a second feature vector and a third feature vector; determining a first feature distance between the first feature vector and the second feature vector; determining a second feature distance between the second feature vector and the third feature vector; and updating the super parameters of the target detection module based on the first characteristic distance and the second characteristic distance to obtain the first training model.
  3. 3. The method of claim 2, wherein the object detection module has a classifier function, the training the second training model with the support set to obtain the object detection model, comprising: carrying out feature extraction on the samples in the support set by adopting the feature extraction module to obtain a corresponding fourth feature vector; expressing the fourth feature vector and the hyper-parameters in the classifier function by cosine similarity; And updating the super parameter according to the fourth feature vector to obtain the target detection model.
  4. 4. The method of training a target detection model according to claim 2, wherein the feature extraction module comprises: the system comprises a coordinate coding information embedding module and a spatial convolution pooling pyramid structure, wherein an output interface of the coordinate coding information embedding module is connected with an input interface of the spatial convolution pooling pyramid structure.
  5. 5. The method for training the object detection model according to claim 1, wherein before training the second training model by using the support set to obtain the object detection model, further comprises: Editing the samples in the support set, and updating the support set based on the processing result; Wherein the editing process includes at least one of flipping, rotating, shifting, scaling, erasing, filling.
  6. 6. A method of detecting an object, comprising: Receiving an image to be detected; Inputting the image to be detected into the target detection model obtained by training the training method of the target detection model according to any one of claims 1 to 5 so as to obtain a detection result; And outputting the detection result.
  7. 7. A training device for a target detection model, comprising: the training set comprises a positive sample, a reference sample, a negative sample and a spliced sample obtained by splicing the positive sample, the reference sample and the negative sample; The acquisition unit is also used for acquiring a support set; The training unit is used for training a preset detection model by adopting the positive sample, the reference sample and the negative sample to obtain a first training model; The training unit is further used for training the first training model by adopting the split samples to obtain a second training model; the training unit is further used for training the second training model by adopting the support set to obtain the target detection model; The acquisition unit is further used for acquiring a basic data set, wherein the basic data set comprises a first type data set, the number of samples of each type in the first type data set is larger than or equal to a first numerical value, a first image and a second image which are the same in article classification and a third image which is different from the first image in article classification are determined based on the first type data set, one of the first image and the second image is taken as the positive sample, the other of the first image and the second image is taken as the reference sample, the third image is taken as the negative sample, and the split sample is obtained by splitting the first image, the second image and the third image, and the split sample comprises the first image, the second image and the third image; The acquisition unit is further configured to acquire a basic data set, where the basic data set includes a second class data set, and the number of samples of each class in the second class data set is smaller than a first value, and determine the support set according to the second class data set.
  8. 8. An object detection apparatus, comprising: A receiving unit for receiving an image to be detected; A processing unit, configured to input the image to be detected into the target detection model obtained by training the training method of the target detection model according to any one of claims 1 to 5, so as to obtain a detection result; And the output unit is used for outputting the detection result.
  9. 9. A training device for an object detection model, comprising a processor and a memory storing a program or instructions executable on the processor, which program or instructions when executed by the processor implement the steps of the method according to any of claims 1 to 5.
  10. 10. A readable storage medium, characterized in that it stores thereon a program or instructions, which when executed by a processor, implement the steps of the method according to any of claims 1 to 5.
  11. 11. A robot comprising a robot body, a robot body and a robot body, characterized by comprising the following steps: training apparatus for an object detection model according to claim 7 or 9, and/or The object detection device according to claim 8, and/or The readable storage medium of claim 10.

Description

Training method, target detection device, medium and robot Technical Field The invention relates to the technical field of image processing, in particular to a training method, a target detection device, a medium and a robot. Background Computer vision is an important field of artificial intelligence technology, and at present, a target detection model based on deep learning is a common method for solving a target detection task. However, the object detection model based on deep learning in the present stage has the problems that a large number of high-quality samples are difficult to obtain and the cost for labeling training samples is relatively high. Based on the defects, in the related technical scheme, a small sample detection technology is provided, the small sample detection technology at the present stage can only distinguish heterogeneous objects, and the model can be used for identifying a plurality of similar objects as one object seriously by mistake, so that the accuracy of target detection is affected. Disclosure of Invention The present invention aims to solve at least one of the technical problems existing in the prior art or related art. To this end, a first aspect of the present invention is to provide a training method of a target detection model. In a second aspect of the present invention, a target detection method is provided. In a third aspect of the present invention, a training apparatus for a target detection model is provided. A fourth aspect of the present invention is to provide an object detection apparatus. In a fifth aspect of the present invention, another training apparatus for a target detection model is provided. A sixth aspect of the present invention is to provide a readable storage medium. A seventh aspect of the present invention is to provide a robot. In view of this, according to a first aspect of the present invention, there is provided a training method for a target detection model, including obtaining a training set including a positive sample, a reference sample, a negative sample, and a split sample obtained by splitting the positive sample, the reference sample, and the negative sample, obtaining a support set, training a preset detection model using the positive sample, the reference sample, and the negative sample to obtain a first training model, training the first training model using the split sample to obtain a second training model, and training the second training model using the support set to obtain the target detection model. According to a second aspect of the present invention, there is provided a target detection method comprising receiving an image to be detected, inputting the image to be detected to a target detection model obtained by training the training method of the target detection model as in the first aspect to obtain a detection result, and outputting the detection result. According to a third aspect of the invention, the invention provides a training device for a target detection model, which comprises an acquisition unit, a training unit and a training unit, wherein the acquisition unit is used for acquiring a training set, the training set comprises a positive sample, a reference sample, a negative sample and a spliced sample obtained by splicing the positive sample, the reference sample and the negative sample, the acquisition unit is also used for acquiring a supporting set, the training unit is used for training a preset detection model by adopting the positive sample, the reference sample and the negative sample to obtain a first training model, the training unit is also used for training the first training model by adopting the spliced sample to obtain a second training model, and the training unit is also used for training the second training model by adopting the supporting set to obtain the target detection model. According to a fourth aspect of the present invention, there is provided an object detection apparatus including a receiving unit configured to receive an image to be detected, a processing unit configured to input the image to be detected to an object detection model obtained by training the object detection model according to the first aspect, so as to obtain a detection result, and an output unit configured to output the detection result. According to a fifth aspect of the present invention there is provided a training apparatus for a target detection model comprising a processor and a memory storing a program or instructions executable on the processor, the program or instructions when executed by the processor performing the steps of a method as described in any of the preceding claims. According to a sixth aspect of the present invention there is provided a readable storage medium having stored thereon a program or instructions which when executed by a processor performs the steps of the method as any one of the above. According to a seventh aspect of the present invention, a robot is provided comprising a t