Learning data generation method, program therefor, and device therefor
The learning data generation method automates the annotation process by using geometrically varied pseudo images and optical flow to generate labels, addressing the need for manual effort in existing machine learning methods.
Patent Information
- Application Number
- JP2023060655
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-04-04
- Publication Date
- 2024-10-17
- Estimated Expiration
- 2043-04-04
AI Technical Summary
Existing machine learning methods, such as those using generative adversarial networks, still require significant manual annotation efforts for generating training data, even when a small dataset is used.
A learning data generation method that utilizes a first model to generate pseudo images with geometric changes, employing multiple second models to create varied pseudo images, calculates the amount of change, and generates labels automatically, reducing the need for manual annotation.
This method significantly reduces the manual effort required for annotating training data by generating labels automatically, enhancing the accuracy of the generated labels through complementary change data and optical flow representation.
Smart Images

Figure 2024147914000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a training data generation method, a training data generation program, and a training data generation device for generating a training data set used for machine learning a machine learning model for detecting an object. [Background technology]
[0002] In recent years, machine learning has been researched and developed, and is being applied to various fields. This machine learning requires a relatively large amount of training data to carry out the machine learning. In particular, in supervised machine learning, the training data needs to be provided with the teacher, that is, the training data (teacher label, label) indicating whether the training data is correct or not. For this reason, it is necessary to generate the training data for each training data (annotation), which results in a large amount of labor. For this reason, there is a demand for reducing the labor, and there is a technology disclosed in Non-Patent Document 1, for example.
[0003] The machine learning method disclosed in Non-Patent Document 1 uses a Generative Adversarial Network (GAN) to learn not the correspondence between pixels of a pair of images, but the correspondence between domains in two image datasets of different domains. This machine learning method uses a cyclic structure of transformation and inverse transformation to learn two image datasets, so that machine learning can be performed without preparing a large amount of image datasets as a learning dataset. [Prior art documents] [Non-patent literature]
[0004] [Non-Patent Document 1] LanIan Liu, et al. “Generative Modeling for SmallData Object Detection”, [online], retrieved January 28, 2020, https: / / arxiv.org / pdf / 1910.017169.pdf Summary of the Invention [Problem to be solved by the invention]
[0005] The machine learning method disclosed in the above-mentioned non-patent document 1 does not require a large amount of image data set as a training data set, but this is not to say that it is unnecessary; a small amount of training data set is necessary, and annotations corresponding to this are required.
[0006] The present invention has been made in consideration of the above-mentioned circumstances, and its object is to provide a training data generation method, a training data generation program, and a training data generation device that can further reduce the amount of manual annotation work. [Means for solving the problem]
[0007] As a result of various investigations, the inventors of the present invention have found that the above object can be achieved by the present invention described below. That is, a training data generating method according to one aspect of the present invention includes a first step of generating a plurality of second models in which a first model for generating a first pseudo image based on a first image including a predetermined object is provided with a function for geometrically changing the object, the plurality of second models being generated in different ways of changing the first pseudo image from the first image by the first model, a second step of generating a plurality of second pseudo images from the first pseudo image by each of the plurality of second models, a fourth step of calculating, for each of the plurality of second pseudo images, an amount of change between the second pseudo image and the first pseudo image, and generating a label of the first pseudo image based on the amount of change calculated for each of the plurality of second pseudo images, a fifth step of generating training data by associating the first pseudo image with the label, and a sixth step of generating a plurality of training data as a training dataset by repeating the second to fifth steps a plurality of times.
[0008] This type of training data generation method uses a second model generated based on a first model, and can generate labels for the first pseudo image generated by the first model, eliminating the need for annotation and further reducing the amount of manual annotation work required.
[0009] In another aspect, in the above-mentioned training data generation method, the fourth step includes a 41 step of generating change amount data for each of the plurality of second pseudo images by calculating the amount of change between the second pseudo image and the first pseudo image, a 42 step of generating complementary change amount data for each of the change amount data calculated in the 41 step for each of the plurality of second pseudo images by complementing missing change amount data, and a 43 step of generating the label based on the complementary change amount data generated in the 42 step for each of the change amount data.
[0010] This method of generating training data compensates for missing change amount data, and therefore can generate labels with higher accuracy.
[0011] In another aspect, in the above-mentioned training data generation method, the first model is STYLEGAN or STYLEGAN2, and the method further includes a seventh step, prior to the first step, of machine learning the first model by using a training dataset for the first model that includes a plurality of first images and class labels corresponding to each of the plurality of first images.
[0012] Such a training data generation method can generate the first model by machine learning.
[0013] In another aspect, in the above-mentioned training data generation methods, the manner of change includes at least two of a first manner of change that changes the position of the object in a left-right direction, a second manner of change that changes the position of the object in a up-down direction, a third manner of change that changes the position of the object in a diagonal direction, and a fourth manner of change that either enlarges or reduces the object, and the first step generates at least two second models by implementing the at least two of the first and second manners.
[0014] This makes it possible to provide a learning data generating method including at least two of the first to third change patterns.
[0015] In another aspect, in the above-mentioned training data generating method, the amount of change between the first pseudo image and the second pseudo image is represented by optical flow.
[0016] This makes it possible to provide a learning data generating method in which the amount of change between the first pseudo image and the second pseudo image is represented by optical flow.
[0017] According to another aspect of the present invention, there is provided a training data generation program for causing a computer to execute the following steps: a first step of generating a first pseudo image based on a first image including a predetermined object, and a second model having a function of geometrically changing the object, the second step of generating a first pseudo image from the first image using the first model; a third step of generating a plurality of second pseudo images from the first pseudo image using each of the plurality of second models; a fourth step of calculating an amount of change between the second pseudo image and the first pseudo image for each of the plurality of second pseudo images, and generating a label for the first pseudo image based on the amount of change calculated for each of the plurality of second pseudo images; a fifth step of generating training data by associating the first pseudo image with the label; and a sixth step of generating a plurality of training data as a training dataset by repeating the second to fifth steps a plurality of times.
[0018] Such a learning data generation program can use a second model generated based on a first model to generate a label for the first pseudo image generated by the first model, thereby eliminating the need for annotation and further reducing the amount of work required for manual annotation.
[0019] A training data generation device according to another aspect of the present invention includes a second model generation unit that generates a first pseudo image based on a first image including a predetermined object, and generates a plurality of second models by adding a function of geometrically changing the object, the second model generation unit generating a plurality of second models by varying the manner of the change, a first pseudo image generation unit that executes a first pseudo image generation process to generate a first pseudo image from the first image by the first model, a second pseudo image generation unit that executes a second pseudo image generation process to generate a plurality of second pseudo images from the first pseudo image by each of the plurality of second models, and a second pseudo image generation unit that generates a second pseudo image for each of the plurality of second pseudo images. and the first pseudo image, and executes a label generation process to generate a label for the first pseudo image based on the amount of change calculated for each of the plurality of second pseudo images; a training data generation unit executes a training data generation process to generate training data by associating the first pseudo image with the label; and a training dataset generation unit generates a plurality of training data as a training dataset by repeating the first pseudo image generation process, the second pseudo image generation process, the label generation process, and the training data generation process a plurality of times.
[0020] Such a training data generation device can use a second model generated based on a first model to generate a label for a first pseudo image generated by the first model, thereby eliminating the need for annotation and further reducing the amount of work required for manual annotation. Effect of the Invention
[0021] The training data generation method, training data generation program, and training data generation device according to the present invention can further reduce the amount of manual annotation work. [Brief description of the drawings]
[0022] [Figure 1] 1 is a block diagram showing a configuration of a training data generating device according to an embodiment. [Diagram 2] FIG. 11 is a diagram illustrating second learning data as an example. [Diagram 3] FIG. 2 shows a first pseudo image as an example. [Figure 4] FIG. 1 is a diagram showing an optical flow as an example. [Diagram 5] 1A and 1B are diagrams showing, as an example, a change amount map that visualizes the amount of change and its complementary change amount map. [Figure 6] FIG. 2 shows, as an example, a first pseudo image and its heat map. [Figure 7] 4 is a flowchart showing an operation of the training data generating device. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0023] Hereinafter, one or more embodiments of the present invention will be described with reference to the drawings. However, the scope of the invention is not limited to the disclosed embodiments. In addition, configurations with the same reference numerals in each drawing are the same configurations, and their description will be omitted as appropriate. In this specification, when referring to a general term, a reference numeral without a subscript is used, and when referring to an individual configuration, a reference numeral with a subscript is used.
[0024] The training data generating device in the embodiment is a device that generates a training data set including a plurality of supervised training data for machine learning a machine learning model that detects a predetermined object. The training data generating device includes a second model generating unit, a first pseudo image generating unit, a second pseudo image generating unit, a label generating unit, a training data generating unit, and a training data set generating unit. The second model generating unit generates a plurality of second models in which a function of geometrically changing a first model that generates a first pseudo image based on a first image including a predetermined object is imparted with a function of geometrically changing the object, with the manner of the change being different. The first pseudo image generating unit executes a first pseudo image generating process that generates a first pseudo image from the first image by the first model. The second pseudo image generating unit executes a second pseudo image generating process that generates a plurality of second pseudo images from the first pseudo image by each of the plurality of second models. The label generation unit executes a label generation process for calculating, for each of the second pseudo images, an amount of change between the second pseudo image and the first pseudo image, and generating a label for the first pseudo image based on the amount of change calculated for each of the second pseudo images. The training data generation unit executes a training data generation process for generating training data by associating the first pseudo image with the label. The training data set generation unit generates a plurality of training data as a training data set by repeating the first pseudo image generation process, the second pseudo image generation process, the label generation process, and the training data generation process a plurality of times. Hereinafter, such a training data generation device and a training data generation method and a training data generation program implemented therein will be described in more detail.
[0025] FIG. 1 is a block diagram showing a configuration of a learning data generating device in an embodiment. FIG. 2 is a diagram showing second learning data as an example. FIG. 2A and FIG. 2B show learning data for left-right position change, FIG. 2C and FIG. 2D show learning data for up-down position change, FIG. 2E and FIG. 2F show learning data for diagonal position change, and FIG. 2G and FIG. 2H show learning data for enlargement / reduction change. FIG. 3 is a diagram showing a first pseudo image as an example. Four first pseudo images different from each other are shown in FIG. 3. FIG. 4 is a diagram showing optical flows as an example. FIG. 4A shows optical flows in the case of left-right position change, FIG. 4B shows optical flows in the case of up-down position change, FIG. 4C shows optical flows in the case of diagonal position change, and FIG. 4D shows optical flows in the case of enlargement / reduction change. FIG. 5 is a diagram showing a change amount map visualizing the change amount and its complementary change amount map as an example. FIG. 5A shows a change amount map in the case of a left-right position change, and FIG. 5B shows a complementary change amount map obtained by complementing the change amount map shown in FIG. 5A. FIG. 5C shows a change amount map in the case of a top-bottom position change, and FIG. 5D shows a complementary change amount map obtained by complementing the change amount map shown in FIG. 5C. FIG. 5E shows a change amount map in the case of a diagonal position change, and FIG. 5F shows a complementary change amount map obtained by complementing the change amount map shown in FIG. 5E. FIG. 5G shows a change amount map in the case of a zoom change, and FIG. 5H shows the change amount map shown in FIG. 5G. In addition, in the case of a zoom change, no complementation is performed. FIG. 6 shows a first pseudo image and its heat map as an example. FIG. 6A shows the first pseudo image, and FIG. 6B shows its heat map.
[0026] A learning data generating device S in the embodiment includes a control processing unit 1, an input unit 2, an output unit 3, an interface unit (IF unit) 4, and a storage unit 5, as shown in FIG.
[0027] The input unit 2 is connected to the control processing unit 1 and is a device that inputs various commands, such as a command to start generating learning data, and various data required for operating the learning data generation device S, such as a learning data set for a first model and a learning data set for a second model, to the learning data generation device S, and is, for example, a plurality of input switches to which predetermined functions are assigned, a keyboard, a mouse, etc. The output unit 3 is connected to the control processing unit 1 and is a device that outputs commands and data input from the input unit 2 and the learning data generated by the learning data generation device S under the control of the control processing unit 1, and is, for example, a display device such as a CRT display, an LCD (liquid crystal display device), or an organic EL display, or a printing device such as a printer.
[0028] The input unit 2 and the output unit 3 may be configured as a touch panel. In the case of configuring this touch panel, the input unit 2 is a position input device that detects and inputs an operation position, for example, a resistive film type or a capacitive type, and the output unit 3 is a display device. In this touch panel, a position input device is provided on the display surface of the display device, and one or more input content candidates that can be input to the display device are displayed. When a user touches a display position that displays the input content that the user wants to input, the position is detected by the position input device, and the display content displayed at the detected position is input to the learning data generation device S as the user's operation input content. In such a touch panel, the user can easily intuitively understand the input operation, and therefore a learning data generation device S that is easy for the user to handle is provided.
[0029] The IF unit 4 is connected to the control processing unit 1 and is a circuit that inputs and outputs data to and from, for example, an external device under the control of the control processing unit 1, and is, for example, an interface circuit of RS-232C, which is a serial communication method, an interface circuit using the Bluetooth (registered trademark) standard, an interface circuit using the USB standard, etc. The IF unit 4 may also be, for example, a communication interface circuit that transmits and receives communication signals to and from an external device, such as a data communication card or a communication interface circuit conforming to the IEEE802.11 standard, etc.
[0030] The storage unit 5 is connected to the control processing unit 1, and is a circuit that stores various predetermined programs and various predetermined data under the control of the control processing unit 1.
[0031] The various predetermined programs include, for example, a control processing program, and the control processing program includes, for example, a control program, a first model generation program, a second model generation program, a first pseudo image generation program, a second pseudo image generation program, a label generation program, a learning data generation program, and a learning data set generation program. The control program controls each of the units 2 to 5 of the learning data generation device S according to the function of each unit. The first model generation program is a program for machine learning a first model that generates a first pseudo image based on a first image including a predetermined object by using a first model learning data set including a plurality of first images and class labels corresponding to each of the plurality of first images. The second model generation program is a program for generating a plurality of second models by imparting a function of geometrically changing the object to the first model, with the change being different. The first pseudo image generation program is a program for executing a first pseudo image generation process that generates a first pseudo image from a first image by the first model. The second pseudo image generation program is a program for executing a second pseudo image generation process that generates a plurality of second pseudo images from the first pseudo image using each of the plurality of second models. The label generation program is a program for executing a label generation process that calculates an amount of change between the second pseudo image and the first pseudo image for each of the plurality of second pseudo images, and generates a label for the first pseudo image based on each amount of change calculated for each of the plurality of second pseudo images. The training data generation program is a program for executing a training data generation process that generates training data by associating the first pseudo image with the label. The training data set generation program is a program for generating a plurality of training data as a training data set by repeating the first pseudo image generation process, the second pseudo image generation process, the label generation process, and the training data generation process a plurality of times.
[0032] The various types of specified data include data necessary for executing each of these programs, such as a learning data set for the first model, a learning data set for the second model, and learning data sets (generated learning data set, third learning data set) for the learning data (generated learning data, third learning data) generated by the learning data generation device S.
[0033] Such a storage unit 5 includes, for example, a ROM (Read Only Memory) which is a nonvolatile storage element, an EEPROM (Electrically Erasable Programmable Read Only Memory) which is a rewritable nonvolatile storage element, etc. The storage unit 5 also includes a RAM (Random Access Memory) which serves as a so-called working memory of the control processing unit 1 for storing data generated during execution of the predetermined program, etc. The storage unit 5 may also be configured to include a hard disk device with a relatively large storage capacity.
[0034] The storage unit 5 functionally includes a first learning data storage unit 51, a second learning data storage unit 52, and a generated learning data storage unit 53.
[0035] The first learning data storage unit 51 stores a learning data set for a first model including a plurality of first learning data. The learning data set for the first model is used to generate a first model that generates a first pseudo image based on a first image including a predetermined object by machine learning. For this reason, the first learning data includes a first image including the predetermined object and a class label (teacher data) associated with the first image. Therefore, the learning data set for the first model includes a plurality of first images and a class label associated with each of the plurality of first images. The object may be any object, for example, an object to be detected. In one example, when the detection target is a cat, the first image is an image in which a cat is captured, and the class label is cat. An image with a class label is an image in which the detection target is included somewhere in the image. For this reason, since it is sufficient to provide a plurality of images with class labels as the learning data set for the first model, the first learning data implicitly includes a class label (teacher data), and does not necessarily need to explicitly include a class label (teacher data). Since the size of the cat's position that can be generated by the first model after machine learning is controlled depending on the position and size of the cat in the first image, it is preferable that the first image of the first learning data be an image of various forms depending on the detection range of the detection target, and from the viewpoint of generating many variations of first pseudo images with the first model, it is preferable that the first image be an image of the cat in various positions and in various poses (postures).
[0036] The second learning data storage unit 52 stores a learning data set for a second model including a plurality of second learning data. The learning data set for the second model is used to generate a second model that gives the first model a function of geometrically changing the object by machine learning. The manner of geometric change includes at least two of a first change manner of changing the position of the object in the left-right direction, a second change manner of changing the position of the object in the up-down direction, a third change manner of changing the position of the object in the diagonal direction, and a fourth change manner of changing the object in either the enlargement or reduction of the object. In this embodiment, these four are included. For this reason, four learning data sets for the 2A, 2B, 2C, and 2D models are prepared, and these are stored in the second learning data storage unit 52.
[0037] The learning data set for the 2A model is used to generate a second model (2A model) by machine learning, in which a function for changing the position of the object in the left-right direction (left-right position change function) is imparted to the first model. For this reason, the second learning data (2A learning data) of the learning data set for the 2A model includes, for example, an image (left-side image) in which a cat is reflected to the left of the center position as shown in FIG. 2A and an image (right-side image) in which a cat is reflected to the right of the center position as shown in FIG. 2B. Such 2A learning data is generated by superimposing an image (cat image) in which a cat is reflected on an image (background image) with a monochromatic background (e.g., black, etc.), and when superimposing, the left-side image can be generated by randomly generating the superimposing position to the left of the center position, and the right-side image can be generated by randomly generating the superimposing position to the right of the center position. The cat images in the left-side image and the right-side image in the 2A learning data are the same. A plurality of such second A learning data are generated so as to be different from each other, and the learning data set for the second A model is generated.
[0038] The learning data set for the 2B model is used to generate a second model (2B model) by machine learning, in which a function (vertical position change function) for changing the position of the object in the vertical direction is added to the first model. For this reason, the second learning data (2B learning data) of the learning data set for the 2B model includes, for example, an image (upward image) in which a cat is photographed above the center position as shown in FIG. 2C and an image (downward image) in which a cat is photographed below the center position as shown in FIG. 2D. Such 2B learning data is generated by superimposing the cat image on the background image, and when superimposing, the upper image can be generated by randomly generating the superimposing position above the center position, and the lower image can be generated by randomly generating the superimposing position below the center position. The cat images in the upper image and the lower image in the 2B learning data are the same. A plurality of such 2B learning data are generated so as to be different from each other, and the learning data set for the 2B model is generated.
[0039] The learning data set for the second C model is used to generate a second model (second C model) by machine learning, in which a function (diagonal position change function) for changing the position of the object in a diagonal direction is added to the first model. For this reason, the second learning data (second C learning data) of the second C learning data set includes, for example, one oblique image and the other oblique image, and each of the one oblique image and the other oblique image is an image in which, when the one oblique image and the other oblique image are juxtaposed, as shown in, for example, FIG. 2E and FIG. 2F, a line segment connecting a center position (one central position) of the cat image in the one oblique image and a center position (other central position) of the cat image in the other oblique image intersects with a line segment along the juxtaposition direction. Such second C learning data can be generated by superimposing the cat image on the background image, and when the superimposition is performed, the angle of the intersection is randomly generated, and each position where each cat image in the one oblique image and the other oblique image is superimposed is randomly generated on the line segment. The cat images in the one-sided oblique image and the other-sided oblique image in the second C learning data are the same. The one-sided oblique image shown in Fig. 2E is an image in which a cat image is superimposed diagonally to the lower left from the center position of a background image, and the other-sided oblique image shown in Fig. 2F is an image in which a cat image is superimposed diagonally to the upper right from the center position of the background image. A plurality of such second C learning data are generated so as to be different from each other, and the learning dataset for the second C model is generated.
[0040] The learning data set for the 2D model is used to generate a second model (2D model) by machine learning, in which a function (scaling change function) for enlarging or reducing the object is imparted to the first model. For this reason, the second learning data (2D learning data) of the learning data set for the 2D model includes, for example, one scaled image and the other scaled image, and the one scaled image and the other scaled image are images in which the size (magnitude) of the cat image in the one scaled image and the size of the cat image in the other scaled image are different from each other, as shown in, for example, FIG. 2G and FIG. 2H. Such 2D learning data is generated by superimposing the cat image on the background image, and can be generated by randomly generating each size so that the size (magnitude) of the cat image in the one scaled image and the size of the cat image in the other scaled image are different from each other when superimposing. In addition, when resizing, the original image is enlarged by, for example, pixel complementation, and the original image is reduced by, for example, pixel thinning. Both the cat image in the one scaled image and the cat image in the other scaled image may be resized, or one of them may be resized. The cat images in the one scaled image and the other scaled image in the 2D learning data are different in size, but have the same subject and angle. The one scaled image shown in FIG. 2G is an image in which the size of the cat image is smaller than the size of the cat image in the other scaled image shown in FIG. 2H. In other words, the other scaled image shown in FIG. 2H is an image in which the size of the cat image is larger than the size of the cat image in the one scaled image shown in FIG. 2G. A plurality of such 2D learning data are generated so as to be different from each other, and a learning dataset for the 2D model is generated.
[0041] The generated learning data storage unit 53 stores a learning data set (generative learning data set, learning data set for the third model) including a plurality of pieces of learning data (generative learning data, third learning data) generated by the learning data generation device S. The generated learning data includes the first pseudo image and a label of the first pseudo image associated with the first pseudo image, which are generated as described below.
[0042] The control processing unit 1 is a circuit for controlling each of the units 2 to 5 of the training data generation device S in accordance with the function of each unit, and generating the generated training data set. The control processing unit 1 is configured to include, for example, a CPU (Central Processing Unit) and its peripheral circuits. In the control processing unit 1, a control unit 11, a first model generation unit 12, a second model generation unit 13, a first pseudo image generation unit 14, a second pseudo image generation unit 15, a label generation unit 16, a training data generation unit 17, and a training data set generation unit 18 are functionally configured by executing the control processing program.
[0043] The control unit 11 controls each of the units 2 to 5 of the learning data generation device S in accordance with the function of each unit, and is in charge of controlling the learning data generation device S as a whole.
[0044] The first model generation unit 12 performs machine learning on a first model that generates a first pseudo image based on a first image including a predetermined object by using a first model learning data set including a plurality of first learning data. The first model is a model that has a latent space in its architecture and can change the position and size of the detection target in the image by manipulating the latent space, and for the first model, for example, a well-known StyleGAN or its improved StyleGAN2 is used. StyleGAN and StyleGAN2 acquire latent variables of the latent space by machine learning. In this embodiment, the first model generation unit 12 performs machine learning on an unmachine-learned StyleGAN2 using the first model learning data set stored in the first learning data storage unit 51 of the storage unit 5, thereby generating a machine-learned StyleGAN2 as the first model, and stores the generated first model (in this example, the machine-learned StyleGAN2) in the storage unit 5. FIG. 3 shows four examples of the first pseudo image generated by the first model generated in this way.
[0045] The second model generation unit 13 generates a plurality of second models in which a function for geometrically changing the object is imparted to the first model, with the manner of change being different. As described above, the manner of geometric change includes at least two of the four first to fourth change manners, and in this embodiment, these four are included. More specifically, the second model generation unit 13 first duplicates the first model (in this example, StyleGAN2 that has been machine-learned) that has been machine-learned by the first model generation unit 13 into four and stores them in the storage unit 5. Next, the second model generation unit 13 uses a learning data set for the second A model stored in the second learning data storage unit 52 of the storage unit 5 to machine-learn one of the four first models, thereby generating a second A model in which the left-right position change function is imparted to the first model, and stores the generated second A model (in this example, StyleGAN2 that has been machine-learned to impart the left-right position change function) in the storage unit 5. Next, the second model generation unit 13. Using the learning data set for the 2B model stored in the second learning data storage unit 52 of the storage unit 5, one of the remaining three first models is machine-learned to generate a 2B model in which the vertical position change function is imparted to the first model, and the generated 2B model (in this example, the machine-learned StyleGAN2 to which the vertical position change function is imparted) is stored in the storage unit 5. Next, the second model generation unit 13 uses the learning data set for the 2C model stored in the second learning data storage unit 52 of the storage unit 5 to machine-learn one of the remaining two first models to generate a 2C model in which the diagonal position change function is imparted to the first model, and the generated 2C model (in this example, the machine-learned StyleGAN2 to which the diagonal position change function is imparted) is stored in the storage unit 5. Then, the second model generation unit 13. Using the learning dataset for the 2D model stored in the second learning data storage unit 52 of the storage unit 5, a 2D model in which the scaling function is imparted to the first model is generated by machine learning the remaining first model, and this generated 2D model (in this example, the machine-learned StyleGAN2 to which the scaling function is imparted) is stored in the storage unit 5.Such a 2A model can change the detection target within the range of the position and size of the detection target in each of the learning data sets for the 2A model used in the machine learning. The same is true for the 2B to 2D models.
[0046] The first pseudo image generating unit 14 executes a first pseudo image generating process for generating a first pseudo image from a first image by the first model. In this embodiment, the first pseudo image generating unit 14 inputs the first image to StyleGAN2 that has undergone machine learning, generates a first pseudo image as the output, and stores the generated first pseudo image in the storage unit 5.
[0047] The second pseudo image generating unit 15 executes a second pseudo image generating process for generating a plurality of second pseudo images from the first pseudo image by each of the plurality of second models. In this embodiment, the second pseudo image generating unit 15 first inputs the first pseudo image generated by the first pseudo image generating unit 14 to the second A model (in this example, the machine-learned StyleGAN2 to which the left-right position change function has been added) to generate a second pseudo image (the second A pseudo image) as an output, and stores the generated second A pseudo image in the storage unit 5 in association with the first pseudo image. Next, the second pseudo image generating unit 15 inputs the first pseudo image to the second B model (in this example, the machine-learned StyleGAN2 to which the up-down position change function has been added) to generate a second pseudo image (the second B pseudo image) as an output, and stores the generated second B pseudo image in association with the first pseudo image in the storage unit 5. Next, the second pseudo image generating unit 15 generates a second pseudo image (a second C pseudo image) as an output by inputting the first pseudo image into the second C model (in this example, a machine-learned StyleGAN2 to which the diagonal position change function has been added), and stores the generated second C pseudo image in the storage unit 5 in association with the first pseudo image. Then, the second pseudo image generating unit 15 generates a second pseudo image (a second D pseudo image) as an output by inputting the first pseudo image into the second D model (in this example, a machine-learned StyleGAN2 to which the scaling change function has been added), and stores the generated second D pseudo image in association with the first pseudo image in the storage unit 5. Therefore, four second A to second D pseudo images are associated with one first pseudo image generated by the first pseudo image generating unit 14.
[0048] In addition, the second pseudo image having a large change amount relative to the first pseudo image (the second pseudo image having a large change amount) may be discarded (deleted) (the second pseudo image may be generated within a predetermined change amount range relative to the first pseudo image). For example, a threshold value is set according to the manner of change, and the second pseudo image is generated by changing the latent variable related to the manner of change in the latent variable of the latent space within the range of the threshold value. As a result, the second pseudo image is generated within a predetermined change amount range relative to the first pseudo image.
[0049] The label generating unit 16 executes a label generating process for calculating the amount of change between the second pseudo image and the first pseudo image for each of the second pseudo images, and generating a label for the first pseudo image based on each amount of change calculated for each of the second pseudo images. The second model geometrically changes an object (a detection object, for example), so that the position of the object in the first pseudo image can be estimated by calculating the amount of change in the second pseudo image relative to the first pseudo image, and thus a label can be generated. More specifically, in this embodiment, the label generating unit 16 performs the label generating process by first calculating the amount of change between the second pseudo image and the first pseudo image for each of the second pseudo images, and then generating complementary amount of change data by complementing missing portions of the amount of change data calculated for each of the second pseudo images, and then generating the label based on the complementary amount of change data generated for each of the amount of change data. The amount of change between the first pseudo image and the second pseudo image is represented by an optical flow.
[0050] More specifically, the label generating unit 16 first obtains the optical flow of the 2A pseudo image relative to the first pseudo image as the change amount data. That is, the label generating unit 16 divides the first pseudo image into regions of a predetermined size in a mesh (grid) shape, estimates (searches) a region of the second pseudo image corresponding to the region in the first pseudo image for each region by, for example, the LucasKanade method or the Horn-Schunk method, and obtains a displacement vector from the region in the first pseudo image to the estimated region in the second pseudo image as the optical flow of the region. An example of this is shown in FIG. 4. In FIG. 4, the optical flows of each region are represented by arrows superimposed on the first pseudo image. The direction of the arrow in the arrow indicates the moving direction of the optical flow, and the length of the arrow indicates the magnitude of the optical flow.
[0051] Next, the label generating unit 16 judges whether the magnitude of the optical flow of each region is equal to or greater than a predetermined threshold (first judgment threshold) set in advance, and extracts a region having an optical flow equal to or greater than the first judgment threshold. As a result, a region having a change amount corresponding to the first judgment threshold is extracted. An example of a change amount map in which a region having a change amount corresponding to the first judgment threshold is represented by a white circle (○) is shown in FIG. 5A, FIG. 5C, and FIG. 5E. Here, when extracting a region having a large change amount, the edge of the detection object changes greatly, but the change amount of the inside of the detection object is small and it may not be extracted. For this reason, a missing region is complemented according to the manner of change. In the change amount map in the case of a left-right position change, if there is a region that has not been extracted as a region having a change amount corresponding to the first judgment threshold between two regions having a change amount corresponding to the first judgment threshold in the left-right direction, this is regarded as the missing region and complementation is performed, and the missing region is changed to a region having a change amount corresponding to the first judgment threshold. As a result, for example, the change amount map in the case of the left-right position change shown in FIG. 5A becomes the complementary change amount map shown in FIG. 5B after the interpolation. In the change amount map in the case of the up-down position change, if there is a region that is not extracted as a region having a change amount corresponding to the first judgment threshold between two regions having a change amount corresponding to the first judgment threshold in the up-down direction, the region is treated as the missing region and complemented, and the missing region is changed to a region having a change amount corresponding to the first judgment threshold. As a result, for example, the change amount map in the case of the up-down position change shown in FIG. 5C becomes the complementary change amount map shown in FIG. 5D after the interpolation. In the change amount map in the case of the diagonal position change, if there is a region that is not extracted as a region having a change amount corresponding to the first judgment threshold between two regions having a change amount corresponding to the judgment threshold in the diagonal direction, complementation is performed, and the missing region is changed to a region having a change amount corresponding to the first judgment threshold. As a result, for example, the change amount map in the case of the left-right position change shown in FIG. 5E becomes the complementary change amount map shown in FIG. 5F after the interpolation.
[0052] In the case of a change in enlargement or reduction, an area where the displacement vectors of the optical flow overlap a lot is extracted as the center area of the detection target. That is, the label generating unit 16 judges whether or not the number of displacement vectors overlapping each area is equal to or greater than a predetermined threshold (second judgment threshold) set in advance, and extracts an area having optical flows equal to or greater than the second judgment threshold. In Fig. 5G and Fig. 5H, the degree of overlap of the displacement vectors is shown as a white line to form a change amount map. In the case of a change in enlargement or reduction, no interpolation is performed.
[0053] Then, the label generating unit 16 counts the number of times that each region is extracted as a region having a change amount corresponding to the first judgment threshold for each of the complementary change amount data obtained for each of the plurality of second pseudo images, and generates a heat map as a label of the first pseudo image based on the counted number of times. The more times that a region is extracted as a region having a change amount corresponding to the first judgment threshold, the higher the probability that an object (in one example, a detection object) is located in that region. By using the heat map of the number of times that a region is extracted as a region having a change amount corresponding to the first judgment threshold as a label, the position of the object in the first pseudo image can be probabilistically indicated. An example of the heat map is shown in FIG. 6B, FIG. 6D, FIG. 6F, and FIG. 6H. Fig. 6B is a heat map of the first pseudo image shown in Fig. 6A, Fig. 6D is a heat map of the first pseudo image shown in Fig. 6C, Fig. 6F is a heat map of the first pseudo image shown in Fig. 6E, and Fig. 6H is a heat map of the first pseudo image shown in Fig. 6G, and each of these heat maps is displayed superimposed on each of the first pseudo images. In each of these heat maps, the area extracted three times as the area having the amount of change corresponding to the first judgment threshold is represented by a white circle (○), the area extracted twice as the area having the amount of change corresponding to the first judgment threshold is represented by a white diamond (◇), the area extracted once as the area having the amount of change corresponding to the first judgment threshold is represented by a white triangle (△), and the area extracted 0 times as the area having the amount of change corresponding to the first judgment threshold (the area not extracted as the area having the amount of change corresponding to the first judgment threshold) is represented by a white square (□). In each of these heat maps, an area having a number of optical flows equal to or greater than the second determination threshold is represented by a hollow pentagon as the center area of the detection target.
[0054] As described above, this heat map may be used as a label for the first pseudo image, but for example, the area with three occurrences may be used as a label representing the cat area, or, for example, the pixels of the area with two or more occurrences may be used as a label representing the cat pixels.
[0055] The learning data generating unit 17 executes a learning data generating process for generating learning data by associating the first pseudo image with the label. More specifically, the learning data generating unit 17 associates the first pseudo image generated by the first pseudo image generating unit 14 with the label of the first pseudo image generated by the label generating unit 16 based on the first pseudo image and a plurality of second pseudo images generated by the second pseudo image generating unit 15 from the first pseudo image, and stores the result in the generated learning data storage unit 53 of the storage unit 5 as one piece of generated learning data of the generated learning data set.
[0056] The learning data set generation unit 18 repeats the first pseudo image generation process, the second pseudo image generation process, the label generation process, and the learning data generation process a plurality of times to generate a plurality of learning data as a learning data set.
[0057] The control processing unit 1, the input unit 2, the output unit 3, the IF unit 4 and the storage unit 5 can be configured by, for example, a desktop or notebook computer.
[0058] Next, the operation of this embodiment will be described with reference to a flowchart shown in FIG.
[0059] When the training data generation device S having such a configuration is powered on, it initializes each required unit and starts its operation. In the control processing unit 1, a control unit 11, a first model generation unit 12, a second model generation unit 13, a first pseudo image generation unit 14, a second pseudo image generation unit 15, a label generation unit 16, a training data generation unit 17, and a training data set generation unit 18 are functionally configured by executing the control processing program.
[0060] Before the generation of the generation learning data set, the first and second learning data sets are stored in the first and second learning data storage units 51 and 52 in the storage unit 5, respectively. For example, the first and second learning data sets are input from the input unit 2 and stored in the storage unit 5. Alternatively, for example, the first and second learning data sets may be input from a storage medium (e.g., a USB memory or an SD card (registered trademark)) that stores them via the IF unit 4 and stored in the storage unit 5, or may be input from a recording medium (e.g., a CD-R or a DVD-R) that records them via its drive device and the IF unit 4 and stored in the storage unit 5, or may be input from a management server device that manages them via a communication network and the IF unit 4 and stored in the storage unit 5. Alternatively, for example, the first learning data set may be input and stored, and the second learning data set may be generated from the learning data of this first learning data set and stored.
[0061] In generating a generated training data set, in FIG. 7, first, the training data generation device S generates a first model using the first model generation unit 12 of the control processing unit 1, and stores this generated first model in the memory unit 5 (S1, seventh step).
[0062] Next, the learning data generation device S generates a plurality of second models by the second model generation unit 13 of the control processing unit 1, and stores the generated plurality of second models in the storage unit 5 (S2, first step). In this embodiment, four models 2A to 2D are generated and stored.
[0063] Next, the learning data generation device S generates a first pseudo image from the first image using the first model through the first pseudo image generation unit 14 of the control processing unit 1, and stores this generated first pseudo image in the memory unit 5 (S3, first pseudo image generation process, second step).
[0064] Next, the learning data generation device S causes the second pseudo image generation unit 15 of the control processing unit 1 to generate a plurality of second pseudo images from the first pseudo image generated by the first pseudo image generation unit 14 in the process S3 using each of the plurality of second models generated by the second model generation unit 13 in the process S2, and stores these generated second pseudo images in the storage unit 5 in association with the first pseudo image (S4, second pseudo image generation process, third step). In this embodiment, four 2A to 2D pseudo images are generated and stored using four 2A to 2D models, respectively.
[0065] Next, the learning data generation device S causes the label generation unit 16 of the control processing unit 1 to calculate the amount of change between the second pseudo image and the first pseudo image for each of the second pseudo images to generate change amount data, and stores the generated change amount data in the storage unit 5 (S5, change amount calculation process of the label generation process, step 41 of the fourth step). In this embodiment, the optical flow of each area into which the first pseudo image is divided is calculated as the change amount data.
[0066] Next, the learning data generation device S causes the label generation unit 16 of the control processing unit 1 to generate complementary change amount data by complementing the loss of the change amount data obtained in S5 for each of the second pseudo images, and stores the generated complementary change amount data in the storage unit 5 (S6, complementation process of the label generation process, step 42 of the fourth process). In this embodiment, a change amount map is generated based on the optical flow of each region obtained by dividing the first pseudo image, and a complementary change amount map is generated by interpolating the generated change amount map according to the manner of change.
[0067] Next, the learning data generation device S generates the labels using the label generation unit 16 of the control processing unit 1 based on the complementary change amount data generated in the process S6 for each of the change amount data (S7, label processing of the label generation process, step 43 of the fourth step).
[0068] Next, the learning data generation device S generates learning data (generated learning data) by causing the learning data generation unit 17 of the control processing unit 1 to correspond the first pseudo image generated by the first pseudo image generation unit 14 in the process S3 to correspond to the label generated by the label generation unit 16 in the process S7, and stores this generated generated learning data in the generated learning data memory unit 53 of the memory unit 5 (S8, learning data generation process, fifth step).
[0069] Next, the training data generation device S judges whether the processing has ended or not by the training data set generation unit 18 of the control processing unit 1 (S9, sixth step). If the result of this judgment is that the processing has ended (Yes), the training data generation device S next executes step S10. On the other hand, if the result of the judgment is that the processing has not ended (No), the training data generation device S returns the processing to step S3. This causes the first pseudo image generation processing, the second pseudo image generation processing, the label generation processing, and the training data generation processing (the second to fifth steps) to be repeated. In the judgment, the processing is judged to be ended when, for example, a command instructing the processing to end is received by the input unit 2, or when the first pseudo image generation processing, the second pseudo image generation processing, the label generation processing, and the training data generation processing (the second to fifth steps) have been repeated a predetermined number of times.
[0070] In the process S10, the learning data generation device S outputs the generation learning data set stored in the generation learning data storage unit 53 of the storage unit 5 to the output unit 3 by the control unit 11 of the control processing unit 1, and ends this process. Note that, if necessary, the generation learning data set may be output to an external device via the IF unit 6.
[0071] Processes S1 and S3 are processes for generating images of generated learning data, and processes S2 and S4 to S7 are processes for generating labels of the generated learning data (labels of the images).
[0072] As described above, the training data generation device S in the embodiment and the training data generation method and training data generation program implemented therein can generate a label for the first pseudo image generated by the first model by using a second model generated based on the first model, thereby eliminating the need for annotation and further reducing the labor required for manual annotation.
[0073] The training data generation device S, the training data generation method, and the training data generation program mentioned above complement the missing change amount data, and therefore can generate labels with higher accuracy. In particular, since the complement is performed according to the manner of the change, the training data generation device S, the training data generation method, and the training data generation program mentioned above can more appropriately complement and generate labels with higher accuracy.
[0074] The training data generation device S, the training data generation method, and the training data generation program can generate the first model by machine learning. Therefore, the training data generation device S, the training data generation method, and the training data generation program can generate the first model by taking into account features that humans cannot notice.
[0075] According to the present embodiment, it is possible to provide a training data generation device S, a training data generation method, and a training data generation program that include at least two of the first to fourth change manners.
[0076] According to this embodiment, it is possible to provide a training data generation device S, a training data generation method, and a training data generation program in which the amount of change between the first pseudo image and the second pseudo image is expressed by optical flow.
[0077] In order to express the present invention, the present invention has been described adequately and sufficiently through the embodiments with reference to the drawings in the above description, but it should be recognized that those skilled in the art can easily change and / or improve the above-mentioned embodiments. Therefore, unless the changes or improvements made by those skilled in the art are at a level that departs from the scope of the claims described in the claims, the changes or improvements are interpreted as being included in the scope of the claims. [Explanation of symbols]
[0078] S Learning data generator 1 Control processing section 5 Storage section 11 Control section 12 First model generation section 13 Second model generation section 14 First pseudo image generation section 15 Second pseudo image generation section 16 Label Generation Unit 17 Learning data generation unit 18 Learning Data Set Generation Unit 51 First learning data storage unit 52 Second learning data storage unit 53 Generative learning data storage unit
Claims
1. a first step of generating a first pseudo image based on a first image including a predetermined object, and imparting a function of geometrically changing the object to a first model, thereby generating a plurality of second models with different ways of changing the object; a second step of generating a first pseudo image from the first image by using the first model; a third step of generating a plurality of second pseudo images from the first pseudo image by the plurality of second models, respectively; a fourth step of calculating an amount of change between the second pseudo image and the first pseudo image for each of the second pseudo images, and generating a label for the first pseudo image based on the amount of change calculated for each of the second pseudo images; a fifth step of generating training data by associating the first pseudo image with the label; and a sixth step of generating a plurality of training data as a training data set by repeating the second to fifth steps a plurality of times. Training data generation method.
2. The fourth step comprises: a 41 step of calculating a change amount between the second pseudo image and the first pseudo image for each of the second pseudo images to generate change amount data; a 42nd step of generating complementary change amount data by complementing a loss of each of the change amount data obtained in the 41st step for each of the second pseudo images; and generating the label based on the complementary change amount data generated in the step 42 for each of the change amount data. The training data generating method according to claim 1 .
3. the first model is STYLEGAN or STYLEGAN 2; The method further includes a seventh step, prior to the first step, of machine learning the first model by using a first model learning dataset including a plurality of first images and class labels corresponding to each of the plurality of first images. The training data generating method according to claim 1 .
4. the manner of change includes at least two of a first manner of change for changing the position of the object in a left-right direction, a second manner of change for changing the position of the object in a top-bottom direction, a third manner of change for changing the position of the object in a diagonal direction, and a fourth manner of change for either enlarging or reducing the object, The first step generates at least two second models by carrying out the at least two. The training data generating method according to claim 1 .
5. The amount of change between the first pseudo image and the second pseudo image is represented by an optical flow. The training data generating method according to claim 1 .
6. On the computer, a first step of generating a first pseudo image based on a first image including a predetermined object, and imparting a function of geometrically changing the object to a first model, thereby generating a plurality of second models with different ways of changing the object; a second step of generating a first pseudo image from the first image by using the first model; a third step of generating a plurality of second pseudo images from the first pseudo image by the plurality of second models, respectively; a fourth step of calculating an amount of change between the second pseudo image and the first pseudo image for each of the second pseudo images, and generating a label for the first pseudo image based on the amount of change calculated for each of the second pseudo images; a fifth step of generating training data by associating the first pseudo image with the label; A sixth step of generating a plurality of training data as a training data set by repeating the second to fifth steps a plurality of times; A learning data generation program for executing the above.
7. a second model generating unit configured to generate a first pseudo image based on a first image including a predetermined object, and to generate a second model by adding a function of geometrically changing the object to the first model, the second model generating unit generating a second model by changing the way the object is changed; a first pseudo image generating unit that executes a first pseudo image generating process to generate a first pseudo image from a first image using the first model; a second pseudo image generating unit that executes a second pseudo image generating process to generate a plurality of second pseudo images from the first pseudo image by the plurality of second models, respectively; a label generating unit that performs a label generating process to calculate an amount of change between the second pseudo image and the first pseudo image for each of the second pseudo images and generate a label for the first pseudo image based on the amount of change calculated for each of the second pseudo images; a learning data generating unit that executes a learning data generating process for generating learning data by associating the first pseudo image with the label; a learning data set generation unit that generates a plurality of learning data as a learning data set by repeating the first pseudo image generation process, the second pseudo image generation process, the label generation process, and the learning data generation process a plurality of times; Training data generation device.
Citation Information
Patent Citations
Inspection system, image identification system, identification system, discriminator generation system, and learning data generation device
JP2019159961A
Generating data based on pre-trained models using generative adversarial models
JP2023551487A
Generating data based on pre-trained models using generative adversarial models
US20220180203A1
