CN111784772B - Attitude estimation model training method and device based on domain randomization - Google Patents

Attitude estimation model training method and device based on domain randomization Download PDF

Info

Publication number
CN111784772B
CN111784772B CN202010633854.9A CN202010633854A CN111784772B CN 111784772 B CN111784772 B CN 111784772B CN 202010633854 A CN202010633854 A CN 202010633854A CN 111784772 B CN111784772 B CN 111784772B
Authority
CN
China
Prior art keywords
attitude
sample
training
estimation model
domain randomization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010633854.9A
Other languages
Chinese (zh)
Other versions
CN111784772A (en
Inventor
季向阳
李志刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
Original Assignee
Tsinghua University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tsinghua University filed Critical Tsinghua University
Priority to CN202010633854.9A priority Critical patent/CN111784772B/en
Publication of CN111784772A publication Critical patent/CN111784772A/en
Application granted granted Critical
Publication of CN111784772B publication Critical patent/CN111784772B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • G06T7/75Determining position or orientation of objects or cameras using feature-based methods involving models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The disclosure relates to a method and a device for training a posture estimation model based on domain randomization, wherein the method comprises the following steps: training a pose estimation model using the synthesized image with the pose tag; inputting a real sample into the trained model to obtain a first attitude value; respectively processing the real sample and the synthesized sample by using a determined target domain randomization mode to obtain a processed real sample and a processed combined sample; training the trained model by using the processed real sample and the first attitude value to obtain a corresponding first loss function, and training the trained model by using the processed synthetic sample and a second attitude label of a target object in the synthetic sample to obtain a corresponding second loss function; and correcting the model parameters according to the first loss function and the second loss function to obtain a corrected attitude estimation model. The obtained model has good effect of evaluating the posture of the target object in the real image, high accuracy and low training cost.

Description

Attitude estimation model training method and device based on domain randomization
Technical Field
The disclosure relates to the technical field of computer vision and machine vision, in particular to a method and a device for training a posture estimation model based on domain randomization.
Background
Object attitude estimation plays a crucial role in the fields of "robotic work", "autopilot", "augmented reality", and the like. Object pose estimation refers to accurately estimating pose information of a target object relative to a camera from a picture, and generally includes: 1) Rotation (three degrees of freedom), i.e. the rotational relationship of the camera coordinate system with respect to the target object coordinate system; 2) Translation (three degrees of freedom), i.e. translation information of the origin of the camera coordinate system with respect to the origin of the target object coordinate system. For rotation, the representation method includes a rotation matrix, an euler angle, a quaternion, and the like. For translation, it is usually represented by a translation vector in euclidean space.
In the related art, the existing object posture estimation method based on a single RGB picture depends on real training data with a posture label. However, the acquisition of pose labels of real training data is very complex and expensive, which greatly increases the use cost of the method. To solve this problem, in the related art, under the condition that the three-dimensional model of the object is known, the three-dimensional model of the object is rendered by using a renderer in different gestures, so that a large number of artificially synthesized pictures with gesture labels are obtained, then the model is trained by using the artificially synthesized pictures, or the artificially synthesized pictures are processed to be closer to the real pictures, then the model is trained according to the processed artificially synthesized pictures, so that the dependence on real training data is eliminated. However, in the model training mode, the trained model has poor estimation effect on the posture of the real image, and is difficult to meet the relevant use requirements.
Disclosure of Invention
In view of the above, the present disclosure provides a method and an apparatus for training a pose estimation model based on domain randomization, so as to solve the above technical problems.
According to an aspect of the present disclosure, there is provided a method for training a pose estimation model based on domain randomization, the method including:
training a posture estimation model by using a training sample and a first posture label corresponding to the training sample, wherein the posture estimation model is constructed according to a determined posture estimation method, and the training sample comprises: a plurality of first composite images, the first composite images being subjected to a domain randomization process;
inputting a real sample into a trained attitude estimation model to obtain a first attitude value of a target object in the real sample;
respectively processing the real sample and the synthesized sample by using a determined target domain randomization mode to obtain a processed real sample and a processed combined sample;
training the trained attitude estimation model by using the processed real sample and the first attitude value to obtain a corresponding first loss function, and training the trained attitude estimation model by using the processed synthetic sample and a second attitude label of a target object in the synthetic sample to obtain a corresponding second loss function;
correcting the model parameters of the trained attitude estimation model according to the first loss function and the second loss function to obtain a corrected attitude estimation model,
wherein the real sample comprises a plurality of first real images and the composite sample comprises a plurality of second composite images, the second composite images bearing the second pose tag.
In one possible implementation, the method further includes:
respectively processing the test samples by using a plurality of to-be-selected domain randomization modes to obtain processed test samples corresponding to each to-be-selected domain randomization mode;
inputting each processed test sample and the test sample into the trained attitude estimation model respectively to obtain a second attitude value of each processed test sample and a third attitude value of the test sample;
and comparing the third attitude value with a second attitude value corresponding to each processed test sample based on a third attitude label of the test sample, and selecting the target domain randomization mode from a plurality of domain randomization modes to be selected according to the comparison result.
In one possible implementation, comparing the third pose value with the second pose value corresponding to each processed test sample based on the third pose label of the test sample, and selecting the target domain randomization from a plurality of candidate domain randomization according to the comparison result, includes:
comparing the second attitude value and the third attitude value of each processed test sample based on the third attitude label of the test sample to obtain an attitude estimation difference value corresponding to each to-be-selected domain randomization mode;
and determining the to-be-selected domain randomization mode in which the corresponding attitude estimation difference value meets the selection condition among the multiple to-be-selected domain randomization modes as the target domain randomization mode.
In one possible implementation, the target domain randomization includes at least one of:
randomly changing the image background, randomly changing the image brightness, randomly changing the image contrast, adding noise, performing truncation processing, performing fuzzy processing, and randomly adding occlusion in the image.
In one possible implementation, the method further includes:
and inputting the image to be estimated into the corrected attitude estimation model to obtain the attitude value of the target object in the image to be estimated.
According to another aspect of the present disclosure, there is provided a pose estimation model training apparatus based on domain randomization, the apparatus including:
the first training module is used for training a posture estimation model by utilizing a training sample and a first posture label corresponding to the training sample, the posture estimation model is constructed according to a determined posture estimation method, and the training sample comprises: a plurality of first composite images, the first composite images being subjected to a domain randomization process;
the first label determining module is used for inputting a real sample into the trained attitude estimation model to obtain a first attitude value of a target object in the real sample;
the first sample processing module is used for respectively processing the real sample and the synthesized sample by utilizing a determined target domain randomization mode to obtain a processed real sample and a processed combined sample;
the loss function determining module is used for training the trained attitude estimation model by using the processed real sample and the first attitude value to obtain a corresponding first loss function, and training the trained attitude estimation model by using the processed synthetic sample and a second attitude label of a target object in the synthetic sample to obtain a corresponding second loss function;
a model modification module for modifying the model parameters of the trained attitude estimation model according to the first loss function and the second loss function to obtain a modified attitude estimation model,
wherein the real sample comprises a plurality of first real images and the composite sample comprises a plurality of second composite images, the second composite images bearing the second pose labels.
In one possible implementation, the apparatus further includes:
the second sample processing module is used for respectively processing the test samples by utilizing a plurality of to-be-selected domain randomization modes to obtain processed test samples corresponding to each to-be-selected domain randomization mode;
the second label determining module is used for respectively inputting each processed test sample and the test sample into the trained attitude estimation model to obtain a second attitude value of each processed test sample and a third attitude value of the test sample;
and the mode determining module is used for comparing the third attitude value with the second attitude value corresponding to each processed test sample based on the third attitude label of the test sample, and selecting the target domain randomization mode from a plurality of to-be-selected domain randomization modes according to the comparison result.
In a possible implementation manner, the manner determining module includes:
the difference value determining submodule is used for comparing the second attitude value and the third attitude value of each processed test sample based on a third attitude tag of the test sample to obtain an attitude estimation difference value corresponding to each to-be-selected domain randomization mode;
and the mode determining submodule determines the to-be-selected domain randomization mode in which the corresponding attitude estimation difference value meets the selection condition among the multiple to-be-selected domain randomization modes as the target domain randomization mode.
In one possible implementation, the target domain randomization includes at least one of:
randomly changing the image background, randomly changing the image brightness, randomly changing the image contrast, adding noise, performing truncation processing, performing fuzzy processing, and randomly adding occlusion in the image.
In one possible implementation, the apparatus further includes:
and the model using module is used for inputting the image to be estimated into the corrected attitude estimation model to obtain the attitude value of the target object in the image to be estimated.
According to another aspect of the present disclosure, there is provided a pose estimation model training apparatus based on domain randomization, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the above-described method of training a pose estimation model based on domain randomization.
According to another aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions, when executed by a processor, implement the above-mentioned method for training a domain-randomization-based pose estimation model.
The method and the device for training the attitude estimation model based on the domain randomization provided by the embodiment of the disclosure utilize the synthesized image and the corresponding attitude label to train the attitude estimation model, and the attitude estimation model is constructed according to the determined attitude estimation method; inputting the real sample into the trained attitude estimation model to obtain a first attitude value of a target object in the real sample; respectively processing the real sample and the synthesized sample by using the determined target domain randomization mode to obtain a processed real sample and a processed combined sample; training the trained attitude estimation model by using the processed real sample and the first attitude value to obtain a corresponding first loss function, and training the trained attitude estimation model by using the processed synthetic sample and a second attitude label of a target object in the synthetic sample to obtain a corresponding second loss function; and correcting the model parameters of the trained attitude estimation model according to the first loss function and the second loss function to obtain a corrected attitude estimation model. The determined corrected posture estimation model has good effect of posture estimation on the target object in the real image and high accuracy, and the training model is not required to be carried out based on the real image with the posture label, so that the model training cost is saved.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
FIG. 1 shows a flow diagram of a method for domain randomization-based pose estimation model training according to an embodiment of the present disclosure.
FIG. 2 shows a schematic diagram of a domain randomization-based pose estimation model back-propagation update, according to an embodiment of the present disclosure.
FIG. 3 shows a block diagram of a device for training a domain randomization-based pose estimation model according to an embodiment of the present disclosure.
FIG. 4 is a block diagram illustrating an apparatus 800 for domain randomization-based pose estimation model training, according to an exemplary embodiment.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
FIG. 1 shows a flow diagram of a method for domain randomization-based pose estimation model training in accordance with an embodiment of the present disclosure. As shown in fig. 1, the method includes steps S11 to S15.
In step S11, a training sample and a first pose label corresponding to the training sample are used to train a pose estimation model, where the pose estimation model is constructed according to a determined pose estimation method, and the training sample includes: a plurality of first composite images, the first composite images having been domain randomized, the first composite images bearing the first pose tag.
In this embodiment, domain Randomization (Domain Randomization) is a method for randomizing an image, and changes image features of the image without changing pose information of a target object in the image. The first composite image may be randomly processed using a variety of existing domain randomization techniques. The method can be used for determining a plurality of domain randomization ways "way 1, way 2 \8230;, way n" in advance, and setting the probabilities of processing any one first synthetic image by way 1, way 2 \8230; mn% respectively, so that for a certain first synthetic image, way 1, way 2 \8230;, way n is applied to the first synthetic image with its corresponding probability for domain randomization, for example, the first synthetic image a actually corresponds to a domain randomization process comprising: performing domain randomization by using a mode 1 and a mode 2; the domain randomization process for the first composite image b, which actually corresponds to the first composite image b, includes: the domain randomization process is performed using mode 1 and mode n. The skilled person can set the specific implementation manner of subjecting the first composite image to the domain randomization process as needed, which is not limited by the present disclosure.
In this embodiment, the posture estimation method may be a method for performing posture estimation on the target object in the image, and the posture estimation method may be selected according to actual needs, which is not limited by this disclosure. For example, the pose estimation method may be a method in which a training model predicts a pose value directly from a picture. Wherein, the representation method of the attitude value includes but is not limited to: 1) Rotation amount: rotation matrix, quaternion, rotation vector, euler angle, rotation amount interval, etc.; 2) Translation amount: translation vector, etc. The attitude estimation method can also be used for training a model to establish a Point-to-Point corresponding relationship between the two-dimensional image and the three-dimensional model of the target object, and then solving the attitude through a PnP (Passive-n-Point) algorithm.
In step S11, the pose estimation model may be trained according to the training sample and the first pose tag to obtain a trained pose estimation model, and the trained pose estimation model has a poor estimation effect on the pose of the target object in the image, and needs to be further trained through the subsequent steps S12 to S15, so as to improve the generalization capability of the model on the real image and improve the effect of the object pose in the model estimation diagram.
In step S12, a real sample is input into the trained attitude estimation model, and a first attitude value of the target object in the real sample is obtained. Wherein the real sample comprises a plurality of first real images.
In this embodiment, the selected first real image is not provided with the pose tag, so that the pose tag of the real image does not need to be obtained in advance before the model training, but the trained pose estimation model obtained in step S11 is used to obtain the first pose value of the first real image, thereby greatly saving the cost of training the model.
In this embodiment, the pose value (e.g., the first pose value, the second pose value, and the third pose value) and the pose tag (e.g., the first pose tag, the second pose tag, and the third pose tag) can each represent the pose of the target object in the image corresponding thereto. In the present disclosure, the two differ only in that the attitude values are obtained using the model of the present disclosure; the pose tag is obtained by acquiring real information representing the pose of the target object in the image in advance, not by using the model of the present disclosure.
In step S13, the real sample and the synthesized sample are processed by using the determined target domain randomization mode, so as to obtain a processed real sample and a processed combined sample. The composite sample includes a plurality of second composite images with the second pose labels. The second pose tag carried by the second composite image is determined during image composition.
In this embodiment, step S12 and step S13 may also be executed synchronously, or step S13 may be executed before step S12, which is not limited by this disclosure.
In this embodiment, the target domain randomization performed on the real samples and the merged samples may include at least one of the following: randomly changing the image background, randomly changing the image brightness, randomly changing the image contrast, adding noise, performing truncation processing (randomly cutting off a part of the region of a target object in the image), performing fuzzy processing, and randomly adding occlusion in the image. The target domain randomization for processing the real and synthetic samples may be one or more. And when the target domain randomization modes are multiple, processing the real sample and the synthesized sample respectively by utilizing each target domain randomization mode. In comparison, when the target domain randomization mode is multiple, the obtained corrected posture estimation model has a better effect and higher accuracy on the posture estimation of the target object in the image than when the target domain randomization mode is one.
In a possible implementation manner, before step S13, a required target domain randomization manner may be determined, which may include:
respectively processing the test sample by using a plurality of to-be-selected domain randomization modes to obtain a processed test sample corresponding to each to-be-selected domain randomization mode, where the test sample may include a plurality of second real images, and each second real image carries a third attitude tag;
inputting each processed test sample and the test sample into the trained attitude estimation model respectively to obtain a second attitude value of each processed test sample and a third attitude value of the test sample;
and comparing the third attitude value with the second attitude value corresponding to each processed test sample based on the third attitude tag of the test sample, and selecting the target domain randomization mode from a plurality of to-be-selected domain randomization modes according to the comparison result.
In this implementation, the test specimen may include a plurality of second real images and/or a plurality of third composite images, each image in each test specimen bearing a third pose tag. While for better pose estimation of the model to the real image, the test sample may only include a second plurality of real images. Each second real image carries a third pose tag. The comparison result may be an effect difference of the trained pose estimation model for performing pose estimation on the test sample and the processed test sample, for example, the accuracy, the error rate, the difference rate, and the like of the estimated pose value can identify the effect difference, which is not limited by the disclosure.
In one possible implementation, comparing the third pose value with the second pose value corresponding to each processed test sample based on the third pose label of the test sample, and selecting the target domain randomization from a plurality of candidate domain randomization according to the comparison result may include: comparing the second attitude value and the third attitude value of each processed test sample based on the third attitude tag of the test sample to obtain an attitude estimation quasi-difference value corresponding to each to-be-selected domain randomization mode; and determining the to-be-selected domain randomization mode in which the corresponding attitude estimation difference value meets the selection condition among the multiple to-be-selected domain randomization modes as the target domain randomization mode.
The attitude estimation difference value may be one or more of an estimation accuracy rate, an estimation error rate, and an estimation difference rate, which is not limited in this disclosure.
For example, assuming that the attitude estimation difference value is an estimation accuracy, the corresponding selection condition may be that a difference between the estimation accuracy corresponding to the second attitude value and the estimation accuracy corresponding to the third attitude value is greater than or equal to a specified threshold, and for example, the third attitude tag may be used as a reference to determine whether the second attitude value is accurate relative to the third attitude tag, so as to determine the estimation accuracy corresponding to the second attitude value. And judging whether the third attitude value is accurate relative to the third attitude tag by taking the third attitude tag as a reference, and further determining the estimation accuracy rate corresponding to the third attitude value.
Assuming that the pose estimation difference value is an estimation error rate, the corresponding selection condition may be that a difference between the estimation error rate corresponding to the second pose value and the estimation error rate corresponding to the third pose value is greater than or equal to a specified threshold. For example, whether the second attitude value is accurate relative to the third attitude tag may be determined based on the third attitude tag, so as to determine an estimation error rate corresponding to the second attitude value. And judging whether the third attitude value is accurate relative to the third attitude tag by taking the third attitude tag as a reference, and further determining the estimation error rate corresponding to the third attitude value.
Assuming that the pose estimated difference value is an estimated difference rate, the corresponding selection condition may be that the estimated difference rate is greater than or equal to a specified difference rate threshold. For example, the estimated difference rate may be determined (e.g., subtracted) based on a difference between the estimated accuracy corresponding to the third attitude value and the estimated accuracy corresponding to the second attitude value, and/or determined (e.g., subtracted) based on the estimated error rate corresponding to the third attitude value and the estimated error rate corresponding to the second attitude value.
In step S14, training the trained attitude estimation model by using the processed real sample and the first attitude value to obtain a corresponding first loss function; and training the trained attitude estimation model by using the processed synthetic sample and a second attitude label of the target object in the synthetic sample to obtain a corresponding second loss function.
In this embodiment, the first loss function and the second loss function may be calculated by using the same loss function calculation method, and the loss function may be a 0-1 loss function, an absolute value loss function, a square loss function, a logarithmic loss function, a cross entropy loss function, or the like, which is not limited by this disclosure.
In this embodiment, for the calculation of the first loss function, the first attitude value may be used as a true value, and the attitude value obtained by inputting the processed true sample into the trained attitude estimation model may be used as a predicted value, so as to calculate the first loss function. For the calculation of the second loss function, the second attitude tag can be used as a true value, and the attitude value obtained by inputting the processed synthetic sample into the trained attitude estimation model is used as a predicted value, so that the second loss function is calculated.
In step S15, the model parameters of the trained attitude estimation model are corrected according to the first loss function and the second loss function to obtain a corrected attitude estimation model,
in this embodiment, a target loss function for the trained pose estimation model may be determined according to the first loss function and the second loss function, and then the model parameters may be corrected according to the target loss function. For example, the target loss function is calculated in a weighted manner according to the weights corresponding to the first loss function and the second loss function, which is not limited by the present disclosure.
In this embodiment, fig. 2 is a schematic diagram illustrating a method for training a pose estimation model based on domain randomization according to an embodiment of the present disclosure, and as shown in fig. 2, the real sample and the synthesized sample are respectively processed by using a determined target domain randomization manner, so as to obtain a processed real sample and a processed combined sample; training the trained attitude estimation model by using the processed real sample and the first attitude value to obtain a corresponding first loss function, and training the trained attitude estimation model by using the processed synthetic sample and a second attitude label of a target object in the synthetic sample to obtain a corresponding second loss function; the first loss function and the second loss function can be used for calculating the gradient corresponding to each model parameter, and then the model parameters are updated according to the gradient, and the updated model is propagated reversely, so that the self-supervision training of the model is realized.
In this embodiment, the second synthetic image in the synthetic sample may be the first synthetic image in the training sample without the domain randomization process; alternatively, the first composite image in the training sample that has not been subjected to the domain randomization process may be a portion of the composite sample; alternatively, the synthetic sample and the training sample may be completely different. In addition, the number of images in the real sample and the merged sample used by the training model and the ratio of the two images can be set according to needs, which is not limited by the present disclosure.
In one possible implementation, the method may further include: and inputting the image to be estimated into the corrected attitude estimation model to obtain the attitude value of the target object in the image to be estimated. In this way, a more accurate attitude value may be obtained based on the corrected attitude estimation model.
According to the attitude estimation model training method based on domain randomization, the determined corrected attitude estimation model has the advantages that the effect of attitude evaluation on the target object in the real image is good, the accuracy is high, the training model does not need to be performed based on the real image with the attitude tag, and the cost of model training is saved.
FIG. 3 shows a block diagram of a pose estimation model training apparatus based on domain randomization according to an embodiment of the present disclosure. As shown in fig. 3, the apparatus includes: a first training module 51, a first label determination module 52, a first sample processing module 53, a loss function determination module 54 and a model modification module 55.
The first training module 51 trains a posture estimation model by using a training sample and a first posture label corresponding to the training sample, where the posture estimation model is constructed according to a determined posture estimation method, and the training sample includes: a plurality of first composite images, the first composite images being subjected to a domain randomization process.
The first label determining module 52 inputs the real sample into the trained posture estimation model, and obtains a first posture value of the target object in the real sample.
The first sample processing module 53 processes the real sample and the synthesized sample respectively by using the determined target domain randomization mode, so as to obtain a processed real sample and a processed combined sample.
And a loss function determining module 54, configured to train the trained pose estimation model by using the processed real sample and the first pose value to obtain a corresponding first loss function, and train the trained pose estimation model by using the processed synthetic sample and a second pose label of a target object in the synthetic sample to obtain a corresponding second loss function.
And a model modification module 55 configured to modify model parameters of the trained attitude estimation model according to the first loss function and the second loss function to obtain a modified attitude estimation model.
Wherein the real sample comprises a plurality of first real images and the composite sample comprises a plurality of second composite images, the second composite images bearing the second pose tag.
In one possible implementation, the apparatus further includes:
the second sample processing module is used for respectively processing the test samples by utilizing a plurality of to-be-selected domain randomization modes to obtain processed test samples corresponding to each to-be-selected domain randomization mode;
the second label determining module is used for respectively inputting each processed test sample and the test sample into the trained attitude estimation model to obtain a second attitude value of each processed test sample and a third attitude value of the test sample;
and the mode determining module is used for comparing the third attitude value with the second attitude value corresponding to each processed test sample based on the third attitude label of the test sample, and selecting the target domain randomization mode from a plurality of to-be-selected domain randomization modes according to the comparison result.
In a possible implementation manner, the manner determining module includes:
the difference value determining submodule is used for comparing the second attitude value and the third attitude value of each processed test sample based on a third attitude tag of the test sample to obtain an attitude estimation difference value corresponding to each to-be-selected domain randomization mode;
and the mode determining submodule determines the to-be-selected domain randomization mode in which the corresponding attitude estimation difference value meets the selection condition among the to-be-selected domain randomization modes as the target domain randomization mode.
In one possible implementation, the target domain randomization includes at least one of:
randomly changing the image background, randomly changing the image brightness, randomly changing the image contrast, increasing noise, performing truncation processing, performing fuzzy processing, and randomly adding shielding in the image.
In one possible implementation, the apparatus further includes:
and the model using module is used for inputting the image to be estimated into the corrected attitude estimation model to obtain the attitude value of the target object in the image to be estimated.
According to the attitude estimation model training device based on domain randomization provided by the embodiment of the disclosure, the determined corrected attitude estimation model has a good attitude estimation effect on the target object in the real image and high accuracy, and the training model is not required to be performed based on the real image with the attitude label, so that the cost of model training is saved.
It should be noted that, although the method and apparatus for training a pose estimation model based on domain randomization has been described above by taking an embodiment as an example, those skilled in the art will understand that the disclosure should not be limited thereto. In fact, the user can flexibly set each step and module according to personal preference and/or actual application scene, as long as the technical scheme of the present disclosure is met.
FIG. 4 is a block diagram illustrating an apparatus 800 for domain randomization-based pose estimation model training, according to an exemplary embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the apparatus 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 806 provide power to the various components of device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed status of the device 800, the relative positioning of components, such as a display and keypad of the device 800, the sensor assembly 814 may also detect a change in the position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration/deceleration of the device 800, and a change in the temperature of the device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi,2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the device 800 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as a punch card or an in-groove protruding structure with instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be interpreted as a transitory signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or an electrical signal transmitted through an electrical wire.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
Computer program instructions for carrying out operations of the present disclosure may be assembler instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (12)

1. A method for training a pose estimation model based on domain randomization, the method comprising:
training a posture estimation model by using a training sample and a first posture label corresponding to the training sample, wherein the posture estimation model is constructed according to a determined posture estimation method, and the training sample comprises the following components: a plurality of first composite images, the first composite images being subjected to a domain randomization process;
inputting a real sample into the trained attitude estimation model to obtain a first attitude value of a target object in the real sample;
respectively processing the real sample and the synthesized sample by using a determined target domain randomization mode to obtain a processed real sample and a processed combined sample;
training the trained attitude estimation model by using the processed real sample and the first attitude value to obtain a corresponding first loss function, and training the trained attitude estimation model by using the processed synthetic sample and a second attitude label of a target object in the synthetic sample to obtain a corresponding second loss function;
correcting the model parameters of the trained attitude estimation model according to the first loss function and the second loss function to obtain a corrected attitude estimation model,
wherein the real sample comprises a plurality of first real images and the composite sample comprises a plurality of second composite images, the second composite images bearing the second pose labels.
2. The method of claim 1, further comprising:
respectively processing the test samples by using a plurality of to-be-selected domain randomization modes to obtain processed test samples corresponding to each to-be-selected domain randomization mode;
inputting each processed test sample and the test sample into the trained attitude estimation model respectively to obtain a second attitude value of each processed test sample and a third attitude value of the test sample;
and comparing the third attitude value with the second attitude value corresponding to each processed test sample based on the third attitude tag of the test sample, and selecting the target domain randomization mode from a plurality of to-be-selected domain randomization modes according to the comparison result.
3. The method of claim 2, wherein comparing the third pose value with the second pose value corresponding to each of the processed test samples based on the third pose tag of the test sample, and wherein selecting the target domain randomization from a plurality of candidate domain randomization modes according to the comparison result comprises:
comparing the second attitude value and the third attitude value of each processed test sample based on the third attitude tag of the test sample to obtain an attitude estimation difference value corresponding to each to-be-selected domain randomization mode;
and determining the to-be-selected domain randomization mode in which the corresponding attitude estimation difference value meets the selection condition among the multiple to-be-selected domain randomization modes as the target domain randomization mode.
4. The method of claim 1, wherein the target domain randomization comprises at least one of:
randomly changing the image background, randomly changing the image brightness, randomly changing the image contrast, adding noise, performing truncation processing, performing fuzzy processing, and randomly adding occlusion in the image.
5. The method of claim 1, further comprising:
and inputting the image to be estimated into the corrected attitude estimation model to obtain the attitude value of the target object in the image to be estimated.
6. An apparatus for training a pose estimation model based on domain randomization, the apparatus comprising:
the first training module is used for training a posture estimation model by utilizing a training sample and a first posture label corresponding to the training sample, the posture estimation model is constructed according to a determined posture estimation method, and the training sample comprises: a plurality of first composite images, the first composite images being subjected to a domain randomization process;
the first label determining module is used for inputting a real sample into the trained attitude estimation model to obtain a first attitude value of a target object in the real sample;
the first sample processing module is used for respectively processing the real sample and the synthesized sample by utilizing a determined target domain randomization mode to obtain a processed real sample and a processed combined sample;
the loss function determining module is used for training the trained attitude estimation model by using the processed real sample and the first attitude value to obtain a corresponding first loss function, and training the trained attitude estimation model by using the processed synthetic sample and a second attitude label of a target object in the synthetic sample to obtain a corresponding second loss function;
a model modification module for modifying the model parameters of the trained attitude estimation model according to the first loss function and the second loss function to obtain a modified attitude estimation model,
wherein the real sample comprises a plurality of first real images and the composite sample comprises a plurality of second composite images, the second composite images bearing the second pose tag.
7. The apparatus of claim 6, further comprising:
the second sample processing module is used for respectively processing the test samples by utilizing a plurality of to-be-selected domain randomization modes to obtain processed test samples corresponding to each to-be-selected domain randomization mode;
the second label determining module is used for respectively inputting each processed test sample and the test sample into the trained attitude estimation model to obtain a second attitude value of each processed test sample and a third attitude value of the test sample;
and the mode determining module is used for comparing the third attitude value with the second attitude value corresponding to each processed test sample based on the third attitude label of the test sample, and selecting the target domain randomization mode from a plurality of to-be-selected domain randomization modes according to the comparison result.
8. The apparatus of claim 7, wherein the means for determining comprises:
the difference value determining submodule is used for comparing the second attitude value and the third attitude value of each processed test sample based on a third attitude tag of the test sample to obtain an attitude estimation difference value corresponding to each to-be-selected domain randomization mode;
and the mode determining submodule determines the to-be-selected domain randomization mode in which the corresponding attitude estimation difference value meets the selection condition among the to-be-selected domain randomization modes as the target domain randomization mode.
9. The apparatus of claim 6, wherein the target domain randomization comprises at least one of:
randomly changing the image background, randomly changing the image brightness, randomly changing the image contrast, adding noise, performing truncation processing, performing fuzzy processing, and randomly adding occlusion in the image.
10. The apparatus of claim 6, further comprising:
and the model using module is used for inputting the image to be estimated into the corrected attitude estimation model to obtain the attitude value of the target object in the image to be estimated.
11. An attitude estimation model training device based on domain randomization, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the method of any one of claims 1 to 5.
12. A non-transitory computer readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the method of any of claims 1 to 5.
CN202010633854.9A 2020-07-02 2020-07-02 Attitude estimation model training method and device based on domain randomization Active CN111784772B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010633854.9A CN111784772B (en) 2020-07-02 2020-07-02 Attitude estimation model training method and device based on domain randomization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010633854.9A CN111784772B (en) 2020-07-02 2020-07-02 Attitude estimation model training method and device based on domain randomization

Publications (2)

Publication Number Publication Date
CN111784772A CN111784772A (en) 2020-10-16
CN111784772B true CN111784772B (en) 2022-12-02

Family

ID=72758761

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010633854.9A Active CN111784772B (en) 2020-07-02 2020-07-02 Attitude estimation model training method and device based on domain randomization

Country Status (1)

Country Link
CN (1) CN111784772B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117746381A (en) * 2023-12-12 2024-03-22 北京迁移科技有限公司 Pose estimation model configuration method and pose estimation method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109215080A (en) * 2018-09-25 2019-01-15 清华大学 6D Attitude estimation network training method and device based on deep learning Iterative matching
CN109816725A (en) * 2019-01-17 2019-05-28 哈工大机器人(合肥)国际创新研究院 A kind of monocular camera object pose estimation method and device based on deep learning
CN109934196A (en) * 2019-03-21 2019-06-25 厦门美图之家科技有限公司 Human face posture parameter evaluation method, apparatus, electronic equipment and readable storage medium storing program for executing
CN110503689A (en) * 2019-08-30 2019-11-26 清华大学 Attitude prediction method, model training method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109215080A (en) * 2018-09-25 2019-01-15 清华大学 6D Attitude estimation network training method and device based on deep learning Iterative matching
CN109816725A (en) * 2019-01-17 2019-05-28 哈工大机器人(合肥)国际创新研究院 A kind of monocular camera object pose estimation method and device based on deep learning
CN109934196A (en) * 2019-03-21 2019-06-25 厦门美图之家科技有限公司 Human face posture parameter evaluation method, apparatus, electronic equipment and readable storage medium storing program for executing
CN110503689A (en) * 2019-08-30 2019-11-26 清华大学 Attitude prediction method, model training method and device

Also Published As

Publication number Publication date
CN111784772A (en) 2020-10-16

Similar Documents

Publication Publication Date Title
CN110647834B (en) Human face and human hand correlation detection method and device, electronic equipment and storage medium
CN109522910B (en) Key point detection method and device, electronic equipment and storage medium
CN110287874B (en) Target tracking method and device, electronic equipment and storage medium
CN107692997B (en) Heart rate detection method and device
CN110503689B (en) Pose prediction method, model training method and model training device
CN111540000B (en) Scene depth and camera motion prediction method and device, electronic device and medium
CN111462238B (en) Attitude estimation optimization method and device and storage medium
CN110633755A (en) Network training method, image processing method and device and electronic equipment
CN109145970B (en) Image-based question and answer processing method and device, electronic equipment and storage medium
CN112465843A (en) Image segmentation method and device, electronic equipment and storage medium
CN113139471A (en) Target detection method and device, electronic equipment and storage medium
CN111640114B (en) Image processing method and device
CN108174269B (en) Visual audio playing method and device
CN113065591A (en) Target detection method and device, electronic equipment and storage medium
CN111860373A (en) Target detection method and device, electronic equipment and storage medium
CN107886515B (en) Image segmentation method and device using optical flow field
CN111784772B (en) Attitude estimation model training method and device based on domain randomization
CN111311588B (en) Repositioning method and device, electronic equipment and storage medium
CN109635926B (en) Attention feature acquisition method and device for neural network and storage medium
CN111784773A (en) Image processing method and device and neural network training method and device
CN110333903B (en) Method and device for determining page loading duration
CN110121115B (en) Method and device for determining wonderful video clip
CN115512116A (en) Image segmentation model optimization method and device, electronic equipment and readable storage medium
CN113052874B (en) Target tracking method and device, electronic equipment and storage medium
CN112381223A (en) Neural network training and image processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant