Method, device and system for automatically generating annotated data for saliency detection tasks
By combining the 3D model and the background image at different positions and angles, the rendering engine is used to generate prediction boxes and annotation boxes, and the annotation data for the saliency detection task is automatically generated, which solves the problem of time-consuming and labor-intensive manual annotation and improves the accuracy and accuracy of the model. Data acquisition efficiency.
Patent Information
- Application Number
- CN202111470119.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-12-03
AI Technical Summary
Existing saliency detection tasks mainly rely on manual annotation to obtain training data, which is time-consuming, laborious and expensive, causing the quantity and quality of data to become bottlenecks in the capabilities of deep learning models.
By combining the three-dimensional model and the background image at different positions and angles into the decision-making network model, the rendering engine is used to generate prediction boxes and annotation boxes, calculate the intersection ratio, record effective data pairs and update the decision-making network model to automatically generate a large number of significant features. Labeled data for sex detection tasks.
The generated data can be mixed with manually annotated data to improve the accuracy of the saliency detection model, and can be directly used to train the model without manual annotation, solving the bottleneck problem of data acquisition.
Smart Images

Figure CN114120000B
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of deep learning technology, and specifically to a method, device and system for automatically generating annotated data for a saliency detection task. Background Art
[0002] Saliency detection refers to the use of algorithms to extract salient areas in an image. Saliency detection tasks based on deep learning usually require a large amount of labeled data, but obtaining data is sometimes not easy. At present, the main method for obtaining training data for general saliency detection tasks is still manual labeling, which is time-consuming, labor-intensive and expensive. The quantity and quality of data have become bottlenecks that limit the capabilities of deep learning saliency detection models. Summary of the invention
[0003] To this end, the embodiments of the present invention provide a method, device and system for automatically generating annotated data for a saliency detection task, so as to solve the problem that the existing method for obtaining training data for a saliency detection task is mainly manual labeling, which is time-consuming, labor-intensive and expensive, and the quantity and quality of data have become bottlenecks that limit the capabilities of deep learning saliency detection models.
[0004] In order to achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0005] According to a first aspect of an embodiment of the present invention, a method for automatically generating annotated data for a saliency detection task is proposed, the method comprising:
[0006] Input I_T into the decision network model to obtain O_T, where I_T = [[0,1…N], [0,1…M], [0,1…X], [0,1…Y]] represents all combinations of N 3D models for saliency detection tasks, M background images, X 3D model placement positions in the background, and Y 3D model rotation angles, and O_T = (I,J,K,L) represents taking the I-th 3D model M[I], the J-th background B[J], the 3D model placed at the K-th position L[K], and the 3D model rotated by L angles R[L];
[0007] The obtained O_T is input into the saliency detection model, and the predicted box of the 3D model in the background is output;
[0008] The image determined by the acquired O_T is used to obtain a labeling box of the 3D model in the background for the saliency detection task according to the size and position of the 3D model through a 3D graphics image software with a rendering engine;
[0009] Calculate the intersection over union (IoU) ratio based on the predicted box and the labeled box of the obtained 3D model. If IoU>0.5, record O_T and I_T at this time as a set of data pairs.
[0010] When a preset number of O_T and I_T data pairs are obtained, the decision network model is trained using the obtained multiple data pairs so that the decision network model updates the gradient in the direction of generating more valid data;
[0011] After repeated training, a decision network model is obtained that can generate a large amount of effective labeled data for saliency detection tasks.
[0012] Furthermore, the method further comprises:
[0013] When the decision network model outputs a set of O_T, I_T is modified according to O_T, and the value of each corresponding position in I_T is changed to -1, indicating that this combination has been used and will not be reused.
[0014] Furthermore, the method further comprises:
[0015] After a training is completed, I_T is restored to its initial value, only the weights of the decision network model are retained, and then data are retrieved and trained again.
[0016] Furthermore, the decision network model includes any known or unknown model such as a multi-layer perceptron, a convolutional neural network, etc.
[0017] Furthermore, the saliency detection model includes any known or unknown model such as U2Net, BANet, etc.
[0018] Furthermore, the three-dimensional graphic image software includes Unreal, Blender, Unity, NUKE, etc.
[0019] Furthermore, the three-dimensional model used for the saliency detection task is sourced from manual modeling, 3D reconstruction of photos, or directly obtained from a third party, and the background is a pure color or a background picture of an actual business scene.
[0020] According to a second aspect of an embodiment of the present invention, a device for automatically generating annotated data for a saliency detection task is proposed, the device comprising:
[0021] The prediction box acquisition module is used to input I_T into the decision network model to obtain O_T, where I_T = [[0,1…N], [0,1…M], [0,1…X], [0,1…Y]] represents all combinations of N 3D models for saliency detection tasks, M background images, X 3D model placement positions in the background, and Y 3D model rotation angles, and O_T = (I, J, K, L) represents taking the I-th 3D model M[I], the J-th background B[J], the 3D model placed at the K-th position L[K], and the 3D model rotated by L angles R[L];
[0022] The obtained O_T is input into the saliency detection model, and the predicted box of the 3D model in the background is output;
[0023] A labeling frame acquisition module is used to obtain a labeling frame of a 3D model in the background for a saliency detection task according to the size and position of the 3D model through a 3D graphics image software with a rendering engine based on the image determined by the acquired O_T;
[0024] The decision network model training module is used to calculate the intersection over union (IoU) ratio based on the prediction box and annotation box of the obtained 3D model. If IoU>0.5, the O_T and I_T at this time are recorded as a set of data pairs.
[0025] When a preset number of O_T and I_T data pairs are obtained, the decision network model is trained using the obtained multiple data pairs so that the decision network model updates the gradient in the direction of generating more valid data;
[0026] After repeated training, a decision network model is obtained that can generate a large amount of effective labeled data for saliency detection tasks.
[0027] According to a third aspect of an embodiment of the present invention, a system for automatically generating annotated data for a saliency detection task is proposed, the system comprising: a processor and a memory;
[0028] The memory is used to store one or more program instructions;
[0029] The processor is used to run one or more program instructions to execute any of the methods described above.
[0030] According to a fourth aspect of an embodiment of the present invention, a computer storage medium is proposed, characterized in that the computer storage medium contains one or more program instructions, and the one or more program instructions are used to be executed by a system for automatically generating saliency detection task annotation data to perform the method described in any of the above items.
[0031] The embodiments of the present invention have the following advantages:
[0032] The embodiments of the present invention propose a method, device and system for automatically generating annotated data for a saliency detection task, which utilize a rendering engine to automatically generate annotated data that can be used for a saliency detection task. The data generated by this method can be mixed with manually annotated data to achieve data enhancement, thereby improving the accuracy of the saliency detection model. In the absence of manually annotated data, the data generated by this method can also be used to directly train the saliency detection model. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.
[0034] Figure 1 A schematic diagram of a flow chart of a method for automatically generating annotated data for a saliency detection task provided in Embodiment 1 of the present invention;
[0035] Figure 2 A flowchart of an implementation method for automatically generating annotated data for a saliency detection task provided in Embodiment 1 of the present invention;
[0036] Figure 3 For 3D models and solid color background images;
[0037] Figure 4 Background images for 3D models and actual business scenarios;
[0038] Figure 5 for Figure 3 Generate an image with annotated boxes;
[0039] Figure 6 for Figure 4 Generate an image with annotated boxes;
[0040] Figure 7 An image of a 3D model rotated at any angle in the background. DETAILED DESCRIPTION
[0041] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] Example 1
[0043] like Figure 1 and Figure 2 As shown, this embodiment proposes a method for automatically generating annotated data for a saliency detection task. Specifically, the method includes:
[0044] S100. Input I_T into the decision network model to obtain O_T, where I_T = [[0,1…N], [0,1…M], [0,1…X], [0,1…Y]] represents all combinations of N 3D models for saliency detection tasks, M background images, X 3D model placement positions in the background, and Y 3D model rotation angles, and O_T = (I, J, K, L) represents taking the I-th 3D model M[I], the J-th background B[J], the 3D model placed at the K-th position L[K], and the 3D model rotated at L angles R[L].
[0045] In this embodiment, the 3D model used for the saliency detection task is sourced from manual modeling, 3D reconstruction of photos, or directly obtained from a third party, and the background is a solid color or a background image of an actual business scene. Figure 3 and Figure 4 (Using a 3D scene to produce a 2D image is often called 3D rendering): Figure 3 It is a three-dimensional model and a solid color background. Figure 4 It is the background of 3D models and actual business scenes. Various 3D models and background pictures can be randomly combined in 3D graphics and image software.
[0046] In this embodiment, the 3D graphics software includes Unreal, Blender, Unity, NUKE, etc., either commercial or open source. In the 3D software, the annotation box for the saliency detection task can be directly obtained according to the model size and position. Figure 3 and Figure 4 Taking two pictures as an example, we can directly obtain such annotation data based on the model size and position, and get Figure 5 and Figure 6 .
[0047] The difficulty to be solved in this embodiment is how to effectively combine various 3D models and background images to improve the accuracy of the saliency detection model. Because the 3D model can be combined with any background, placed in any position, and rotated at any angle (for example, Figure 7 So if the data is randomly generated, it may not be useful for the final detection task.
[0048] Assume that there are N models M (1…N), M backgrounds B (1…M), each model has X positions to be placed (the value of X depends on the size of the background image, for example, if the background is a 320*320 image, then the maximum value of X is 320*320), the position is represented by L (1…X), each model has Y angles to rotate (the value of Y depends on the specific detection task scenario, if the object in the actual scenario may be at any angle in a certain direction, then Y is 360, if the actual object is only half exposed, then Y is 180, if the object can be rotated arbitrarily along the three axes of the world coordinate system, then Y is 360*3, and so on), and the angle is represented by R (1…Y). The total selectable variable space size T is T=N*M*X*Y, and this variable space represents all data combinations.
[0049] Input I_T into the decision network model to get the output O_T. O_T = (I, J, K, L) means taking the I-th model M[I], the J-th background B[J], placing the model at the K-th position L[K], and rotating the model by L angles R[L], so according to O_T, we will definitely get a picture.
[0050] In this embodiment, the decision network model includes any known or unknown model such as multi-layer perceptron MLP, convolutional neural network CNN, etc. The saliency detection model includes any known or unknown model such as U2Net, BANet, etc.
[0051] Furthermore, the method also includes: when the decision network model outputs a set of O_T, I_T is modified according to O_T, and the value of each corresponding position in I_T is changed to -1, indicating that the combination has been used and will not be reused.
[0052] S200, input the obtained O_T into the saliency detection model, and output the predicted box of the three-dimensional model in the background.
[0053] S300, obtaining a labeling box of a three-dimensional model in the background for a saliency detection task according to the size and position of the three-dimensional model from a picture determined by the acquired O_T through a three-dimensional graphic image software with a rendering engine.
[0054] S400, calculating the intersection over union (IoU) ratio according to the obtained prediction box and the annotation box of the 3D model, and if IoU>0.5, recording O_T and I_T at this time as a set of data pairs.
[0055] In 3D graphics and image software, the annotation box for saliency detection tasks can be directly obtained based on the model size and position. The output of the saliency detection model is the model's predicted box. These two boxes are used to calculate IoU, which is the intersection over union ratio, that is, the area ratio of the intersection and union of two boxes.
[0056] S500: When a preset number of data pairs of O_T and I_T are obtained, the decision network model is trained using the obtained multiple data pairs, so that the decision network model updates the gradient in the direction of generating more valid data.
[0057] If IOU>0.5, it means that the decision network model has generated useful data. Record O_T and I_T at this time as a set of data pairs. When 100 sets of such data pairs are collected, use these 100 sets of data to train the decision network model. This will make the decision network model update the gradient in the direction of generating more valid data.
[0058] Furthermore, the method further includes: after a training is completed, I_T is restored to the initial value, only the weight of the decision network model is retained, and then data is taken and trained again. After the training is completed, I_T is restored to the initial value, only the weight of the decision network model is retained, and the previous process is repeated.
[0059] S600: After repeated training for multiple times, a decision network model is obtained that can generate a large amount of effective labeled data for saliency detection tasks.
[0060] This embodiment proposes a method for automatically generating annotated data for a saliency detection task, which uses a rendering engine to automatically generate annotated data that can be used for a saliency detection task. The data generated by this method can be mixed with manually annotated data to achieve the purpose of data enhancement, thereby improving the accuracy of the saliency detection model. In the absence of manually annotated data, the data generated by this method can also be used to directly train the saliency detection model.
[0061] Example 2
[0062] Corresponding to the above-mentioned embodiment 1, this embodiment proposes a device for automatically generating annotated data for a saliency detection task, the device comprising:
[0063] The prediction box acquisition module is used to input I_T into the decision network model to obtain the output O_T, where I_T = [[0,1…N], [0,1…M], [0,1…X], [0,1…Y]] represents all combinations of N 3D models for saliency detection tasks, M background images, X 3D model placement positions in the background, and Y 3D model rotation angles, and O_T = (I, J, K, L) represents taking the I-th 3D model M[I], the J-th background B[J], the 3D model placed at the K-th position L[K], and the 3D model rotated by L angles R[L];
[0064] The obtained O_T is input into the saliency detection model, and the predicted box of the 3D model in the background is output;
[0065] A labeling frame acquisition module is used to obtain a labeling frame of a 3D model in the background for a saliency detection task according to the size and position of the 3D model through a 3D graphics image software with a rendering engine based on the image determined by the acquired O_T;
[0066] The decision network model training module is used to calculate the intersection over union (IoU) ratio based on the prediction box and annotation box of the obtained 3D model. If IoU>0.5, the O_T and I_T at this time are recorded as a set of data pairs.
[0067] When a preset number of O_T and I_T data pairs are obtained, the decision network model is trained using the obtained multiple data pairs so that the decision network model updates the gradient in the direction of generating more valid data;
[0068] After repeated training, a decision network model is obtained that can generate a large amount of effective labeled data for saliency detection tasks.
[0069] The functions performed by the various components in the apparatus for automatically generating annotated data for a saliency detection task provided by the embodiment of the present invention have been described in detail in the above embodiment 1, and therefore will not be described in detail here.
[0070] Example 3
[0071] Corresponding to the above embodiment, this embodiment proposes a system for automatically generating annotated data for a saliency detection task, the system comprising: a processor and a memory;
[0072] The memory is used to store one or more program instructions;
[0073] The processor is used to run one or more program instructions to execute the method of embodiment 1 above.
[0074] Example 4
[0075] Corresponding to the above embodiment, this embodiment proposes a computer storage medium, which contains one or more program instructions, and the one or more program instructions are used to be executed by a system for automatically generating saliency detection task annotation data such as the method in Example 1.
[0076] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.
Claims
1. A method for automatically generating annotated data for a saliency detection task, characterized in that: The method comprises: Input I_T into the decision network model to get the output O_T, where I_T=[[0,1…N],[0,1…M],[0,1…X],[0,1…Y]] represents all combinations of N 3D models for saliency detection tasks, M background images, X 3D model placement positions in the background, and Y 3D model rotation angles, and O_T=(I,J,K,L) represents taking the I-th 3D model M[I], the J-th background B[J], the 3D model placed at the K-th position L[K], and the 3D model rotated by L angles R[L]; The obtained O_T is input into the saliency detection model, and the predicted box of the 3D model in the background is output; The image determined by the acquired O_T is used to obtain a labeling box of the 3D model in the background for the saliency detection task according to the size and position of the 3D model through a 3D graphics image software with a rendering engine; Calculate the intersection over union (IoU) ratio based on the predicted box and the labeled box of the obtained 3D model. If IoU>0.5, record O_T and I_T at this time as a set of data pairs. When a preset number of O_T and I_T data pairs are obtained, the decision network model is trained using the obtained multiple data pairs so that the decision network model updates the gradient in the direction of generating more valid data; After repeated training, a decision network model is obtained that can generate a large amount of effective labeled data for saliency detection tasks.
2. The method for automatically generating annotated data for saliency detection tasks according to claim 1, characterized in that: The method further comprises: When the decision network model outputs a set of O_T, I_T is modified according to O_T, and the value of each corresponding position in I_T is changed to -1, indicating that this combination has been used and will not be reused.
3. The method for automatically generating annotated data for saliency detection tasks according to claim 2, characterized in that: The method further comprises: After a training is completed, I_T is restored to its initial value, only the weights of the decision network model are retained, and then data are retrieved and trained again.
4. The method for automatically generating annotated data for saliency detection tasks according to claim 1, characterized in that: The decision network model includes a multi-layer perceptron or a convolutional neural network.
5. The method for automatically generating annotated data for saliency detection tasks according to claim 1, characterized in that: The saliency detection model includes U2Net or BANet.
6. The method for automatically generating annotated data for saliency detection tasks according to claim 1, characterized in that: The three-dimensional graphic image software includes Unreal, Blender, Unity or NUKE.
7. The method for automatically generating annotated data for saliency detection tasks according to claim 1, characterized in that: The three-dimensional model used for the saliency detection task is sourced from manual modeling, 3D reconstruction of photos, or directly obtained from a third party, and the background is a solid color or a background picture of an actual business scene.
8. A device for automatically generating annotated data for a saliency detection task, characterized in that: The device comprises: The prediction box acquisition module is used to input I_T into the decision network model to obtain O_T, where I_T=[[0,1…N],[0,1…M],[0,1…X],[0,1…Y]] represents all combinations of N 3D models for saliency detection tasks, M background images, X 3D model placement positions in the background, and Y 3D model rotation angles, and O_T=(I,J,K,L) represents taking the I-th 3D model M[I], the J-th background B[J], the 3D model placed at the K-th position L[K], and the 3D model rotated by L angles R[L]; The obtained O_T is input into the saliency detection model, and the predicted box of the 3D model in the background is output; A labeling frame acquisition module is used to obtain a labeling frame of a 3D model in the background for a saliency detection task according to the size and position of the 3D model through a 3D graphics image software with a rendering engine based on the image determined by the acquired O_T; The decision network model training module is used to calculate the intersection over union (IoU) ratio based on the prediction box and annotation box of the obtained 3D model. If IoU>0.5, the O_T and I_T at this time are recorded as a set of data pairs. When a preset number of O_T and I_T data pairs are obtained, the decision network model is trained using the obtained multiple data pairs so that the decision network model updates the gradient in the direction of generating more valid data; After repeated training, a decision network model is obtained that can generate a large amount of effective labeled data for saliency detection tasks.
9. A system for automatically generating annotated data for saliency detection tasks, characterized in that: The system includes: a processor and a memory; The memory is used to store one or more program instructions; The processor is used to run one or more program instructions to execute the method according to any one of claims 1-7.
10. A computer storage medium, characterized in that: The computer storage medium includes one or more program instructions, and the one or more program instructions are used to be executed by a system for automatically generating saliency detection task annotation data to perform the method according to any one of claims 1 to 7.
