WO2023152882A1 - モデル訓練装置、モデル訓練方法、及び非一時的なコンピュータ可読媒体 - Google Patents

モデル訓練装置、モデル訓練方法、及び非一時的なコンピュータ可読媒体 Download PDF

Info

Publication number
WO2023152882A1
WO2023152882A1 PCT/JP2022/005395 JP2022005395W WO2023152882A1 WO 2023152882 A1 WO2023152882 A1 WO 2023152882A1 JP 2022005395 W JP2022005395 W JP 2022005395W WO 2023152882 A1 WO2023152882 A1 WO 2023152882A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
training
model
loss
patch
Prior art date
Application number
PCT/JP2022/005395
Other languages
English (en)
French (fr)
Inventor
哲夫 井下
裕一 中谷
Original Assignee
日本電気株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日本電気株式会社 filed Critical 日本電気株式会社
Priority to PCT/JP2022/005395 priority Critical patent/WO2023152882A1/ja
Publication of WO2023152882A1 publication Critical patent/WO2023152882A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis

Definitions

  • the present disclosure relates to technology for training a model that transforms images.
  • Non-Patent Document 1 discloses a model for transforming an input image into another class of images, such as transforming an image of a horse into an image of a zebra.
  • Non-Patent Document 1 the class of the object is converted when converting the image.
  • the present disclosure has been made in view of the above problems, and one of its purposes is to provide a new technique for training a model that transforms images.
  • the model training device of the present disclosure includes first training images representing scenes under a first environment, and first training data including first class information indicating classes of each of a plurality of image regions included in the first training images. and an image transformation that outputs an image representing a scene under a second environment in response to an input of an image representing a scene under the first environment using the first training data set. and a training executor for training the model.
  • the training execution means inputs the first training image to the image transformation model, inputs the first output image output from the image transformation model to the identification model, identifies the identification data output from the identification model and the A first loss is calculated using the first class information, and the parameters of the image transformation model are updated using the first loss.
  • the identification data indicates whether each of a plurality of partial regions included in the image input to the identification model is a fake image region, and if the partial region is not a fake image indicates the class of the subregion.
  • the model training method of the present disclosure is computer-implemented.
  • the model training method generates a first training data set including a first training image representing a scene under a first environment and first class information indicating a class of each of a plurality of image regions included in the first training image. and an image transformation model that outputs an image representing a scene under a second environment in response to an input of an image representing a scene under the first environment using the first training data set. and a training execution step of performing training.
  • the first training image is input to the image transformation model
  • the first output image output from the image transformation model is input to the identification model
  • the identification data output from the identification model and the A first loss is calculated using the first class information
  • the parameters of the image transformation model are updated using the first loss.
  • the identification data indicates whether each of a plurality of partial regions included in the image input to the identification model is a fake image region, and if the partial region is not a fake image indicates the class of the subregion.
  • a computer-readable medium of the present disclosure stores a program that causes a computer to execute the model training method of the present disclosure.
  • new techniques are provided for training models that transform images.
  • FIG. 4 is a diagram illustrating an overview of an image transformation model trained by a model training device
  • FIG. 4 is a diagram illustrating an outline of a discriminative model
  • 1 is a diagram illustrating an overview of a model training device
  • FIG. It is a block diagram which illustrates the functional composition of a model training device. It is a block diagram which illustrates the hardware constitutions of the computer which implement
  • 4 is a flow chart illustrating the flow of processing performed by the model training device
  • FIG. 10 is a diagram illustrating the effect of data augmentation using an image conversion model
  • FIG. 4 is a diagram illustrating the configuration of an image conversion model
  • FIG. 4 is a diagram illustrating the configuration of a discriminative model; It is a figure which illustrates a positive example patch and a negative example patch.
  • FIG. 4 is a diagram illustrating a method of calculating patchwise contrastive loss;
  • FIG. 10 is a diagram illustrating an extraction probability map;
  • predetermined values such as predetermined values and threshold values are stored in advance in a storage device or the like that can be accessed from a device that uses the values.
  • the storage unit is composed of one or more arbitrary number of storage devices.
  • FIG. 1 is a diagram illustrating an overview of an image conversion model trained by the model training device of this embodiment.
  • the image transformation model 100 outputs an output image 20 in response to the input image 10 being input.
  • An input image 10 is an image input to an image transformation model 100 .
  • the output image 20 is an image output from the image transformation model 100 .
  • image transformation model 100 is implemented as an arbitrary machine learning model (eg, neural network).
  • the image transformation model 100 is such that "when an image representing a scene under a first environment is input as the input image 10, an image representing that scene under a second environment different from the first environment is used as the output image 20. It is trained to perform the process of "output". As a result, the image conversion model 100 can pseudo-generate an image of the scene captured under another environment from the image of the scene captured under a specific environment.
  • the input image 10 is an image obtained by capturing an image of a specific road with a camera.
  • the state of the road at night is generally dark, various lights such as car lights and street lights are on, and the places illuminated by lights are different from other places. It is different from the road in the daytime in that it is bright.
  • the image conversion model 100 generates an image of the road at night from an image of the road in the daytime so as to simulate the characteristics of the road at night. This makes it possible to implement data augmentation, for example, as described below.
  • the environment is not limited to time zones such as daytime or nighttime.
  • another example of the environment is the environment related to the weather.
  • the image transformation model 100 produces from an input image 10 representing a scene under clear weather an output image 20 representing the scene under rain.
  • Weather such as snow may be used instead of rain.
  • the image transformation model 100 is trained so that when generating the output image 20 from the input image 10, the environment from the first environment to the second environment is transformed, but the class of each image region is not transformed.
  • the class of image area is represented by, for example, the type of object included in the image area. Therefore, for example, the input image 10 is converted into the output image 20 so that the image area representing the car in the input image 10 also represents the car in the output image 20 .
  • FIG. 2 is a diagram illustrating an overview of the identification model 200.
  • discriminative model 200 is implemented as any machine learning model (eg, neural network).
  • the identification model 200 identifies, for each of a plurality of image areas included in the input image 30, whether or not the image area is a true image area representing a scene under the second environment.
  • the true image area means an image area that is not generated by the image transformation model 100 (that is, is not a pseudo-generated image area).
  • the identification model 200 identifies the class of the image region.
  • an image generated by the image transformation model 100 that is, a pseudo image
  • an image not generated by the image transformation model 100 will be referred to as a “fake image” and a “true image”, respectively. do.
  • An image area that is not a true image area is referred to as a "false image area”.
  • the identification data 40 represents the result of identification by the identification model 200.
  • the identification data 40 indicates the probability that each of a plurality of image regions included in the input image 10 is a true image region belonging to each class and the probability that it is a false image region.
  • the identification data 40 indicates an (N+1)-dimensional vector (hereinafter referred to as score vector) for each of a plurality of image regions included in the input image.
  • the score vector indicates the probability that the corresponding image region is a true image region belonging to each of classes C1 to CN, and the probability that the corresponding image region is a false image region.
  • the image area to be identified by the identification model 200 may be one pixel, or may be an area composed of a plurality of pixels.
  • the identification model 200 performs true/false identification and class identification for each pixel of the input image 10 .
  • the identification model 200 divides the input image 10 into a plurality of image regions of a predetermined size, and performs true/false identification and class identification for each image region.
  • FIG. 3 is a diagram illustrating an overview of the model training device 2000 of this embodiment.
  • FIG. 3 is a diagram for facilitating understanding of the outline of the model training device 2000, and the operation of the model training device 2000 is not limited to that shown in FIG.
  • the model training device 2000 acquires the first training data set 50.
  • a first training data set 50 includes first training images 52 and first class information 54 .
  • the first training image 52 is an image representing a scene under the first environment.
  • the first class information 54 indicates the class of each of the multiple image regions included in the first training image 52 .
  • the model training device 2000 obtains the output image 20 from the image transformation model 100 by inputting the first training data set 50 as the input image 10 to the image transformation model 100 . Furthermore, the discriminative model 200 inputs this output image 20 into the discriminative model 200 . As a result, the model training device 2000 obtains identification data 40 representing identification results for each image region included in the output image 20 .
  • the image conversion model 100 preferably converts the environment but does not convert the class. Therefore, the image transformation model 100 is configured so that each image region of the output image 20 is identified by the identification model 200 as "a true image region and belonging to the same class as the corresponding image region of the input image 10". It is preferred to train That is, it is preferable to train the image transformation model 100 so that the class of each image region specified by the identification data 40 matches the class of each image region indicated by the first class information 54 .
  • the model training device 2000 calculates a first loss representing the magnitude of the difference between the identification data 40 and the first class information 54, and trains the image conversion model 100 so as to reduce the first loss. Specifically, the model training device 2000 updates the trainable parameters (eg, each weight of the neural network) included in the image transformation model 100 so as to reduce the first loss.
  • trainable parameters eg, each weight of the neural network
  • the class of the image region specified by the identification data 40 is, for example, the class corresponding to the element with the maximum value in the score vector described above. Note that when the element with the largest value in the score vector corresponds to the false image region, the score vector indicates that the corresponding image region is the false image region.
  • Non-Patent Document 1 class conversion is performed on the entire image, such as converting a horse image into a zebra image. Therefore, the method of Non-Patent Document 1 cannot perform image conversion that maintains the class (for example, the type of object) of each image region while converting the environment of the scene represented by the entire image.
  • An example of such image conversion is image conversion in which an image of a road in the daytime on which a car is running is converted into a night image in which the car is running. In this image conversion, it is necessary to convert the environment of the scene represented by the entire image from daytime to nighttime, so that the image area representing the car in the image before conversion also represents the car in the image area after conversion. .
  • the model training device 2000 inputs the output image 20 obtained from the image transformation model 100 to the discriminative model 200, and uses the discriminative data 40 and the first class information 54 obtained from the discriminative model 200 to generate an image Train the transform model 100 .
  • the image conversion model 100 having the function of "converting a scene under the first environment to a scene under the second environment while maintaining the class of each image area".
  • the model training device 2000 of this embodiment will be described in more detail below.
  • FIG. 4 is a block diagram illustrating the functional configuration of the model training device 2000 of this embodiment.
  • the model training device 2000 has an acquisition unit 2020 and a training execution unit 2040 .
  • Acquisition unit 2020 acquires first training data set 50 .
  • the training execution unit 2040 uses the first training data set 50 to train the image transformation model 100 .
  • the training execution unit 2040 inputs the first training image 52 to the image transformation model 100 and obtains the output image 20 from the image transformation model 100 .
  • the training execution unit 2040 inputs the output image 20 to the discriminative model 200 and obtains discriminative data 40 from the discriminative model 200 .
  • the training execution unit 2040 then calculates a first loss representing the magnitude of the difference between the identification data 40 and the first class information 54, and updates the image transformation model 100 using the first loss.
  • Each functional component of the model training device 2000 may be realized by hardware (eg, hardwired electronic circuit, etc.) that implements each functional component, or a combination of hardware and software (eg, combination of an electronic circuit and a program for controlling it, etc.).
  • hardware eg, hardwired electronic circuit, etc.
  • software e.g., combination of an electronic circuit and a program for controlling it, etc.
  • a case where each functional component of the model training device 2000 is realized by a combination of hardware and software will be further described below.
  • FIG. 5 is a block diagram illustrating the hardware configuration of the computer 1000 that implements the model training device 2000.
  • Computer 1000 is any computer.
  • the computer 1000 is a stationary computer such as a PC (Personal Computer) or a server machine.
  • the computer 1000 is a portable computer such as a smart phone or a tablet terminal.
  • Computer 1000 may be a dedicated computer designed to implement model training device 2000 or a general-purpose computer.
  • the functions of the model training device 2000 are implemented on the computer 1000.
  • the application is composed of a program for realizing each functional component of the model training device 2000 .
  • the acquisition method of the above program is arbitrary.
  • the program can be acquired from a storage medium (DVD disc, USB memory, etc.) in which the program is stored.
  • the program can be obtained by downloading the program from a server device that manages the storage device in which the program is stored.
  • the computer 1000 has a bus 1020 , a processor 1040 , a memory 1060 , a storage device 1080 , an input/output interface 1100 and a network interface 1120 .
  • the bus 1020 is a data transmission path through which the processor 1040, memory 1060, storage device 1080, input/output interface 1100, and network interface 1120 mutually transmit and receive data.
  • the method of connecting processors 1040 and the like to each other is not limited to bus connection.
  • the processor 1040 is various processors such as a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), or an FPGA (Field-Programmable Gate Array).
  • the memory 1060 is a main memory implemented using a RAM (Random Access Memory) or the like.
  • the storage device 1080 is an auxiliary storage device implemented using a hard disk, SSD (Solid State Drive), memory card, ROM (Read Only Memory), or the like.
  • the input/output interface 1100 is an interface for connecting the computer 1000 and input/output devices.
  • the input/output interface 1100 is connected to an input device such as a keyboard and an output device such as a display device.
  • a network interface 1120 is an interface for connecting the computer 1000 to a network.
  • This network may be a LAN (Local Area Network) or a WAN (Wide Area Network).
  • the storage device 1080 stores a program that implements each functional component of the model training device 2000 (a program that implements the application described above).
  • Processor 1040 implements each functional component of model training apparatus 2000 by reading this program into memory 1060 and executing it.
  • the model training device 2000 may be realized by one computer 1000 or may be realized by a plurality of computers 1000. In the latter case, the configuration of each computer 1000 need not be the same, and can be different.
  • FIG. 6 is a flowchart illustrating the flow of processing executed by the model training device 2000 of this embodiment.
  • the acquisition unit 2020 acquires the first training data set 50 (S102).
  • the training execution unit 2040 inputs the first training image 52 to the image conversion model 100 (S104).
  • the training execution unit 2040 inputs the output image 20 output from the image transformation model 100 to the discrimination model 200 (S106).
  • the training execution unit 2040 calculates a first loss based on the magnitude of the difference between the identification data 40 output from the identification model 200 and the first class information 54 (S108).
  • the training execution unit 2040 updates the image transformation model 100 using the first loss (S110).
  • model training device 2000 acquires a plurality of first training data sets 50 and repeatedly updates the image conversion model 100 using the plurality of first training data sets 50, thereby updating the image conversion model 100 to train.
  • ⁇ Usage Example of Image Conversion Model 100> a usage scene of the image conversion model 100 will be illustrated.
  • the usage scene described here is an example, and the usage scene of the model training device 2000 is not limited to the example described below.
  • Vehicle surveillance is performed by detecting a vehicle from each video frame of the video data using a surveillance device.
  • the monitor has a detection model pretrained to detect vehicles from images.
  • the appearance of an object in an image may differ depending on the environment in which the object was captured. For example, a car captured in the daytime and a car captured in the nighttime look different from each other. In addition, the appearance of a car imaged in fine weather differs from that of a vehicle imaged in rainy weather.
  • the detection model used for vehicle monitoring should be robust to such environmental changes. That is, the detection model needs to be trained to detect cars from each video frame regardless of time of day or weather. For this purpose, it is necessary to train a detection model using road images captured under various environments as training images.
  • the ease of obtaining training images may differ from environment to environment. For example, since there are fewer cars at night than during the day, images captured of cars on roads at night will have a higher number available from surveillance cameras than images captured of cars on roads during the day. few. In addition, in places where there is a lot of sunshine, the number of images of vehicles on roads outside of sunny weather, such as rain or snow, that can be obtained from surveillance cameras is smaller than that of images of vehicles on roads during sunny weather. few. Due to the fact that the number of available images varies from environment to environment, training a detection model using only the images available from surveillance cameras reduces the accuracy of vehicle detection in environments such as nighttime and rainy weather. it gets lower.
  • the image conversion model 100 trained by the model training device 2000 is used to perform data augmentation using images of environments that are easy to obtain, thereby generating simulated images of environments that are difficult to obtain.
  • the model training device 2000 outputs an image of a car on a road at night as an output image 20 in response to an input image 10 of a car on a road in the daytime. pre-trained.
  • FIG. 7 is a diagram illustrating the effect of data extension using the image conversion model 100.
  • FIG. 7 shows a case where the detection model is trained using only the images obtained from the surveillance cameras without data augmentation by the image conversion model 100 . In this case, since the number of training images of nighttime vehicles is insufficient, the detection accuracy of nighttime vehicles is low.
  • the lower part of FIG. 7 illustrates a case where data expansion is performed by the image conversion model 100.
  • a user inputs an image of a car on a road in the daytime obtained from a monitoring camera into the image conversion model 100 to obtain an image that simulates a car on the road at night. By doing so, it is possible to obtain as many images of cars on the road at night as there are images of cars on the road during the day.
  • By training the detection model using the images obtained using the image conversion model 100 as training images in this way it is possible to generate a detection model that can accurately detect a vehicle at night. That is, it is possible to generate a detection model that is robust to changes in the environment.
  • the detection model in addition to the training images, information indicating where the car is located in the training images is also required.
  • This information can be viewed as class information indicating to which of two classes, car or other, each image region included in the training image belongs.
  • the detection model should be able to detect not only cars but also other types of objects (eg, people, roads, etc.), those types should also be indicated by the class information.
  • the type of image region class handled by the model training device 2000 can be arbitrarily set according to the characteristics of the scene represented by the image handled by the image transformation model 100 .
  • image regions are classified into two classes: predetermined objects that can be included in the image handled by the image transformation model 100, and others.
  • predetermined objects For example, if the predetermined object is a car, the first class information 54 indicates the class "car” for image areas representing cars, and the class "other than cars” for image areas other than cars.
  • predetermined objects may be handled as predetermined objects.
  • objects may be handled as predetermined objects.
  • cars Specifically, it is conceivable to further classify cars. Specifically, it is conceivable to provide classes such as “ordinary car”, “bus”, “truck”, “motorcycle”, and “bicycle”.
  • classes other than cars may be provided, such as, for example, "road”, "building”, or "person”. Note that when a class of roads is provided, the roads may be further classified according to the traveling direction of the vehicle.
  • image transformation model 100 is configured to extract features from input image 10 and generate output image 20 based on the extracted features.
  • FIG. 8 is a diagram illustrating the configuration of the image transformation model 100.
  • Image transformation model 100 includes two models, feature extraction model 110 and image generation model 120 .
  • Feature extraction model 110 is configured to extract a feature map from input image 10 .
  • a feature map extracted from an image is a set of feature amounts obtained from each of a plurality of partial regions included in the image.
  • Image generation model 120 is configured to generate output image 20 from the feature map.
  • Both the feature extraction model 110 and the image generation model 120 are configured as arbitrary types of machine learning models.
  • both the feature extraction model 110 and the image generation model 120 are composed of neural networks.
  • the image transformation model 100 may use class information corresponding to the input image 10 to generate the output image 20 .
  • the image transformation model 100 further utilizes the first class information 54 when generating the output images 20 from the first training images 52 .
  • first training image 52 is input to image generation model 120 .
  • the technique disclosed in Non-Patent Document 2 can be used as a technique for using class information in a model that generates an image.
  • the acquisition unit 2020 acquires the first training data set 50 (S102).
  • the acquisition unit 2020 acquires the first training data set 50 .
  • the first training data set 50 is stored in advance in any storage device in a manner that can be obtained from the model training device 2000 .
  • the acquisition unit 2020 reads the first training data set 50 from the storage device.
  • the acquisition unit 2020 may acquire the first training data set 50 by receiving the first training data set 50 transmitted from another device.
  • a training execution unit 2040 trains the image transformation model 100 using the first training data set 50 .
  • the training execution unit 2040 inputs the first training image 52 to the image transformation model 100 (S104), and inputs the output image 20 output from the image transformation model 100 to the discrimination model 200 (S106).
  • the training execution unit 2040 calculates a first loss representing the magnitude of the difference between the identification data 40 output from the identification model 200 and the first class information 54, and updates the image transformation model 100 using the first loss. do.
  • Various existing techniques can be used as a specific method for updating the parameters of the model based on the loss.
  • the loss function for calculating the first loss (hereinafter referred to as the first loss function)
  • various functions that can express the magnitude of the difference between the identification data 40 and the first class information 54 are used. be able to.
  • the following equation (1) can be used as the first loss function.
  • x1 and t1 represent the first training image 52 and the first class information 54, respectively.
  • L1(x1,t) represents the first loss calculated using the first training image x1 and the first class information t1.
  • c represents the class identifier.
  • N represents the total number of classes.
  • ⁇ _c represents the weight given to the class with identifier c. A method for calculating this weight is disclosed in Non-Patent Document 3.
  • the symbol "_" represents a subscript.
  • i represents the identifier of the image area to be identified.
  • t1_i,c indicates 1 when the class of the image area i is c in the first class information t1, and indicates 0 when the class of the image area i is not c in the first class information t1.
  • G(x1) represents the output image 20 generated by inputting the first training image x1 into the image transformation model 100 . Note that when the first training image 52 is also input to the image transformation model 100, G(x1,t1) is used instead of G(x1).
  • D(G(x1)) represents the identification data 40 output by the identification model 200 in response to the output image 20 being input.
  • D(G(x1))_i,c is a value indicated by the score vector corresponding to the image region i for the class c in the identification data 40 . That is, it represents the probability that the class of the image region i of the output image 20 calculated by the discriminative model 200 is c.
  • the training execution unit 2040 may further calculate a loss based on the difference between the first training image 52 and the output image 20, and update the image transformation model 100 based on both this loss and the above-described first loss. .
  • the training execution unit 2040 calculates a total loss as a weighted sum of these two losses, and updates the image transformation model 100 so that the total loss becomes smaller.
  • Examples of the loss based on the difference between the first training image 52 and the output image 20 include patchwise contrastive loss disclosed in Non-Patent Document 1 and patchwise contrastive loss disclosed in Non-Patent Document 4. Cycle consistency loss, etc. can be used. However, the losses based on the difference between the first training image 52 and the output image 20 are not limited to those disclosed in these non-patent documents. Further, when using the patchwise contrastive loss, a device described later may be applied.
  • the loss may be calculated collectively for a plurality of first training data sets 50 .
  • the loss for training the image transformation model 100 can be generalized, for example, by the following equation.
  • set S1 is the set of first training data sets 50
  • L_G(S1) is the loss calculated using the set S1.
  • L_d(x1) is a calculation based on the difference between the first training image x1 and the output image 20 obtained by inputting this x1 into the image transformation model 100 .
  • L_d can be patchwise contrastive loss L_pw, which will be described later.
  • is the weight given to the first loss.
  • the identification model 200 identifies the true/false and class of each of a plurality of image regions included in the input image.
  • the identification model 200 performs semantic segmentation, that is, a model that identifies a class for each of a plurality of image areas included in an input image. can be seen as a model. Therefore, as the identification model 200, various models that can realize semantic segmentation can be adopted.
  • a model for example, like the OASIS discriminator disclosed in Non-Patent Document 3, a model composed of an encoder and a decoder can be adopted.
  • FIG. 9 is a diagram illustrating the configuration of the identification model 200.
  • FIG. Encoder 210 takes input image 30 as input and generates a feature map of input image 30 .
  • the decoder 220 acquires the feature map output from the encoder 210 as an input and calculates the identification data 40 from the feature map.
  • both encoder 210 and decoder 220 are composed of multiple resblocks, similar to the OASIS discriminator.
  • a skip connection may also be provided between the encoder 210 and the decoder 220 so that the intermediate output of the encoder 210 is also available to the decoder 220 .
  • the discriminative model 200 may be trained in advance or may be trained together with the image transformation model 100.
  • the model training device 2000 trains the image transformation model 100 and the discrimination model 200 by training a generative adversarial network composed of the image transformation model 100 and the discrimination model 200 . This case is further described below.
  • the acquisition unit 2020 acquires the second training data set 60 and the third training image 70 used for training the discriminative model 200 .
  • a second training data set 60 includes second training images 62 and second class information 64 .
  • the second training image 62 is a true image representing the scene under the second environment.
  • the second training image 62 is generated by actually capturing a scene under the second environment with a camera.
  • Second class information 64 indicates the class of each image region included in second training image 62 .
  • the third training image 70 is an image representing a scene under the first environment.
  • the second training data set 60 is used to obtain a discriminative model 200 that can correctly discriminate classes of true image regions.
  • the training execution unit 2040 obtains identification data 40 by inputting the second training image 62 to the identification model 200 . Then, the training execution unit 2040 uses this identification data 40 and the second class information 64 to calculate the second loss.
  • the identification model 200 can correctly identify the class of each image region included in the second training image 62. That is, it is preferable that the class indicated by the second class information 64 and the class specified by the identification data 40 match each other for all image areas. Therefore, for example, the second loss is made smaller as the class indicated by the identification data 40 for each image region matches the class indicated by the second class information 64 .
  • the third training image 70 is used to obtain a discriminative model 200 that can correctly discriminate false image regions.
  • the training execution unit 2040 obtains the output image 20 by inputting the third training image 70 to the image transformation model 100 . Furthermore, the training execution unit 2040 obtains identification data 40 by inputting the output image 20 to the identification model 200 . Then, the training execution unit 2040 uses this identification data 40 to calculate the third loss.
  • the acquisition unit 2020 further acquires class information corresponding to the third training image 70.
  • the training execution unit 2040 obtains the output image 20 by inputting the third training image 70 and this class information to the image transformation model 100 .
  • the discriminative model 200 preferably can identify each image region included in the third training image 70 as a fake image region. . That is, the identification data 40 obtained using the third training image 70 preferably indicates that all image regions are false image regions. Therefore, for example, the higher the probability that the image area is a false image area indicated by the identification data 40, the smaller the third loss.
  • the training execution unit 2040 uses the second loss calculated using the second training data set 60 and the third loss calculated using the third training image 70, Update the trainable parameters of discriminative model 200 .
  • the training execution unit 2040 calculates the weighted sum of the second loss and the third loss, and updates the trainable parameters of the discriminative model 200 so as to reduce the weighted sum.
  • this weighted sum can be represented by the following equation (3).
  • x2, t2, and x3 represent the second training image 62, the second class information 64, and the third training image 70, respectively.
  • L_D(x2,t2,x3) represents the loss for training the discriminative model 200 calculated using the second training image x2, the second class information t2, and the third training image x3.
  • L2(x2,t2) represents the second loss calculated using the second training image x2 and the second class information t2.
  • L3(x3) represents the third loss calculated using the third training image x3.
  • represents the weight given to the third loss.
  • t2_i,c represents 1 when the class of the image region i is c in the second class information t2, and represents 0 when the class of the image region i is not c in the second class information t2.
  • D(x2) represents the discriminative data 40 output by the discriminative model 200 in response to the input of the second training image x2.
  • D(x2)_i,c represents the probability that the class of image region i indicated by this identification data 40 is c.
  • G(x3) represents the output image 20 output by the image transformation model 100 in response to the input of the third training image x3.
  • D(G(x3)) represents the identification data 40 output by the identification model 200 in response to this output image 20 input.
  • the score vector of identification data 40 indicates the probability that the target image region is a false image region in the N+1th element.
  • the loss L_D for training the discriminative model 200 is also calculated collectively for the plurality of second training data sets 60 and the third training images 70, similarly to the loss L_G for training the image transformation model 100. good too.
  • the loss L_D can be generalized as follows.
  • the set S2 is the set of the second training data set 60 and the set X3 is the set of the third training images 70.
  • the training execution unit 2040 improves the accuracy of both the image transformation model 100 and the discrimination model 200 by repeating both the training of the image transformation model 100 and the training of the discrimination model 200 .
  • the training execution unit 2040 alternately repeats the training of the image transformation model 100 and the training of the discrimination model 200 .
  • the training execution unit 2040 may alternately repeat training of the image transformation model 100 a predetermined number of times and training of the discrimination model 200 a predetermined number of times.
  • the number of times of training the image transformation model 100 and the number of times of training the discrimination model 200 may be different from each other.
  • the model training device 2000 outputs information (hereinafter referred to as output information) that can identify the trained image transformation model 100 as a processing result.
  • the output information includes at least the parameter group of the image transformation model 100 obtained by training. Additionally, the output information may include a program that implements the image conversion model 100 . Moreover, the output information may further include a parameter group of the discriminative model 200 and a program for realizing the discriminative model 200 .
  • the output mode of the output information is arbitrary.
  • the model training device 2000 stores output information in an arbitrary storage unit.
  • the model training device 2000 transmits output information to another device (for example, a device used for operating the image transformation model 100).
  • FIG. 10 is a diagram illustrating a method of calculating patchwise contrastive loss.
  • the training execution unit 2040 obtains the output image 20 by inputting the first training image 52 to the image transformation model 100 . Also, the training execution unit 2040 obtains the first feature map 130 which is the feature map of the first training image 52 calculated by the feature extraction model 110 . Furthermore, the training execution unit 2040 obtains a second feature map 140 that is a feature map of the output image 20 by inputting the output image 20 to the feature extraction model 110 . The training execution unit 2040 uses the first feature map 130 and the second feature map 140 to calculate patchwise contrastive loss.
  • the training execution unit 2040 extracts from the first feature map 130 feature quantities corresponding to each of the positive example patch and one or more negative example patches of the first training image 52 . Also, the training execution unit 2040 extracts the feature amount corresponding to the positive patch of the output image 20 from the second feature map 140 .
  • FIG. 11 is a diagram illustrating positive example patches and negative example patches.
  • Both the positive example patches 522 and the negative example patches 524 are partial image regions of the first training image 52 .
  • the positive patch 22 is an image region representing the same location as the location represented by the positive patch 522 in the partial image region of the output image 20 .
  • the image regions of both the first training image 52 and the output image 20 from which feature amounts are to be extracted are called positive example patches.
  • an image region from which the feature amount is extracted only for the first training image 52 is called a negative example patch.
  • a combination of the positive example patch 522, the negative example patch 524, and the positive example patch 22 is hereinafter referred to as a patch set.
  • the feature amounts included in the first feature map 130 include feature amounts corresponding to each image region of the first training image 52 . Therefore, the training execution unit 2040 extracts feature amounts corresponding to the positive example patches 522 and the negative example patches 524 from the first feature map 130 . Similarly, the training execution unit 2040 extracts feature amounts corresponding to the positive example patches 22 from the second feature map 140 .
  • the training execution unit 2040 generates one or more patch sets for the pair of the first training image 52 and the output image 20. Then, the training execution unit 2040 extracts feature amounts from the first feature map 130 and the second feature map 140 for each patch set.
  • the positions of the positive patch are randomly selected.
  • the training execution unit 2040 is devised to selectively extract positive patch from an image region belonging to a specific class (hereinafter referred to as a specific region).
  • a specific region a specific class
  • “emphasis on” means that the cases in which the positive patch 522 is extracted from the specific region are greater than the cases in which the positive patch 522 is extracted from other partial regions.
  • the image conversion model 100 is used to extend the training data of the detection model illustrated using FIG.
  • the image transformation model 100 is preferably capable of accurately transforming the characteristics of the vehicle under the first environment into the characteristics of the vehicle under the second environment. Therefore, the image conversion model 100 is made to learn the characteristics of the car with emphasis by using the image area of the car as the positive patch.
  • the training execution unit 2040 uses the feature amount corresponding to the positive example patch 522, the feature amount corresponding to the negative example patch 524, and the feature amount corresponding to the positive example patch 22 obtained for each patch set to perform the patchwise contraception. Calculate stib loss.
  • a loss for one patch set is calculated, for example, as a cross-entropy loss represented by Equation (5) below.
  • y(v,vp,vn) represents the cross-entropy loss calculated for the features v,vp,vn.
  • v represents the feature quantity corresponding to the positive example patch 22 .
  • vp represents the feature quantity corresponding to 522;
  • vn represents a set of feature quantities corresponding to the negative example patch 524 .
  • is a temperature parameter in Softmac with temperature, and a constant is set in advance.
  • N represents the total number of negative example patches 524 .
  • vn_k represents a feature quantity corresponding to the k-th negative patch 524;
  • the patchwise contrastive loss is calculated by equation (5) above.
  • the patchwise contrastive loss can be generalized as in Equation (6) below.
  • L_pw(S) represents the patchwise contrastive loss obtained using the set Sp of patch sets.
  • s represents one patch set.
  • v_s represents the feature quantity corresponding to the positive example patch 22 of the patch set s.
  • vp_s represents the feature quantity corresponding to the positive example patch 522 of the patch set s.
  • vn_s represents a set of feature quantities corresponding to the negative patch 524 of the patch set s.
  • the feature extraction model 110 may be configured to perform multistage feature extraction.
  • a feature extraction model 110 may include a convolutional neural network with multiple convolutional layers.
  • the nth convolutional layer generates the (n-1)th Output the n-th feature map by convolving the filter (n is an integer of 2 or more).
  • the feature maps obtained in the intermediate stages are patchwise contrastive. It can be used for loss calculation. That is, multiple feature maps obtained from the first training image 52 and multiple feature maps obtained from the output image 20 can be used to calculate the patchwise contrastive loss.
  • n feature maps can be obtained by obtaining a feature map from each layer. Then, feature amounts corresponding to 522, negative example patches 524, and positive example patches 22 can be extracted from each of the n feature maps. Therefore, the training execution unit 2040 extracts the feature values corresponding to 522, the negative example patch 524, and the positive example patch 22 from each of the n feature maps, and uses the extracted feature values to calculate the patchwise contrast loss. do.
  • the patchwise contrastive loss is represented by the following equation (7), for example.
  • L represents a set of layers for feature extraction
  • l represents one layer.
  • v ⁇ l_s is a feature quantity corresponding to the positive example patch 22 of the patch set s obtained from the feature map output from the l-th layer of the feature extraction model 110 to which the output image 20 is input.
  • vp ⁇ l_s is a feature quantity corresponding to the positive example patch 522 of the patch set s obtained from the feature map output from the l-th layer of the feature extraction model 110 to which the first training image 52 is input.
  • vn ⁇ l_s is a set of feature quantities corresponding to the negative example patches 524 of the patch set s obtained from the feature map output from the l-th layer of the feature extraction model 110 to which the first training image 52 is input.
  • the symbol " ⁇ " represents a superscript.
  • the patchwise contrastive loss may be calculated collectively for a plurality of first training images 52 .
  • the patchwise contrastive loss can be generalized by equation (8) below.
  • X1 represents a set of first training images 52 and x1 represents one first training image 52 selected from the set.
  • the training execution unit 2040 uses one or more first training data sets 50 to calculate the first loss and the patchwise contrastive loss, and uses the overall loss calculated using these to calculate the image Update the conversion model 100.
  • this comprehensive loss is represented by the above-described formula (2).
  • Training executor 2040 generates patch sets for first training image 52 and output image 20 .
  • one patch set includes one positive patch 522 , one or more negative patches 524 and one positive patch 22 .
  • the training execution unit 2040 extracts the positive example patches 522 from the first training image 52, and then extracts one or more negative example patches 524 from a region other than the positive example patches 522 in the first training image 52. and a process of extracting the positive patch 22 from the output image 20 are performed.
  • the training execution unit 2040 detects a specific region from the first training image 52 in order to use it for extracting the positive patch 522 .
  • an existing technique can be used as a technique for detecting an image region of a specific class from the first training image 52 .
  • this "specific class” will be referred to as a "target class”.
  • the target class may be predetermined or may be specified by the user.
  • the training execution unit 2040 acquires information representing the target class, and detects the image region of the target class indicated in the information as the specific region.
  • Information representative of the subject class may be obtained, for example, as a result of user input.
  • the training execution unit 2040 determines whether to extract the positive patch 522 from inside or outside the specific region. This determination is made so that the number of positive example patches 522 extracted from within the specific region is greater than the number of positive example patches 522 extracted from outside the specific region. By doing so, the positive patch 522 is extracted with emphasis from the specific region.
  • the above decisions are made stochastically.
  • a method of stochastically selecting one of the two options in this way for example, a method of sampling values from the Bernoulli distribution and making a decision based on the sample values is conceivable. More specifically, for example, when the sample value is 1, the positive patch 522 is extracted from within the specific region, and when the sample value is 0, the positive patch 522 is extracted from outside the specific region. be done. At this time, by setting the probability that the sample value is 1 to be greater than 50%, the number of positive patch 522 extracted from within the specific region is greater than the number of positive patch 522 extracted from outside the specific region. can be probabilistically increased.
  • the training execution unit 2040 After determining whether to extract the positive patch 522 from inside or outside the specific region, the training execution unit 2040 extracts the positive patch 522 based on the decision.
  • the size of the positive example patch 522 (hereinafter referred to as patch size) is determined in advance.
  • the training execution unit 2040 extracts a patch size region from an arbitrary location in the specific region and treats this region as the positive example patch 522 .
  • the training execution unit 2040 selects a patch size region from an arbitrary location outside the specific region, and determines the selected region as the positive patch 522.
  • Existing technology can be used as a technology for arbitrarily selecting an area of a predetermined size from a certain area.
  • part of the positive patch 522 may be outside the specific region.
  • the positive patch 522 is extracted so as to satisfy the condition that "at least a predetermined percentage of the positive patch 522 is in the specific region".
  • the training execution unit 2040 extracts the positive example patches 522 so that the region that overlaps more with the specific region has a higher probability of being extracted as the positive example patch 522 .
  • the training execution unit 2040 generates an extraction probability map that indicates a higher extraction probability as the overlap rate with the specific region increases.
  • the extraction probability map is a probability indicating the probability that a patch-sized region starting from that pixel (for example, the upper left corner of the positive patch 522) is extracted as the positive patch 522 for each pixel of the first training image 52. Generated as a distribution.
  • the extraction probability map increases the extraction probability for each pixel as the degree of overlap between the patch size region starting from that pixel and the specific region increases. generated as shown. It can also be said that the extraction probability map indicates the probability that each patch-sized partial area included in the first training image 52 is extracted as the positive example patch 522 . The extraction probability of each partial area is set higher as the degree of overlap between the partial area and the specific area increases.
  • the training execution unit 2040 for each pixel of the extraction probability map, generates a value representing the degree of overlap between the patch size region starting from that pixel and the specific region. set. After that, the training execution unit 2040 changes the value of each pixel in the extraction probability map to a value obtained by dividing the value of all pixels.
  • FIG. 12 is a diagram illustrating an extraction probability map.
  • the size of positive patch 522 is 2x2.
  • the size of the specific area 410 is 4x3.
  • Each pixel of the extraction probability map 400 indicates a higher extraction probability as the degree of overlap between the positive patch 522 and the specific region increases when the positive patch 522 is extracted with that pixel as the upper left corner.
  • pixels with higher extraction probabilities are represented by darker dots. Therefore, in FIG. 12, a pixel represented by a darker dot indicates a higher probability that the positive patch 522 is extracted from that pixel as a starting point.
  • the training execution unit 2040 samples pixel coordinates from the probability distribution represented by the extraction probability map, and extracts a patch-sized area starting from the sampled coordinates as a positive example patch 522 .
  • the objects may be classified into smaller sub-classes, and the extraction probability of each pixel in the extraction probability map described above may be determined based on the sub-classes.
  • the target class is cars
  • sub-classes may be set to types such as cars, trucks, or buses.
  • a small class to which an object included in the first training image 52 belongs will be referred to as a subclass.
  • the importance in training the image transformation model 100 may differ for each subclass of objects belonging to the target class. For example, an object in a class that appears infrequently in the first training image 52 is important for training because it is necessary for the image transformation model 100 to learn its features with less training. .
  • the image transformation model 100 is trained such that an image representing the state of a road in the daytime is used as an input image 10, and an output image 20 representing the state of a road in the nighttime is generated from the input image 10. and
  • trucks appear less frequently than passenger cars on the road captured to generate the first training image 52 .
  • the training execution unit 2040 generates an extraction probability map such that the extraction probability of a specific region representing an object belonging to a subclass with a lower appearance frequency in the first training image 52 is higher. For this reason, a higher weight is set for each subclass as its appearance frequency is lower.
  • the training execution unit 2040 For each pixel of the extraction probability map, the training execution unit 2040 sets a value obtained by multiplying the degree of overlap between the pixel and the specific region by a weight corresponding to the subclass of the object represented by the specific region. Then, the training execution unit 2040 changes the value of each pixel to a value obtained by dividing it by the sum of the values of all pixels.
  • the training execution unit 2040 samples pixel coordinates from the probability distribution represented by this extraction probability map, and extracts a patch-sized area starting from the sampled coordinates as a positive example patch 522 .
  • the weight of each subclass may be predetermined or determined by the training execution unit 2040.
  • the training execution unit 2040 performs processing for detecting an object of the target class for each first training image 52 acquired by the acquisition unit 2020 before extracting the positive patch 522, and detects Count the number of objects hit by each subclass. This identifies the number of occurrences of each subclass in the training image set.
  • Training executor 2040 determines the weight of each subclass based on the number of occurrences of each subclass. This weight is determined so that the weight of a subclass with a smaller number of occurrences is greater.
  • the training execution unit 2040 arbitrarily (for example, randomly) extracts a patch size area from the areas included in the first training image 52 other than the area extracted as the positive example patch 522, and converts the area into a negative It is used as an example patch 524 .
  • one patch set may include multiple negative example patches 524 .
  • the number of negative example patches 524 included in one patch set is predetermined.
  • the training execution unit 2040 extracts the positive patch 22 from the position of the output image 20 corresponding to the position on the first training image 52 from which the positive patch 522 was extracted. That is, the same coordinates as the coordinates used as the starting point for extracting the positive patch 522 are used as the coordinates of the pixel used as the starting point for extracting the positive patch 22 .
  • the feature of the object of the target class is learned with particularly high accuracy by extracting the positive patch 522 from the image region of the target class.
  • the method for learning the feature of the object of the target class with high accuracy is not limited to the method of extracting positive example patches 522 from a specific region with emphasis.
  • the model training apparatus 2000 may, in addition to or alternatively to extracting positive patches 522 from a particular region, use features corresponding to positive patches 522 extracted from a particular region to calculate Patch-wise contrastive loss is applied so that the effect of the loss (for example, the cross-entropy loss described above) is greater than the effect of the loss calculated using the feature values corresponding to the positive patch 522 extracted from other regions. Calculate If the method of extracting the positive patch 522 from a specific region is not adopted, for example, the positive patch 522 is extracted from any location of the first training image 52 with the same probability.
  • the loss for example, the cross-entropy loss described above
  • a method of determining the degree of impact of loss based on the feature quantity corresponding to the positive patch 522 will be described below, depending on whether the positive patch 522 is extracted from inside or outside the specific region.
  • the training execution unit 2040 calculates the patchwise contrastive loss using Equation (9) below.
  • Equation (7) the loss calculated for each patch set is multiplied by a weight a when the positive patch 522 included in the patch set is extracted from the specific region, while the patch set has A weight b is applied if the included positive patch 522 is extracted from outside the specific region. Since a>b>0, the effect of loss when the positive patch 522 is extracted from within the specific region is greater than the effect of loss when the positive patch 522 is extracted from outside the specific region. growing.
  • weights similar to w_s may be used to calculate the first loss, second loss, and third loss.
  • these losses can be calculated by, for example, the following equation (10).
  • weights can be set for each layer based on the relationship between the size of the partial region of the input image corresponding to one cell of the feature map and the patch size, or only a specific layer can be weighted. may be weighted. This method will be described below.
  • the size of the partial region of the input image corresponding to one cell of the feature map differs for each feature map (each layer). For example, suppose each layer is convolved with a filter of size 3x3. In this case, one cell of the first feature map corresponds to a subregion of size 3x3 in the input image. Also, one cell in the second feature map corresponds to a set of cells of size 3x3 in the first feature map. Hence, one cell of the second feature map corresponds to a region of size 9x9 in the input image. For similar reasons, one cell of the third feature map corresponds to a region of size 27x27 in the input image. Thus, feature maps generated by later layers correspond to larger subregions of the input image.
  • the negative example patch 524 and the positive example patch 22 are more accurately.
  • the training execution unit 2040 assigns a greater weight to the feature quantity extracted from the feature map for the feature map in which the size of the partial region of the first training image 52 corresponding to one cell is closer to the patch size.
  • the patchwise contrastive loss is calculated using Equation (11) below.
  • z_p is the patch size.
  • z_l is the size of the subregion of the input image (first training image 52 or output image 20) corresponding to one cell of the feature map extracted from the l-th layer.
  • f() is a function that outputs a larger value as the difference between zp and zl is smaller. Note that f()>0.
  • the program includes instructions (or software code) that, when read into a computer, cause the computer to perform one or more functions described in the embodiments.
  • the program may be stored in a non-transitory computer-readable medium or tangible storage medium.
  • computer readable media or tangible storage media may include random-access memory (RAM), read-only memory (ROM), flash memory, solid-state drives (SSD) or other memory technology, CDs - ROM, digital versatile disc (DVD), Blu-ray disc or other optical disc storage, magnetic cassette, magnetic tape, magnetic disc storage or other magnetic storage device.
  • the program may be transmitted on a transitory computer-readable medium or communication medium.
  • transitory computer readable media or communication media include electrical, optical, acoustic, or other forms of propagated signals.
  • (Appendix 1) Acquisition means for acquiring a first training data set including a first training image representing a scene under a first environment and first class information indicating a class of each of a plurality of image regions included in the first training image; Training execution means for training an image transformation model that outputs an image representing a scene under a second environment in response to input of an image representing a scene under the first environment using the first training data set.
  • the training execution means inputs the first training image to the image transformation model, inputs the first output image output from the image transformation model to the identification model, identifies the identification data output from the identification model and the calculating a first loss using the first class information and updating parameters of the image transformation model using the first loss;
  • the identification data indicates whether each of a plurality of partial regions included in the image input to the identification model is a fake image region, and if the partial region is not a fake image is the model trainer, indicating the class of the subdomain.
  • Appendix 2 The model training device according to appendix 1, wherein the first loss is smaller as the number of image regions in which the class indicated by the identification data and the class indicated by the first class information match each other.
  • the model training device includes a feature extraction model that extracts a feature map from the input image, The training execution means inputting the first training image into the image transformation model, obtaining the first output image and a first feature map, which is the feature map of the first training image, from the image transformation model; inputting the first output image to the feature extraction model to obtain a second feature map, which is the feature map of the first output image, from the feature extraction model; Any one of Appendices 1 to 3, wherein both the feature loss calculated using the first feature map and the second feature map and the first loss are used to update parameters of the image transformation model.
  • the training execution means A first positive patch and a first negative patch, which are partial regions of the first training image, and a second positive patch, which is a partial region at a position corresponding to the first positive patch in the first output image.
  • the training execution means In generating the patch set, extracting the first positive patch from among the regions included in the first training image, focusing on a specific region belonging to a specific class, or The loss effect calculated for the patch set containing the first positive patch extracted from within the specific region is calculated for the patch set containing the first positive patch extracted from outside the specific region. 5.
  • the model training device according to appendix 4, wherein the feature loss is calculated to be greater than the calculated loss effect.
  • the acquisition means comprises a second training data set including a second training image representing a scene under the first environment and second class information indicating a class of each of a plurality of image regions included in the second training image; and obtaining a third training image representing the scene under the second environment;
  • the training execution means A second output image obtained by inputting the second training image to the image transformation model is input to the identification model, and the identification data output from the identification model and the second class information are used to perform a second output image. 2 Calculate the loss, inputting the third training image to the discriminative model and calculating a third loss using the discriminative data output from the discriminative model; 6.
  • a computer implemented model training method comprising: an obtaining step of obtaining a first training data set including a first training image representing a scene under a first environment and first class information indicating a class of each of a plurality of image regions included in the first training image; A training execution step of training an image transformation model that outputs an image representing a scene under a second environment in response to an input of an image representing a scene under the first environment using the first training data set.
  • the first training image is input to the image transformation model
  • the first output image output from the image transformation model is input to the identification model
  • the identification data indicates whether each of a plurality of partial regions included in the image input to the identification model is a fake image region, and if the partial region is not a fake image is the model training method, indicating the class of that subdomain.
  • Appendix 8 8. The model training method according to appendix 7, wherein the first loss is smaller as the number of image regions in which the class indicated by the identification data and the class indicated by the first class information match each other.
  • the model training method according to appendix 8, wherein in the training execution step, an image region belonging to a specific class is given a greater weight than an image region not belonging to the specific class to calculate the first loss.
  • the image transformation model includes a feature extraction model that extracts a feature map from the input image, In the training execution step, inputting the first training image into the image transformation model, obtaining the first output image and a first feature map, which is the feature map of the first training image, from the image transformation model; inputting the first output image to the feature extraction model to obtain a second feature map, which is the feature map of the first output image, from the feature extraction model; Using both the feature loss calculated using the first feature map and the second feature map and the first loss to update parameters of the image transformation model, any one of appendices 7 to 9
  • a first positive patch and a first negative patch, which are partial regions of the first training image, and a second positive patch, which is a partial region at a position corresponding to the first positive patch in the first output image. generate one or more patchsets that are sets, Extracting a feature quantity corresponding to each of the first positive example patch and the first negative example patch from the first feature map, extracting a feature quantity corresponding to the second positive example patch from the second feature map, calculating the feature loss using each of the extracted feature amounts;
  • In the training execution step In the training execution step, In generating the patch set, extracting the first positive patch from among the regions included in the first training image, focusing on a specific region belonging to a specific class, or The loss effect calculated for the patch set containing the first positive patch extracted from within the specific region is calculated for the patch set containing the first positive patch extracted from outside the specific region.
  • a model training method according to any one of clauses 7 to 11, wherein the second loss and the third loss are used to update parameters of the discriminative model.
  • Appendix 13 to the computer, an obtaining step of obtaining a first training data set including a first training image representing a scene under a first environment and first class information indicating a class of each of a plurality of image regions included in the first training image;
  • a training execution step of training an image transformation model that outputs an image representing a scene under a second environment in response to an input of an image representing a scene under the first environment using the first training data set.
  • the first training image is input to the image transformation model
  • the first output image output from the image transformation model is input to the identification model
  • the identification data indicates whether each of a plurality of partial regions included in the image input to the identification model is a fake image region, and if the partial region is not a fake image is a non-transitory computer-readable medium that indicates the class of the subregion.
  • the image transformation model includes a feature extraction model that extracts a feature map from the input image, In the training execution step, inputting the first training image into the image transformation model, obtaining the first output image and a first feature map, which is the feature map of the first training image, from the image transformation model; inputting the first output image to the feature extraction model to obtain a second feature map, which is the feature map of the first output image, from the feature extraction model; Any one of appendices 13 to 15, wherein both the feature loss calculated using the first feature map and the second feature map and the first loss are used to update parameters of the image transformation model.
  • a first positive patch and a first negative patch which are partial regions of the first training image
  • a second positive patch which is a partial region at a position corresponding to the first positive patch in the first output image.
  • a second training data set including a second training image representing a scene under the first environment and second class information indicating a class of each of a plurality of image regions included in the second training image; and obtaining a third training image representing the scene under the second environment;
  • a second output image obtained by inputting the second training image to the image transformation model is input to the identification model, and the identification data output from the identification model and the second class information are used to perform a second output image. 2

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

モデル訓練装置(2000)は、第1環境下のシーンを表す第1訓練画像(52)と、第1訓練画像(52)に含まれる複数の画像領域それぞれのクラスを示す第1クラス情報(54)とを含む第1訓練データセット(50)を取得する。モデル訓練装置(2000)は、画像変換モデル(100)に対して第1訓練画像(52)を入力して、第2環境下のシーンを表す出力画像(20)を取得し、その出力画像(20)を識別モデル(200)に入力して、識別データ(40)を取得し、識別データ(40)と第1クラス情報(54)を用いて画像変換モデル(100)を訓練する。識別データ(40)は、識別モデル(200)に入力された画像に含まれる複数の部分領域それぞれについて、その部分領域が偽の画像領域であるか否かを示し、かつ、その部分領域が偽の画像でない場合にはその部分領域のクラスを示す。

Description

モデル訓練装置、モデル訓練方法、及び非一時的なコンピュータ可読媒体
 本開示は、画像の変換を行うモデルを訓練する技術に関する。
 入力された画像に基づいて別の画像を生成するモデル、すなわち、画像の変換を行うモデルが開発されている。例えば非特許文献1には、馬の画像をシマウマの画像に変換するなどのように、入力画像を別のクラスの画像に変換するモデルが開示されている。
Taesung Park、Alexei A. Efros、Richard Zhang、及び Jun-Yan Zhu、「Contrastive Learning for Unpaired Image-to-Image Translation」、[online]、2020年8月20日、arXiv、[2022年1月31日検索]、インターネット<URL: https://arxiv.org/pdf/2007.15651.pdf> Taesung Park、Ming-Yu Liu、Ting-Chun Wang、及び Jun-Yan Zhu、「Semantic Image Synthesis with Spatially-Adaptive Normalization」、2019年11月5日、arXiv、[2022年1月31日検索]、インターネット<URL: https://arxiv.org/pdf/1903.07291.pdf> Vadim Sushko、Edgar Schonfeld、Dan Zhang、Juergen Gall、Bernt Schiele、及び Anna Khoreva、「You Only Need Adversarial Supervision for Semantic Image Synthesis」、[online]、2021年3月19日、arXiv、[2022年1月31日検索]、インターネット<URL: https://arxiv.org/pdf/2012.04781.pdf> Jun-Yan Zhu、Taesung Park、Phillip Isola、及び Alexei A. Efros、「Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks」、2020年8月24日、arXiv、[2022年1月31日検索]、インターネット<URL: https://arxiv.org/pdf/2007.15651.pdf>
 非特許文献1では、画像の変換の際に、物体のクラスが変換されてしまう。本開示は上記の課題に鑑みてなされたものであり、その目的の一つは、画像の変換を行うモデルを訓練するための新たな技術を提供することである。
 本開示のモデル訓練装置は、第1環境下のシーンを表す第1訓練画像と、前記第1訓練画像に含まれる複数の画像領域それぞれのクラスを示す第1クラス情報とを含む第1訓練データセットを取得する取得手段と、前記第1訓練データセットを用いて、前記第1環境下のシーンを表す画像が入力されたことに応じて第2環境下のシーンを表す画像を出力する画像変換モデルの訓練を行う訓練実行手段と、を有する。
 前記訓練実行手段は、前記第1訓練画像を前記画像変換モデルに入力し、前記画像変換モデルから出力された第1出力画像を識別モデルに入力し、前記識別モデルから出力された識別データと前記第1クラス情報とを用いて第1損失を算出し、前記第1損失を用いて前記画像変換モデルのパラメータを更新する。
 前記識別データは、前記識別モデルに入力された画像に含まれる複数の部分領域それぞれについて、その部分領域が偽の画像領域であるか否かを示し、かつ、その部分領域が偽の画像でない場合にはその部分領域のクラスを示す。
 本開示のモデル訓練方法は、コンピュータによって実行される。当該モデル訓練方法は、第1環境下のシーンを表す第1訓練画像と、前記第1訓練画像に含まれる複数の画像領域それぞれのクラスを示す第1クラス情報とを含む第1訓練データセットを取得する取得ステップと、前記第1訓練データセットを用いて、前記第1環境下のシーンを表す画像が入力されたことに応じて第2環境下のシーンを表す画像を出力する画像変換モデルの訓練を行う訓練実行ステップと、を有する。
 前記訓練実行ステップにおいて、前記第1訓練画像を前記画像変換モデルに入力し、前記画像変換モデルから出力された第1出力画像を識別モデルに入力し、前記識別モデルから出力された識別データと前記第1クラス情報とを用いて第1損失を算出し、前記第1損失を用いて前記画像変換モデルのパラメータを更新する。
 前記識別データは、前記識別モデルに入力された画像に含まれる複数の部分領域それぞれについて、その部分領域が偽の画像領域であるか否かを示し、かつ、その部分領域が偽の画像でない場合にはその部分領域のクラスを示す。
 本開示のコンピュータ可読媒体は、本開示のモデル訓練方法をコンピュータに実行させるプログラムを格納している。
 本開示によれば、画像の変換を行うモデルを訓練するための新たな技術が提供される。
モデル訓練装置によって訓練される画像変換モデルの概要を例示する図である。 識別モデルの概要を例示する図である。 モデル訓練装置の概要を例示する図である。 モデル訓練装置の機能構成を例示するブロック図である。 モデル訓練装置を実現するコンピュータのハードウエア構成を例示するブロック図である。 モデル訓練装置によって実行される処理の流れを例示するフローチャートである。 画像変換モデルを用いたデータ拡張の効果を例示する図である。 画像変換モデルの構成を例示する図である。 識別モデルの構成を例示する図である。 正例パッチと負例パッチを例示する図である。 パッチワイズコントラスティブ損失の算出方法を例示する図である。 抽出確率マップを例示する図である。
 以下では、本開示の実施形態について、図面を参照しながら詳細に説明する。各図面において、同一又は対応する要素には同一の符号が付されており、説明の明確化のため、必要に応じて重複説明は省略される。また、特に説明しない限り、所定値や閾値などといった予め定められている値は、その値を利用する装置からアクセス可能な記憶装置などに予め格納されている。さらに、特に説明しない限り、記憶部は、1つ以上の任意の数の記憶装置によって構成される。
<概要>
 図1は、本実施形態のモデル訓練装置によって訓練される画像変換モデルの概要を例示する図である。画像変換モデル100は、入力画像10が入力されたことに応じて、出力画像20を出力する。入力画像10は、画像変換モデル100に対して入力される画像である。出力画像20は、画像変換モデル100から出力される画像である。例えば画像変換モデル100は、任意の機械学習モデル(例えばニューラルネットワーク)として実現される。
 画像変換モデル100は、「入力画像10として、第1環境下のシーンを表す画像が入力された場合に、出力画像20として、第1環境とは異なる第2環境下におけるそのシーンを表す画像を出力する」という処理を行うように訓練される。これにより、画像変換モデル100は、ある特定の環境下で撮像されたシーンの画像から、別の環境下で当該シーンが撮像された画像を擬似的に生成することができるようになる。
 例えば第1環境が昼間であり、第2環境が夜間であるとする。また、入力画像10が、特定の道路をカメラで撮像することで得られた画像であるとする。ここで、夜間の道路の様子は、全体的に暗いという点、車のライトや街灯などといった種々のライトが点灯しているという点、ライトに照らされている場所が他の場所と比較して明るいという点などにおいて、昼間の道路の様子とは異なる。画像変換モデル100は、このような夜間の道路の特徴を擬似的に再現するように、昼間の道路の様子が撮像された画像から、夜間の道路の様子が撮像された画像を生成する。これにより、例えば後述するように、データ拡張(data augmentation)を実現することができる。
 なお、環境は、昼間や夜間などといった時間帯に限定されない。例えば環境の他の例としては、天候に関する環境が挙げられる。例えば第1環境が晴れであり、第2環境が雨であるとする。この場合、画像変換モデル100は、晴天下のシーンを表す入力画像10から、雨天下のそのシーンを表す出力画像20を生成する。なお、雨の代わりに、雪などの天候を採用することもできる。
 さらに画像変換モデル100は、入力画像10から出力画像20を生成する際、第1環境から第2環境という環境の変換は行うものの、各画像領域のクラスの変換は行わないように訓練される。画像領域のクラスは、例えば、その画像領域に含まれるオブジェクトの種類で表される。そのため例えば、入力画像10において車を表している画像領域が、出力画像20においても車を表すように、入力画像10から出力画像20への変換が行われる。このように画像変換モデル100を訓練することにより、入力画像10から出力画像20への変換を行う際に、環境の変換は行いつつも、車などといった所定の種類のオブジェクトが消失しないようにすることができる。なお、オブジェクトの消失を防ぐことの重要性については後述する。
 画像変換モデル100の訓練は、識別モデルを利用して行われる。図2は、識別モデル200の概要を例示する図である。例えば識別モデル200は、任意の機械学習モデル(例えばニューラルネットワーク)として実現される。
 識別モデル200は、入力画像30に含まれる複数の画像領域それぞれについて、その画像領域が、第2環境下のシーンを表す真の画像領域であるか否かを識別する。ここで、真の画像領域とは、画像変換モデル100によって生成された画像領域ではない(すなわち、擬似的に生成された画像領域ではない)画像領域を意味する。また、識別モデル200は、真の画像領域については、その画像領域のクラスを識別する。以下、画像変換モデル100によって生成された画像(すなわち、擬似的な画像)と、画像変換モデル100によって生成されたものではない画像とをそれぞれ、「偽の画像」及び「真の画像」と表記する。また、真の画像領域ではない画像領域のことを、「偽の画像領域」と表記する。
 識別データ40は、識別モデル200による識別の結果を表す。例えば識別データ40は、入力画像10に含まれる複数の画像領域それぞれについて、各クラスに属する真の画像領域である確率、及び偽の画像領域である確率を示す。例えば、クラスとして C1 から Cn の n 種類が用意されているとする。この場合、識別データ40は、入力された画像に含まれる複数の画像領域それぞれについて、(N+1)次元のベクトル(以下、スコアベクトル)を示す。スコアベクトルは、対応する画像領域がクラス C1 から CN それぞれに属する真の画像領域である確率、及び、対応する画像領域が偽の画像領域である確率を示す。例えばスコアベクトルは、対応する画像領域がクラス Ci(1<=i<=n)に属する真の画像領域である確率をi番目の要素に示し、対応する画像領域が偽の画像領域である確率を N+1 番目の要素に示す。
 識別モデル200が識別対象とする画像領域は、1つのピクセルであってもよいし、複数のピクセルで構成される領域であってもよい。前者の場合、識別モデル200は、入力画像10の各ピクセルについて、真偽の識別及びクラスの識別を行う。一方、後者の場合、例えば識別モデル200は、入力画像10を所定サイズの複数の画像領域に分割し、各画像領域を対象として、真偽の識別及びクラス識別を行う。
 上述した画像変換モデル100と識別モデル200の構成を前提として、本実施形態のモデル訓練装置2000の動作の概要について説明する。図3は、本実施形態のモデル訓練装置2000の概要を例示する図である。ここで、図3は、モデル訓練装置2000の概要の理解を容易にするための図であり、モデル訓練装置2000の動作は、図1に示したものに限定されない。
 モデル訓練装置2000は、第1訓練データセット50を取得する。第1訓練データセット50は第1訓練画像52及び第1クラス情報54を含む。第1訓練画像52は、第1環境下のシーンを表す画像である。第1クラス情報54は、第1訓練画像52に含まれる複数の画像領域それぞれのクラスを示す。
 モデル訓練装置2000は、画像変換モデル100に対し、第1訓練データセット50を入力画像10として入力することにより、画像変換モデル100から出力画像20を得る。さらに識別モデル200は、この出力画像20を識別モデル200に入力する。その結果、モデル訓練装置2000は、出力画像20に含まれる各画像領域についての識別結果を表す識別データ40を得る。
 ここで、画像変換モデル100は、前述したように、環境の変換は行うものの、クラスの変換は行わないことが望ましい。そのため、出力画像20の各画像領域が、「真の画像領域であり、かつ、対応する入力画像10の画像領域と同じクラスに属する」と識別モデル200によって識別されるように、画像変換モデル100を訓練することが好適である。すなわち、識別データ40によって特定される各画像領域のクラスが、第1クラス情報54によって示される各画像領域のクラスと一致するように、画像変換モデル100を訓練することが好適である。
 そこでモデル訓練装置2000は、識別データ40と第1クラス情報54との差異の大きさを表す第1損失を算出し、第1損失を小さくするように画像変換モデル100を訓練する。具体的には、モデル訓練装置2000は、第1損失を小さくするように、画像変換モデル100に含まれる訓練可能なパラメータ(例えば、ニューラルネットワークの各重み)を更新する。
 なお、識別データ40によって特定される画像領域のクラスは、例えば、前述したスコアベクトルにおいて値が最大の要素に対応するクラスである。なお、スコアベクトルにおいて値が最大の要素が偽の画像領域に対応する場合、そのスコアベクトルは、対応する画像領域が偽の画像領域であることを示す。
<作用効果の例>
 非特許文献1の手法では、馬の画像をシマウマの画像に変換するというように、画像全体でクラスの変換が行われる。そのため、非特許文献1の手法では、画像全体が表すシーンの環境を変換しつつも、各画像領域のクラス(例えば物体の種類)は維持するといった画像変換はできない。このような画像変換の例としては、車が走っている昼の道路の画像を、車が走っている夜の画像に変換するという画像変換が考えられる。この画像変換では、画像全体が表すシーンの環境を昼から夜に変換しつつ、変換前の画像で車を表している画像領域が、変換後の画像領域でも車を表すようにする必要がある。
 この点、モデル訓練装置2000は、画像変換モデル100から得られた出力画像20を識別モデル200へ入力し、識別モデル200から得られた識別データ40と第1クラス情報54とを用いて、画像変換モデル100を訓練する。これにより、「各画像領域のクラスを維持したまま、第1環境下のシーンから第2環境下のシーンへ変換する」という機能を持つ画像変換モデル100を得ることができる。
 以下、本実施形態のモデル訓練装置2000について、より詳細に説明する。
<機能構成の例>
 図4は、本実施形態のモデル訓練装置2000の機能構成を例示するブロック図である。モデル訓練装置2000は、取得部2020及び訓練実行部2040を有する。取得部2020は第1訓練データセット50を取得する。訓練実行部2040は、第1訓練データセット50を利用して画像変換モデル100の訓練を行う。具体的には、訓練実行部2040は、第1訓練画像52を画像変換モデル100に入力して、画像変換モデル100から出力画像20を得る。さらに訓練実行部2040は、出力画像20を識別モデル200に入力して、識別モデル200から識別データ40を得る。そして訓練実行部2040は、識別データ40と第1クラス情報54との差異の大きさを表す第1損失を算出し、第1損失を用いて画像変換モデル100を更新する。
<ハードウエア構成の例>
 モデル訓練装置2000の各機能構成部は、各機能構成部を実現するハードウエア(例:ハードワイヤードされた電子回路など)で実現されてもよいし、ハードウエアとソフトウエアとの組み合わせ(例:電子回路とそれを制御するプログラムの組み合わせなど)で実現されてもよい。以下、モデル訓練装置2000の各機能構成部がハードウエアとソフトウエアとの組み合わせで実現される場合について、さらに説明する。
 図5は、モデル訓練装置2000を実現するコンピュータ1000のハードウエア構成を例示するブロック図である。コンピュータ1000は、任意のコンピュータである。例えばコンピュータ1000は、PC(Personal Computer)やサーバマシンなどといった、据え置き型のコンピュータである。その他にも例えば、コンピュータ1000は、スマートフォンやタブレット端末などといった可搬型のコンピュータである。コンピュータ1000は、モデル訓練装置2000を実現するために設計された専用のコンピュータであってもよいし、汎用のコンピュータであってもよい。
 例えば、コンピュータ1000に対して所定のアプリケーションをインストールすることにより、コンピュータ1000で、モデル訓練装置2000の各機能が実現される。上記アプリケーションは、モデル訓練装置2000の各機能構成部を実現するためのプログラムで構成される。なお、上記プログラムの取得方法は任意である。例えば、当該プログラムが格納されている記憶媒体(DVD ディスクや USB メモリなど)から、当該プログラムを取得することができる。その他にも例えば、当該プログラムが格納されている記憶装置を管理しているサーバ装置から、当該プログラムをダウンロードすることにより、当該プログラムを取得することができる。
 コンピュータ1000は、バス1020、プロセッサ1040、メモリ1060、ストレージデバイス1080、入出力インタフェース1100、及びネットワークインタフェース1120を有する。バス1020は、プロセッサ1040、メモリ1060、ストレージデバイス1080、入出力インタフェース1100、及びネットワークインタフェース1120が、相互にデータを送受信するためのデータ伝送路である。ただし、プロセッサ1040などを互いに接続する方法は、バス接続に限定されない。
 プロセッサ1040は、CPU(Central Processing Unit)、GPU(Graphics Processing Unit)、又は FPGA(Field-Programmable Gate Array)などの種々のプロセッサである。メモリ1060は、RAM(Random Access Memory)などを用いて実現される主記憶装置である。ストレージデバイス1080は、ハードディスク、SSD(Solid State Drive)、メモリカード、又は ROM(Read Only Memory)などを用いて実現される補助記憶装置である。
 入出力インタフェース1100は、コンピュータ1000と入出力デバイスとを接続するためのインタフェースである。例えば入出力インタフェース1100には、キーボードなどの入力装置や、ディスプレイ装置などの出力装置が接続される。
 ネットワークインタフェース1120は、コンピュータ1000をネットワークに接続するためのインタフェースである。このネットワークは、LAN(Local Area Network)であってもよいし、WAN(Wide Area Network)であってもよい。
 ストレージデバイス1080は、モデル訓練装置2000の各機能構成部を実現するプログラム(前述したアプリケーションを実現するプログラム)を記憶している。プロセッサ1040は、このプログラムをメモリ1060に読み出して実行することで、モデル訓練装置2000の各機能構成部を実現する。
 モデル訓練装置2000は、1つのコンピュータ1000で実現されてもよいし、複数のコンピュータ1000で実現されてもよい。後者の場合において、各コンピュータ1000の構成は同一である必要はなく、それぞれ異なるものとすることができる。
<処理の流れ>
 図6は、本実施形態のモデル訓練装置2000によって実行される処理の流れを例示するフローチャートである。取得部2020は第1訓練データセット50を取得する(S102)。訓練実行部2040は、第1訓練画像52を画像変換モデル100に入力する(S104)。訓練実行部2040は、画像変換モデル100から出力された出力画像20を識別モデル200に入力する(S106)。訓練実行部2040は、識別モデル200から出力された識別データ40と第1クラス情報54との差異の大きさに基づく第1損失を算出する(S108)。訓練実行部2040は、第1損失を用いて画像変換モデル100を更新する(S110)。
 なお、モデル訓練装置2000は、複数の第1訓練データセット50を取得し、それら複数の第1訓練データセット50を利用して画像変換モデル100の更新を繰り返し行うことで、画像変換モデル100を訓練する。
<画像変換モデル100の利用例>
 モデル訓練装置2000の有用性の理解を容易にするため、画像変換モデル100の利用シーンを例示する。ここで説明する利用シーンは例示であり、モデル訓練装置2000の利用シーンは以下で説明する例に限定されない。
 利用シーンとして、道路を撮像する監視カメラから得られたビデオデータが、車の監視に利用されるケースを想定する。車の監視は、監視装置を用いて、ビデオデータの各ビデオフレームから車を検出することによって行われる。監視装置は、画像から車を検出するように予め訓練された検出モデルを有する。
 ここで、画像における物体の見え方(物体の画像特徴)は、その物体が撮像された環境によって異なりうる。例えば、昼間に撮像された車と夜間に撮像された車とでは、その見え方が互いに異なる。また、晴天時に撮像された車と雨天時に撮像された車とでも、その見え方が互いに異なる。
 車の監視に利用される検出モデルは、このような環境の変化にロバストであることが好適である。すなわち、検出モデルは、時間帯や天候によらずに、各ビデオフレームから車を検出できるように訓練される必要がある。そのためには、様々な環境下で撮像された道路の画像を訓練画像として用いて、検出モデルを訓練する必要がある。
 この点、訓練画像を入手する容易さは、環境ごとに異なりうる。例えば、夜間は昼間と比較して車の数が少ないため、夜間の道路の車が撮像された画像は、昼間の道路の車が撮像された画像と比較して、監視カメラから入手できる数が少ない。また、晴れが多い場所では、雨や雪などといった晴天時以外の道路の車が撮像された画像は、晴天時の道路の車が撮像された画像と比較して、監視カメラから入手できる数が少ない。このように入手できる画像の数が環境ごとに異なることに起因し、監視カメラから入手できる画像だけを利用して検出モデルの訓練を行うと、夜間や雨天などといった環境下の車の検出精度が低くなってしまう。
 そこで、モデル訓練装置2000によって訓練された画像変換モデル100を利用して、入手が容易な環境の画像を利用したデータ拡張を行うことにより、入手が難しい環境の画像を擬似的に生成する。例えば画像変換モデル100が、昼間の道路における車の画像が入力画像10として入力されたことに応じて、夜間の道路における車の画像が出力画像20として出力されるように、モデル訓練装置2000によって予め訓練されているとする。図7は、画像変換モデル100を用いたデータ拡張の効果を例示する図である。
 図7の上段は、画像変換モデル100によるデータ拡張を行わず、監視カメラから得られた画像だけを利用して検出モデルの訓練が行われるケースを表している。このケースでは、夜間の車が撮像された訓練画像の数が不十分であるため、夜間の車の検出精度が低くなってしまう。
 一方、図7の下段は、画像変換モデル100によるデータ拡張が行われるケースを例示している。ユーザは、監視カメラから得られた昼間の道路における車の画像を画像変換モデル100に入力することで、夜間の道路における車を擬似的に表す画像を得る。こうすることによって、昼間の道路における車の画像と同等の数だけ、夜間の道路における車の画像を得ることができる。このように画像変換モデル100を利用して得た画像も訓練画像として用いて検出モデルの訓練を行うことで、夜間の車も精度良く検出できる検出モデルを生成することができる。すなわち、環境の変化にロバストな検出モデルを生成することができる。
 ここで、検出モデルを訓練するためには、訓練画像に加え、その訓練画像のどの部分に車が位置しているのかを示す情報も必要となる。この情報は、訓練画像に含まれる各画像領域について、車とそれ以外という2種類のクラスのどちらに属するかを示すクラス情報と見ることができる。ただし、検出モデルが車だけでなく、その他の種類の物体(例えば人や道路など)も検出できるようにする場合には、それらの種類もクラス情報によって示されるようにする。
 ここで、画像変換モデル100を利用して生成された画像について、クラス情報の生成を手動で行わなければならないとすると、画像変換モデル100を利用したデータ拡張(訓練データセットの生成)に多くの時間を要することになってしまう。この点、入力画像10の各画像領域のクラスと、出力画像20の各画像領域のクラスとが互いに一致するのであれば、出力画像20のクラス情報として、入力画像10のクラス情報をそのまま流用できる。よって、画像変換モデル100を利用したデータ拡張に要する時間を大きく削減することができる。そこで前述したように、画像変換モデル100は、環境の変換をするものの、クラスの変換は行わないように訓練される。
<クラスについて>
 モデル訓練装置2000によって扱われる画像領域のクラスの種類は、画像変換モデル100によって扱われる画像が表すシーンの特徴などに応じて、任意に設定することができる。例えば画像領域は、画像変換モデル100によって扱われる画像に含まれうる所定の物体と、それ以外という、2つのクラスに分類される。例えば所定の物体が車である場合、第1クラス情報54は、車を表す画像領域には「車」というクラスを示し、車以外を表す画像領域には「車以外」というクラスを示す。
 所定の物体としては、複数の種類の物体が扱われてもよい。例えば、車をさらに細かく分類することが考えられる。具体的には、「普通車」、「バス」、「トラック」、「バイク」、及び「自転車」などといったクラスを設けることが考えられる。その他にも例えば、「道路」、「建物」、又は「人」などのように、車以外のクラスがさらに設けられてもよい。なお、道路というクラスを設ける場合、車の進行方向に応じて道路がさらに分類されてもよい。
<画像変換モデル100の構成>
 例えば画像変換モデル100は、入力画像10から特徴を抽出し、抽出した特徴に基づいて出力画像20を生成するように構成される。図8は、画像変換モデル100の構成を例示する図である。画像変換モデル100は、特徴抽出モデル110及び画像生成モデル120という2つのモデルを含む。特徴抽出モデル110は、入力画像10から特徴マップを抽出するように構成される。ここで、画像から抽出される特徴マップは、画像に含まれる複数の部分領域それぞれから得られる特徴量の集合である。画像生成モデル120は、特徴マップから出力画像20を生成するように構成される。
 特徴抽出モデル110及び画像生成モデル120はいずれも、任意の種類の機械学習モデルとして構成される。例えば特徴抽出モデル110及び画像生成モデル120はいずれも、ニューラルネットワークで構成される。
 なお、画像変換モデル100は、出力画像20の生成に、入力画像10に対応するクラス情報を利用してもよい。この場合、例えば画像変換モデル100は、第1訓練画像52から出力画像20を生成する際に、第1クラス情報54をさらに利用する。例えば第1訓練画像52は、画像生成モデル120に対して入力される。ここで、画像を生成するモデルにおいてクラスの情報を利用する技術には、例えば、非特許文献2に開示されている技術を利用することができる。
<第1訓練データセット50の取得:S102>
 取得部2020は第1訓練データセット50を取得する(S102)。取得部2020が第1訓練データセット50を取得する方法は様々である。例えば第1訓練データセット50は、予め、モデル訓練装置2000から取得可能な態様で、任意の記憶装置に格納されている。この場合、取得部2020は、当該記憶装置から第1訓練データセット50を読み出す。その他にも例えば、取得部2020は、他の装置から送信された第1訓練データセット50を受信することで、第1訓練データセット50を取得してもよい。
<画像変換モデル100の訓練:S104~S110>
 訓練実行部2040は、第1訓練データセット50を用いて画像変換モデル100の訓練を行う。前述したように、訓練実行部2040は、第1訓練画像52を画像変換モデル100に入力し(S104)、画像変換モデル100から出力される出力画像20を識別モデル200に入力する(S106)。さらに訓練実行部2040は、識別モデル200から出力される識別データ40と第1クラス情報54との差異の大きさを表す第1損失を算出し、第1損失を用いて画像変換モデル100を更新する。なお、損失に基づいてモデルのパラメータを更新する具体的な方法には、既存の種々の手法を利用することができる。
 ここで、第1損失を算出するための損失関数(以下、第1損失関数)としては、識別データ40と第1クラス情報54との差異の大きさを表すことができる種々の関数を利用することができる。例えば第1損失関数としては、以下の式(1)を利用することができる。
Figure JPOXMLDOC01-appb-M000001
 ここで、x1 と t1 はそれぞれ、第1訓練画像52と第1クラス情報54を表す。L1(x1,t) は第1訓練画像 x1 と第1クラス情報 t1 を利用して算出された第1損失を表す。c はクラスの識別子を表す。N はクラスの総数を表す。α_c は、識別子 c のクラスに与える重みを表す。なお、この重みの算出方法は非特許文献3に開示されている。また、記号「_」は下付き文字を表している。i は識別対象の画像領域の識別子を表す。Mは出力画像20に含まれる画像領域の総数を表す。例えば、各ピクセルが画像領域として扱われ、出力画像20における縦方向と横方向のピクセル数がそれぞれ H と W である場合、M=H*W となる。t1_i,c は、第1クラス情報 t1 において画像領域 i のクラスが c である場合には1を示し、第1クラス情報 t1 において画像領域 i のクラスが c でない場合には0を示す。G(x1) は、第1訓練画像 x1 を画像変換モデル100に入力することで生成された出力画像20を表す。なお、画像変換モデル100に第1訓練画像52も入力される場合、G(x1) の代わりに G(x1,t1) が用いられる。D(G(x1))は、出力画像20が入力されたことに応じて識別モデル200が出力した識別データ40を表す。D(G(x1))_i,cは、識別データ40において、画像領域 i に対応するスコアベクトルがクラス c について示す値である。すなわち、識別モデル200によって算出された、出力画像20の画像領域 i のクラスが c である確率を表す。
 訓練実行部2040は、第1訓練画像52と出力画像20との差異に基づく損失をさらに算出し、当該損失と前述した第1損失の双方に基づいて画像変換モデル100の更新を行ってもよい。例えばこの場合、訓練実行部2040は、これら2つの損失の重み付き和として総合的な損失を算出し、当該総合的な損失が小さくなるように、画像変換モデル100を更新する。
 第1訓練画像52と出力画像20との差異に基づく損失としては、例えば、非特許文献1に開示されているパッチワイズコントラスティブ損失(patchwise contrastive loss)や、非特許文献4に開示されているサイクルコンシステンシー損失(cycle consistency loss)などを利用することができる。しかしながら、第1訓練画像52と出力画像20との差異に基づく損失は、これらの非特許文献に開示されているものに限定されない。また、パッチワイズコントラスティブ損失を利用する際には、後述する工夫が施されてもよい。
 なお、損失は、複数の第1訓練データセット50についてまとめて算出されてもよい。この場合、画像変換モデル100を訓練するための損失は、例えば以下の式で一般化することができる。
Figure JPOXMLDOC01-appb-M000002
 ここで、集合 S1 は第1訓練データセット50の集合である。L_G(S1) は、集合 S1 を利用して算出される損失である。L_d(x1) は、第1訓練画像 x1 とこの x1 を画像変換モデル100に入力することで得られた出力画像20との差分に基づく算出である。例えば L_d としては、後述するパッチワイズコントラスティブ損失 L_pw を利用することができる。β は、第1損失に与える重みである。
<識別モデル200について>
 前述したように、識別モデル200は、入力された画像に含まれる複数の画像領域それぞれについて、その画像領域の真偽及びクラスを識別する。ここで、「偽の画像領域である」を1つのクラスとして扱えば、識別モデル200は、入力された画像に含まれる複数の画像領域それぞれについてクラスの識別を行うモデル、すなわち、セマンティックセグメンテーションを行うモデルと見ることができる。そのため、識別モデル200としては、セマンティックセグメンテーションを実現可能な種々のモデルを採用することができる。このようなモデルとしては、例えば非特許文献3に開示されている OASIS discriminator と同様に、エンコーダとデコーダで構成するモデルを採用することができる。
 図9は、識別モデル200の構成を例示する図である。エンコーダ210は、入力画像30を入力として取得し、入力画像30の特徴マップを生成する。デコーダ220は、エンコーダ210から出力された特徴マップを入力として取得し、当該特徴マップから識別データ40を算出する。例えばエンコーダ210とデコーダ220はいずれも、OASIS discriminator と同様に、複数の resblock で構成される。また、エンコーダ210の中間出力をデコーダ220でも活用できるようにするために、エンコーダ210とデコーダ220との間にスキップコネクションが設けられてもよい。
 識別モデル200は、事前に訓練されていてもよいし、画像変換モデル100と共に訓練されてもよい。後者の場合、例えばモデル訓練装置2000は、画像変換モデル100と識別モデル200で構成される敵対的生成ネットワークの訓練を行うことで、画像変換モデル100と識別モデル200の訓練を行う。以下、このケースについてさらに説明する。
 取得部2020は、識別モデル200の訓練に利用する第2訓練データセット60及び第3訓練画像70を取得する。第2訓練データセット60は、第2訓練画像62及び第2クラス情報64を含む。第2訓練画像62は、第2環境下のシーンを表す真の画像である。例えば第2訓練画像62は、第2環境下のシーンをカメラで実際に撮像することによって生成される。第2クラス情報64は、第2訓練画像62に含まれる各画像領域のクラスを示す。第3訓練画像70は、第1環境下のシーンを表す画像である。
 第2訓練データセット60は、真の画像領域のクラスを正しく識別可能な識別モデル200を得るために利用される。訓練実行部2040は、第2訓練画像62を識別モデル200に入力することで識別データ40を得る。そして、訓練実行部2040は、この識別データ40と第2クラス情報64を用いて第2損失を算出する。
 ここで、第2訓練画像62は真の画像であるため、識別モデル200は、第2訓練画像62に含まれる各画像領域のクラスを正しく識別できることが望ましい。すなわち、全ての画像領域について、第2クラス情報64に示されているクラスと識別データ40によって特定されるクラスとが、互いに一致することが好適である。そこで例えば、識別データ40が各画像領域について示すクラスが、第2クラス情報64に示されているクラスと一致するほど、第2損失が小さくなるようにする。
 一方、第3訓練画像70は、偽の画像領域を正しく識別可能な識別モデル200を得るために利用される。訓練実行部2040は、第3訓練画像70を画像変換モデル100に入力することで出力画像20を得る。さらに訓練実行部2040は、その出力画像20を識別モデル200に入力することで、識別データ40を得る。そして、訓練実行部2040は、この識別データ40を用いて第3損失を算出する。
 なお、画像変換モデル100が出力画像20の生成にクラス情報を利用する場合、取得部2020は、第3訓練画像70に対応するクラス情報をさらに取得する。そして、訓練実行部2040は、第3訓練画像70とこのクラス情報を画像変換モデル100に入力することで出力画像20を得る。
 ここで、識別モデル200に入力される出力画像20は偽の画像であるため、識別モデル200は、第3訓練画像70に含まれる各画像領域について、偽の画像領域であると識別できることが好ましい。すなわち、第3訓練画像70を利用して得られた識別データ40は、全ての画像領域について、偽の画像領域であることを示すことが好ましい。そこで例えば、識別データ40が各画像領域について示す、偽の画像領域である確率が高いほど、第3損失が小さくなるようにする。
 以上のことに鑑み、訓練実行部2040は、第2訓練データセット60を利用して算出された第2損失と、第3訓練画像70を利用して算出された第3損失とを用いて、識別モデル200の訓練可能なパラメータを更新する。例えば訓練実行部2040は、第2損失と第3損失の重み付き和を算出し、当該重み付き和を小さくするように、識別モデル200の訓練可能なパラメータを更新する。例えばこの重み付き和は、以下の式(3)で表すことができる。
Figure JPOXMLDOC01-appb-M000003
 特に説明しない限り、式(3)に含まれる記号のうち、式(1)にも含まれる記号は、式(1)における意味と同じ意味を持つ。x2、t2、及び x3 はそれぞれ、第2訓練画像62、第2クラス情報64、及び第3訓練画像70を表す。L_D(x2,t2,x3) は、第2訓練画像 x2、第2クラス情報 t2、及び第3訓練画像 x3 を利用して算出された、識別モデル200を訓練するための損失をを表す。L2(x2,t2) は、第2訓練画像 x2 及び第2クラス情報 t2 を利用して算出された第2損失を表す。L3(x3) は、第3訓練画像 x3 を利用して算出された第3損失を表す。γ は第3損失に与える重みを表す。t2_i,c は、第2クラス情報 t2 において画像領域 i のクラスが c である場合に1を表し、第2クラス情報 t2 において画像領域 i のクラスが c でない場合に0を表す。D(x2) は、第2訓練画像 x2 の入力に応じて識別モデル200によって出力される識別データ40を表す。D(x2)_i,c は、この識別データ40によって示される、画像領域 i のクラスが c である確率を表す。
 G(x3) は、第3訓練画像 x3 の入力に応じて画像変換モデル100が出力する出力画像20を表す。D(G(x3)) は、この出力画像20の入力に応じて識別モデル200によって出力される識別データ40を表す。D(G(x3))_i,c=N+1 は、この識別データ40によって示される、画像領域 i が偽の画像領域である確率を表す。ここでは、識別データ40のスコアベクトルは、N+1 番目の要素に、対象の画像領域が偽の画像領域である確率を示している。
 なお、識別モデル200を訓練するための損失 L_D についても、画像変換モデル100を訓練するための損失 L_G と同様に、複数の第2訓練データセット60及び第3訓練画像70についてまとめて算出されてもよい。この場合、損失 L_D は、以下の様に一般化することができる。
Figure JPOXMLDOC01-appb-M000004
 ここで、集合 S2 は第2訓練データセット60の集合であり、集合 X3 は第3訓練画像70の集合である。
 訓練実行部2040は、画像変換モデル100の訓練と識別モデル200の訓練の双方を繰り返し行うことで、画像変換モデル100と識別モデル200の双方の精度を向上させていく。例えば訓練実行部2040は、画像変換モデル100の訓練と識別モデル200の訓練を交互に繰り返す。その他にも例えば、訓練実行部2040は、所定回の画像変換モデル100の訓練と、所定回の識別モデル200の訓練とを、交互に繰り返してもよい。ただし、画像変換モデル100の訓練と識別モデル200の訓練の回数は、互いに異なっていてもよい。
<処理結果の出力>
 モデル訓練装置2000は、処理結果として、訓練済みの画像変換モデル100を特定可能な情報(以下、出力情報)を出力する。出力情報には、少なくとも、訓練によって得られた画像変換モデル100のパラメータ群が含まれる。これに加え、出力情報には、画像変換モデル100を実現するプログラムが含まれていてもよい。また、出力情報には、識別モデル200のパラメータ群や、識別モデル200を実現するプログラムがさらに含まれていてもよい。
 出力情報の出力態様は任意である。例えばモデル訓練装置2000は、出力情報を任意の記憶部に格納する。その他にも例えば、モデル訓練装置2000は、出力情報を他の装置(例えば、画像変換モデル100の運用に利用される装置)へ送信する。
<パッチワイズコントラスティブ損失の算出における工夫について>
 ここでは、画像変換モデル100の訓練にパッチワイズコントラスティブ損失を利用するケースについて、その算出における工夫点について説明する。まずは、パッチワイズコントラスティブ損失について簡単に説明する。
 図10は、パッチワイズコントラスティブ損失の算出方法を例示する図である。訓練実行部2040は、第1訓練画像52を画像変換モデル100に入力することで、出力画像20を得る。また、訓練実行部2040は、特徴抽出モデル110によって算出された第1訓練画像52の特徴マップである第1特徴マップ130を得る。さらに訓練実行部2040は、出力画像20を特徴抽出モデル110に入力することで、出力画像20の特徴マップである第2特徴マップ140を得る。訓練実行部2040は、第1特徴マップ130及び第2特徴マップ140を用いてパッチワイズコントラスティブ損失を算出する。
 より具体的には、訓練実行部2040は、第1訓練画像52の正例パッチ及び1つ以上の負例パッチそれぞれに対応する特徴量を第1特徴マップ130から抽出する。また、訓練実行部2040は、出力画像20の正例パッチに対応する特徴量を第2特徴マップ140から抽出する。
 ここで、正例パッチと負例パッチについて説明する。図11は、正例パッチと負例パッチを例示する図である。正例パッチ522及び負例パッチ524はいずれも、第1訓練画像52の一部の画像領域である。また、正例パッチ22は、出力画像20の一部の画像領域のうち、正例パッチ522によって表される場所と同一の場所を表す画像領域である。このように、第1訓練画像52と出力画像20の双方で特徴量の抽出対象とする画像領域のことを、正例パッチと呼ぶ。一方で、第1訓練画像52についてのみ特徴量の抽出対象とする画像領域のことを、負例パッチと呼ぶ。以下、正例パッチ522、負例パッチ524、及び正例パッチ22の組み合わせのことを、パッチセットと呼ぶ。
 図11に示すように、第1特徴マップ130に含まれる特徴量の中には、第1訓練画像52の各画像領域に対応する特徴量が含まれる。そこで訓練実行部2040は、第1特徴マップ130の中から、正例パッチ522と負例パッチ524のそれぞれに対応する特徴量を抽出する。同様に、訓練実行部2040は、第2特徴マップ140の中から、正例パッチ22に対応する特徴量を抽出する。
 訓練実行部2040は、第1訓練画像52と出力画像20のペアについて、パッチセットを1つ以上生成する。そして、訓練実行部2040は、各パッチセットについて、第1特徴マップ130と第2特徴マップ140から特徴量を抽出する。
 ここで、非特許文献1では、正例パッチの位置がランダムに選択されている。この点、例えば訓練実行部2040では、特定のクラスに属する画像領域(以下、特定領域)から正例パッチを重点的に抽出するという工夫が施される。ここでいう「重点的」とは、特定領域から正例パッチ522が抽出されるケースが、それ以外の部分領域から正例パッチ522が抽出されるケースよりも多くなることを意味する。このように特定領域から重点的に正例パッチ522を抽出することにより、特定のクラスに属する画像領域の特徴(例えば、特定の種類の物体の特徴)を重点的に画像変換モデル100に学習させることができる。そのため、画像変換モデル100が、第1環境下における特定のクラスの画像領域を、第2環境下における画像領域に正確に変換できるようになる。
 例えば図7を用いて例示した検出モデルの訓練データについてデータ拡張を行うために、画像変換モデル100が利用されるとする。この場合、画像変換モデル100は、第1環境下の車の特徴を第2環境下の車の特徴に正確に変換できることが好ましい。そこで、正例パッチとして車の画像領域を重点的に利用することで、車の特徴を重点的に画像変換モデル100に学習させる。
 なお、正例パッチとして特定のクラスの画像領域を重点的に利用する具体的な方法については後述することとし、まずはパッチワイズコントラスティブ損失の算出方法についてより具体的に説明する。
 訓練実行部2040は、各パッチセットについて得られた正例パッチ522に対応する特徴量、負例パッチ524に対応する特徴量、及び正例パッチ22に対応する特徴量を用いて、パッチワイズコントラスティブ損失を算出する。1つのパッチセットについての損失は、例えば以下の式(5)で表されるクロスエントロピー損失として算出される。
Figure JPOXMLDOC01-appb-M000005
 ここで、y(v,vp,vn) は、特徴量 v,vp,vn について算出されるクロスエントロピー損失を表す。v は正例パッチ22に対応する特徴量を表す。vp は522に対応する特徴量を表す。vn は負例パッチ524に対応する特徴量の集合を表す。τは、温度付きソフトマックにおける温度パラメータであり、予め定数が設定されている。N は負例パッチ524の総数を表す。vn_k は、k 番目の負例パッチ524に対応する特徴量を表す。
 パッチセットが1つである場合、パッチワイズコントラスティブ損失は、上記式(5)で算出される。一方、パッチセットが複数ある場合も考慮すると、パッチワイズコントラスティブ損失は以下の式(6)ように一般化できる。
Figure JPOXMLDOC01-appb-M000006
 ここで、L_pw(S) は、パッチセットの集合 Sp を利用して得られるパッチワイズコントラスティブ損失を表す。s は1つのパッチセットを表す。v_sはパッチセット s の正例パッチ22に対応する特徴量を表す。vp_s はパッチセット s の正例パッチ522に対応する特徴量を表す。vn_sはパッチセット s の負例パッチ524に対応する特徴量の集合を表す。
 特徴抽出モデル110は、多段階の特徴抽出を行うように構成されていてもよい。例えばこのような特徴抽出モデル110としては、複数の畳み込み層を持つ畳み込みニューラルネットワークが挙げられる。複数の畳み込み層を持つ畳み込みニューラルネットワークにおいて、n 番目の畳み込み層は、(n-1)番目の畳み込み層から出力された (n-1)番目の特徴マップに対し、(n-1) 番目のフィルタの畳み込み演算を行うことで、n 番目の特徴マップを出力する(nは2以上の整数)。
 このように多段階の特徴抽出が行われる場合、最終的に得られる特徴マップである第1特徴マップ130や第2特徴マップ140だけでなく、途中段階で得られる特徴マップも、パッチワイズコントラスティブ損失の算出に利用することができる。すなわち、第1訓練画像52から得られる複数の特徴マップと、出力画像20から得られる複数の特徴マップとを、パッチワイズコントラスティブ損失の算出に利用することができる。
 例えば特徴抽出モデル110がn層の畳み込みニューラルネットワークである場合、各層から特徴マップを得ることで、n個の特徴マップを得ることができる。そして、522、負例パッチ524、及び正例パッチ22に対応する特徴量は、n個の特徴マップそれぞれから抽出することができる。そこで訓練実行部2040は、522、負例パッチ524、及び正例パッチ22に対応する特徴量を、n個の特徴マップそれぞれから抽出し、抽出した特徴量を用いてパッチワイズコントラスティブ損失を算出する。
 第1訓練画像52と出力画像20のそれぞれから得られる複数の特徴マップを利用してパッチワイズコントラスティブ損失を算出する場合、例えばパッチワイズコントラスティブ損失は以下の式(7)で表される。
Figure JPOXMLDOC01-appb-M000007
 ここで、L は特徴抽出を行うレイヤの集合を表し、l は1つのレイヤを表す。v^l_s は、出力画像20が入力された特徴抽出モデル110の l 番目のレイヤから出力された特徴マップから得られる、パッチセット s の正例パッチ22に対応する特徴量である。vp^l_s は、第1訓練画像52が入力された特徴抽出モデル110の l 番目のレイヤから出力された特徴マップから得られる、パッチセット s の正例パッチ522に対応する特徴量である。vn^l_s は、第1訓練画像52が入力された特徴抽出モデル110の l 番目のレイヤから出力された特徴マップから得られる、パッチセット s の負例パッチ524に対応する特徴量の集合である。なお、記号「^」は上付き文字を表している。
 また、前述したように、パッチワイズコントラスティブ損失は、複数の第1訓練画像52についてまとめて算出されてもよい。この場合、パッチワイズコントラスティブ損失は以下の式(8)で一般化することができる。
Figure JPOXMLDOC01-appb-M000008
 ここで、X1 は第1訓練画像52の集合を表し、x1 は当該集合から選択された1つの第1訓練画像52を表す。
 訓練実行部2040は、1つ以上の第1訓練データセット50を用いて、第1損失とパッチワイズコントラスティブ損失とを算出し、これらを用いて算出される総合的な損失を用いて、画像変換モデル100を更新する。例えばこの総合的な損失は、前述した式(2)で表される。
<<パッチセットの生成について>>
 訓練実行部2040は、第1訓練画像52及び出力画像20についてパッチセットを生成する。前述したように、1つのパッチセットには、1つの正例パッチ522、1つ以上の負例パッチ524、及び1つの正例パッチ22が含まれる。例えば訓練実行部2040は、第1訓練画像52から正例パッチ522を抽出する処理を行った後、第1訓練画像52のうちの正例パッチ522以外の領域から1つ以上の負例パッチ524を抽出する処理、及び出力画像20から正例パッチ22を抽出する処理を行う。
 前述したように、正例パッチ522は、特定領域から重点的に抽出されることが好ましい。そこで訓練実行部2040は、正例パッチ522の抽出に利用するために、第1訓練画像52から特定領域を検出する。ここで、第1訓練画像52から特定のクラスの画像領域を検出する技術には、既存の技術を利用することができる。以下、この「特定のクラス」のことを「対象クラス」と呼ぶ。
 対象クラスは、予め定められていてもよいし、ユーザによって指定可能であってもよい。後者の場合、訓練実行部2040は、対象クラスを表す情報を取得し、その情報に示されている対象クラスの画像領域を、特定領域として検出する。対象クラスを表す情報は、例えば、ユーザ入力の結果として得られる。
 以下、検出された特定領域に基づいて正例パッチ522を抽出する方法について、いくつか例示する。
<<方法1>>
 まず訓練実行部2040は、特定領域の中と外のどちらから正例パッチ522を抽出するのかを決定する。この決定は、特定領域の中から抽出される正例パッチ522の数が、特定領域の外から抽出される正例パッチ522の数よりも多くなるように行われる。このようにすることで、特定領域から重点的に正例パッチ522が抽出される。
 例えば上述の決定は確率的に行われる。このように2つの選択肢のうちの1つを確率的に選択する方法としては、例えば、ベルヌーイ分布から値をサンプルし、サンプル値に基づいて決定するという方法が考えられる。より具体的には、例えば、サンプル値が1である場合には特定領域の中から正例パッチ522が抽出され、サンプル値が0である場合には特定領域の外から正例パッチ522が抽出されるようにする。この際、サンプル値が1となる確率を50%より大きくすることにより、特定領域の中から抽出される正例パッチ522の数を、特定領域の外から抽出される正例パッチ522の数よりも確率的に多くすることができる。
 特定領域の中と外のどちらから正例パッチ522を抽出するのかを決定した後、訓練実行部2040は、当該決定に基づいて、正例パッチ522の抽出を行う。ここで、正例パッチ522のサイズ(以下、パッチサイズ)は予め定めておく。特定領域の中から正例パッチ522を抽出する場合、訓練実行部2040は特定領域の中の任意の箇所からパッチサイズの領域を抽出し、この領域を正例パッチ522として扱う。一方、特定領域の外から正例パッチ522を抽出する場合、訓練実行部2040は、特定領域の外の任意の箇所からパッチサイズの領域を選択し、選択した領域を正例パッチ522として決定する。なお、ある領域の中から所定サイズの領域を任意に選ぶ技術には、既存の技術を利用することができる。
 なお、特定領域の中から正例パッチ522を抽出する場合において、正例パッチ522の一部が特定領域の外にあってもよい。例えばこの場合、「正例パッチ522の所定割合以上が特定領域の中にある」という条件を満たすように、正例パッチ522が抽出される。
<<方法2>>
 訓練実行部2040は、特定領域との重なりが大きい領域ほど正例パッチ522として抽出される確率が高くなるように、正例パッチ522の抽出を行う。そのために、例えば訓練実行部2040は、特定領域との重なり率が高いほど高い抽出確率を示す抽出確率マップを生成する。例えば抽出確率マップは、第1訓練画像52の各ピクセルについて、そのピクセルを起点(例えば、正例パッチ522の左上端)とするパッチサイズの領域が正例パッチ522として抽出される確率を示す確率分布として生成される。特定領域との重なり率が高いほど抽出確率を高くするために、抽出確率マップは、各ピクセルについて、そのピクセルを起点とするパッチサイズの領域と特定領域との重複度合いが高いほど高い抽出確率を示すように生成される。なお、抽出確率マップは、第1訓練画像52に含まれるパッチサイズの各部分領域について、その部分領域が正例パッチ522として抽出される確率を示しているとも言える。そして、各部分領域の抽出確率は、その部分領域と特定領域との重複度合いが高いほど高く設定される。
 このような抽出確率マップを生成するために、例えばまず、訓練実行部2040は、抽出確率マップの各ピクセルに対し、そのピクセルを起点とするパッチサイズの領域と特定領域との重複度合いを表す値を設定する。その後、訓練実行部2040は、抽出確率マップの各ピクセルの値を、全てのピクセルの値の総和で割った値に変更する。
 図12は、抽出確率マップを例示する図である。この例において、正例パッチ522のサイズは 2x2 である。また、特定領域410のサイズは 4x3 である。抽出確率マップ400の各ピクセルは、そのピクセルを左上端として正例パッチ522を抽出した場合に、その正例パッチ522と特定領域との重複度合いが大きいほど高い抽出確率を示す。ここで、図12において、抽出確率が高いピクセルほど濃いドットで表現されている。そのため、図12において、より濃いドットで表現されているピクセルほど、そのピクセルを起点として正例パッチ522が抽出される確率がより高いことを表している。
 訓練実行部2040は、抽出確率マップによって表される確率分布からピクセルの座標をサンプリングし、サンプリングされた座標を起点とするパッチサイズの領域を、正例パッチ522として抽出する。
<<方法3>>
 対象クラスが物体のクラスを表す場合、その物体をさらに細かい小分類に分類し、当該小分類に基づいて、上述した抽出確率マップの各ピクセルの抽出確率が決定されてもよい。例えば対象クラスが車である場合、小分類には乗用車、トラック、又はバスなどの種類を設定しうる。以下、第1訓練画像52に含まれる物体が属する小分類上のクラスのことを、サブクラスと呼ぶ。
 小分類を考慮する場合、対象クラスに属する物体の中でも、そのサブクラスごとに、画像変換モデル100の訓練における重要さが異なりうる。例えば、第1訓練画像52に出現する頻度が低いクラスの物体については、少ない訓練でその特徴を画像変換モデル100が学習できるようにする必要があることから、訓練上重要な物体であると言える。
 具体的な例として、昼間の道路の様子を表す画像を入力画像10とし、その入力画像10から、夜間の道路の様子を表す出力画像20が生成されるように、画像変換モデル100が訓練されるとする。ここで、第1訓練画像52を生成するために撮像された道路において、乗用車と比較して、トラックの出現頻度が低いとする。この場合、トラックの特徴を学習できる機会は、乗用車の特徴を学習できる機会より少ない。そのため、少ない訓練でトラックの特徴を画像変換モデル100が学習できるようにする必要がある。
 そこで例えば、出現頻度が低いサブクラスほど、訓練における重要度を高くする。より具体的には、訓練実行部2040は、第1訓練画像52において、出現頻度がより低いサブクラスに属する物体を表す特定領域ほど抽出確率がより高くなるように、抽出確率マップを生成する。そのために、各サブクラスに対し、その出現頻度が低いほど高い重みが設定される。
 訓練実行部2040は、抽出確率マップの各ピクセルに対し、そのピクセルと特定領域との重複度合いに、その特定領域によって表される物体のサブクラスに対応する重みを掛けた値を設定する。そして、訓練実行部2040は、各ピクセルの値を、全てのピクセルの値の総和で割った値に変更する。
 訓練実行部2040は、この抽出確率マップによって表される確率分布からピクセルの座標をサンプリングし、サンプリングされた座標を起点とするパッチサイズの領域を、正例パッチ522として抽出する。
 ここで、各サブクラスの重みは、予め定められていてもよいし、訓練実行部2040によって決定されてもよい。後者の場合、例えば訓練実行部2040は、正例パッチ522の抽出を行う前に、取得部2020によって取得された各第1訓練画像52に対して対象クラスの物体を検出する処理を行い、検出された物体の数をサブクラスごとにカウントする。これにより、訓練画像群におけるサブクラスごとの出現数が特定される。訓練実行部2040は、各サブクラスの出現数に基づいて、各サブクラスの重みを決定する。この重みは、出現数が少ないサブクラスの重みほど大きくなるように決定される。
<<負例パッチ524の抽出方法>>
 訓練実行部2040は、第1訓練画像52に含まれる領域のうち、正例パッチ522として抽出された領域以外の領域から任意に(例えばランダムに)パッチサイズの領域を抽出し、その領域を負例パッチ524として利用する。前述したように、1つのパッチセットには複数の負例パッチ524が含まれてもよい。1つのパッチセットに含まれる負例パッチ524の数は、予め定めておく。
<<正例パッチ22の抽出方法>>
 訓練実行部2040は、正例パッチ522が抽出された第1訓練画像52上の位置と対応する出力画像20の位置から、正例パッチ22を抽出する。すなわち、正例パッチ22の抽出の起点とするピクセルの座標には、正例パッチ522の抽出の起点として利用された座標と同一の座標が利用される。
<その他の方法>
 上述のモデル訓練装置2000では、対象クラスの画像領域から重点的に正例パッチ522を抽出することにより、対象クラスの物体の特徴が特に高い精度で学習されるようにしている。しかしながら、対象クラスの物体の特徴が高い精度で学習されるようにする方法は、特定領域から重点的に正例パッチ522を抽出するという方法に限定されない。
 例えばモデル訓練装置2000は、特定領域から重点的に正例パッチ522を抽出することに加え、又はこれに代えて、特定領域から抽出された正例パッチ522に対応する特徴を用いて算出される損失(例えば前述したクロスエントロピー損失)の影響が、他の領域から抽出された正例パッチ522に対応する特徴量を用いて算出される損失の影響よりも大きくなるように、パッチワイズコントラスティブ損失を算出する。なお、特定領域から重点的に正例パッチ522を抽出するという手法を採用しない場合、例えば正例パッチ522は、第1訓練画像52の任意の箇所から同確率で抽出される。
 以下、正例パッチ522が特定領域の中と外のどちらから抽出されたかにより、その正例パッチ522に対応する特徴量に基づく損失の影響度を決める方法について説明する。
 例えば訓練実行部2040は、以下の式(9)を用いてパッチワイズコントラスティブ損失を算出する。
Figure JPOXMLDOC01-appb-M000009
 式(7)では、パッチセットごとに算出される損失に対し、そのパッチセットに含まれる正例パッチ522が特定領域の中から抽出された場合には重み a が掛けられる一方、そのパッチセットに含まれる正例パッチ522が特定領域の外から抽出された場合には重み b が掛けられる。a>b>0であることから、正例パッチ522が特定領域の中から抽出された場合における損失の影響が、正例パッチ522が特定領域の外から抽出された場合における損失の影響よりも大きくなる。
 なお、前述した式(7)や(8)を用いてパッチワイズコントラスティブ損失を算出する場合についても同様とすることができる。すなわち、特徴抽出モデル110の複数のレイヤから特徴マップが得られる場合、各レイヤから得られた特徴マップについて算出する損失において、上述した重み付けを行うようにする。
 また、w_s と同様の重みが、第1損失、第2喪失、及び第3損失の算出に利用されてもよい。この場合、例えば以下の式(10)でこれらの損失を算出することができる。
Figure JPOXMLDOC01-appb-M000010
 複数のレイヤから特徴マップが得られる場合、特徴マップの1つのセルに対応する入力画像の部分領域のサイズとパッチサイズとの関係に基づいて、レイヤごとに重みを設定したり、特定のレイヤのみに重みを付したりしてもよい。以下、この方法について説明する。
 複数のレイヤから特徴マップが得られる場合、特徴マップの1つのセルに対応する入力画像の部分領域のサイズは、特徴マップごと(レイヤごと)に異なる。例えば、各レイヤにおいてサイズ 3x3 のフィルタの畳み込み処理が行われるとする。この場合、1番目の特徴マップの1つのセルは、入力画像におけるサイズ 3x3 の部分領域に対応する。また、2番目の特徴マップの1つのセルは、1番目の特徴マップにおけるサイズ 3x3 のセルの集合に対応する。このことから、2番目の特徴マップの1つのセルは、入力画像におけるサイズ 9x9 の領域に対応する。同様の理由により、3番目の特徴マップの1つのセルは、入力画像におけるサイズ 27x27 の領域に対応する。このように、後段のレイヤによって生成される特徴マップほど、入力画像のより大きい部分領域に対応する。
 この点、第1訓練画像52についてそれぞれ異なるレイヤから生成される複数の特徴マップにおいて、1つのセルに対応する第1訓練画像52の部分領域のサイズがパッチサイズに近い特徴マップほど、正例パッチ522の特徴をより正確に表していると考えられる。負例パッチ524や正例パッチ22についても同様である。
 そこで例えば、訓練実行部2040は、1つのセルに対応する第1訓練画像52の部分領域のサイズがパッチサイズにより近い特徴マップほど、その特徴マップから抽出された特徴量に対してより大きい重みを付すように、パッチワイズコントラスティブ損失を算出する。正例パッチ22と負例パッチ524についても同様である。この場合、例えばパッチワイズコントラスティブ損失は、以下の式(11)を用いて算出される。
Figure JPOXMLDOC01-appb-M000011
 ここで、z_p はパッチサイズである。z_l は、l 番目のレイヤから抽出された特徴マップの1つのセルに対応する入力画像(第1訓練画像52又は出力画像20)の部分領域のサイズである。f()は、zp と zl の差異が小さいほど大きい値を出力する関数である。なお、f()>0である。
 なお、z_p と z_l の差異が最小のレイヤ l についてのみ1より大きい重みを付し、他のレイヤについては重みを付さないようにすることで、特徴マップのセルに対応する入力画像の部分領域のサイズがパッチサイズに最も近くなるレイヤのみに重みを付してもよい。また、z_p と z_l の差異が小さい順で上位所定個のレイヤについてのみ1より大きい重みを付すといった方法が採用されてもよい。
 以上、実施の形態を参照して本願発明を説明したが、本願発明は上記実施形態に限定されるものではない。本願発明の構成や詳細には、本願発明のスコープ内で当業者が理解し得る様々な変更をすることができる。
 なお、上述の例において、プログラムは、コンピュータに読み込まれた場合に、実施形態で説明された1又はそれ以上の機能をコンピュータに行わせるための命令群(又はソフトウェアコード)を含む。プログラムは、非一時的なコンピュータ可読媒体又は実体のある記憶媒体に格納されてもよい。限定ではなく例として、コンピュータ可読媒体又は実体のある記憶媒体は、random-access memory(RAM)、read-only memory(ROM)、フラッシュメモリ、solid-state drive(SSD)又はその他のメモリ技術、CD-ROM、digital versatile disc(DVD)、Blu-ray(登録商標)ディスク又はその他の光ディスクストレージ、磁気カセット、磁気テープ、磁気ディスクストレージ又はその他の磁気ストレージデバイスを含む。プログラムは、一時的なコンピュータ可読媒体又は通信媒体上で送信されてもよい。限定ではなく例として、一時的なコンピュータ可読媒体又は通信媒体は、電気的、光学的、音響的、またはその他の形式の伝搬信号を含む。
 上記の実施形態の一部又は全部は、以下の付記のようにも記載されうるが、以下には限られない。
 (付記1)
 第1環境下のシーンを表す第1訓練画像と、前記第1訓練画像に含まれる複数の画像領域それぞれのクラスを示す第1クラス情報とを含む第1訓練データセットを取得する取得手段と、
 前記第1訓練データセットを用いて、前記第1環境下のシーンを表す画像が入力されたことに応じて第2環境下のシーンを表す画像を出力する画像変換モデルの訓練を行う訓練実行手段と、を有し、
 前記訓練実行手段は、前記第1訓練画像を前記画像変換モデルに入力し、前記画像変換モデルから出力された第1出力画像を識別モデルに入力し、前記識別モデルから出力された識別データと前記第1クラス情報とを用いて第1損失を算出し、前記第1損失を用いて前記画像変換モデルのパラメータを更新し、
 前記識別データは、前記識別モデルに入力された画像に含まれる複数の部分領域それぞれについて、その部分領域が偽の画像領域であるか否かを示し、かつ、その部分領域が偽の画像でない場合にはその部分領域のクラスを示す、モデル訓練装置。
 (付記2)
 前記第1損失は、前記識別データによって示されているクラスと前記第1クラス情報によって示されているクラスとが一致する画像領域が多いほど小さい、付記1に記載のモデル訓練装置。
 (付記3)
 前記訓練実行手段は、特定のクラスに属する画像領域に対して、前記特定のクラスに属さない画像領域よりも大きい重みを与えて、前記第1損失を算出する、付記2に記載のモデル訓練装置。
 (付記4)
 前記画像変換モデルは、入力された画像から特徴マップを抽出する特徴抽出モデルを含み、
 前記訓練実行手段は、
  前記第1訓練画像を前記画像変換モデルに入力して、前記第1出力画像と、前記第1訓練画像の前記特徴マップである第1特徴マップとを前記画像変換モデルから取得し、
  前記第1出力画像を前記特徴抽出モデルに入力して、前記第1出力画像の前記特徴マップである第2特徴マップを前記特徴抽出モデルから取得し、
  前記第1特徴マップと前記第2特徴マップを用いて算出される特徴損失と、前記第1損失との双方を用いて、前記画像変換モデルをパラメータを更新する、付記1から3いずれか一項に記載のモデル訓練装置。
 (付記5)
 前記訓練実行手段は、
  前記第1訓練画像の部分領域である第1正例パッチ及び第1負例パッチ、並びに前記第1出力画像において前記第1正例パッチに対応する位置の部分領域である第2正例パッチのセットであるパッチセットを1つ以上生成し、
  前記第1特徴マップから前記第1正例パッチと前記第1負例パッチそれぞれに対応する特徴量を抽出し、前記第2特徴マップから前記第2正例パッチに対応する特徴量を抽出し、各前記抽出した特徴量を用いて前記特徴損失を算出し、
 前記訓練実行手段は、
  前記パッチセットの生成において、前記第1訓練画像に含まれる領域のうち、特定のクラスに属する特定領域から重点的に前記第1正例パッチを抽出するか、又は、
  前記特定領域の中から抽出された前記第1正例パッチを含む前記パッチセットについて算出された損失の影響が、前記特定領域の外から抽出された前記第1正例パッチを含む前記パッチセットについて算出された損失の影響よりも大きくなるように、前記特徴損失を算出する、付記4に記載のモデル訓練装置。
 (付記6)
 前記取得手段は、前記第1環境下のシーンを表す第2訓練画像と、前記第2訓練画像に含まれる複数の画像領域それぞれのクラスを示す第2クラス情報とを含む第2訓練データセット、及び前記第2環境下のシーンを表す第3訓練画像を取得し、
 前記訓練実行手段は、
  前記第2訓練画像を前記画像変換モデルに入力することで得られる第2出力画像を前記識別モデルに入力し、前記識別モデルから出力された前記識別データと前記第2クラス情報とを用いて第2損失を算出し、
  前記第3訓練画像を前記識別モデルに入力し、前記識別モデルから出力された前記識別データを用いて第3損失を算出し、
  前記第2損失及び前記第3損失を用いて前記識別モデルのパラメータを更新する、付記1から5いずれか一項に記載のモデル訓練装置。
 (付記7)
 コンピュータによって実行されるモデル訓練方法であって、
 第1環境下のシーンを表す第1訓練画像と、前記第1訓練画像に含まれる複数の画像領域それぞれのクラスを示す第1クラス情報とを含む第1訓練データセットを取得する取得ステップと、
 前記第1訓練データセットを用いて、前記第1環境下のシーンを表す画像が入力されたことに応じて第2環境下のシーンを表す画像を出力する画像変換モデルの訓練を行う訓練実行ステップと、を有し、
 前記訓練実行ステップにおいて、前記第1訓練画像を前記画像変換モデルに入力し、前記画像変換モデルから出力された第1出力画像を識別モデルに入力し、前記識別モデルから出力された識別データと前記第1クラス情報とを用いて第1損失を算出し、前記第1損失を用いて前記画像変換モデルのパラメータを更新し、
 前記識別データは、前記識別モデルに入力された画像に含まれる複数の部分領域それぞれについて、その部分領域が偽の画像領域であるか否かを示し、かつ、その部分領域が偽の画像でない場合にはその部分領域のクラスを示す、モデル訓練方法。
 (付記8)
 前記第1損失は、前記識別データによって示されているクラスと前記第1クラス情報によって示されているクラスとが一致する画像領域が多いほど小さい、付記7に記載のモデル訓練方法。
 (付記9)
 前記訓練実行ステップにおいて、特定のクラスに属する画像領域に対して、前記特定のクラスに属さない画像領域よりも大きい重みを与えて、前記第1損失を算出する、付記8に記載のモデル訓練方法。
 (付記10)
 前記画像変換モデルは、入力された画像から特徴マップを抽出する特徴抽出モデルを含み、
 前記訓練実行ステップにおいて、
  前記第1訓練画像を前記画像変換モデルに入力して、前記第1出力画像と、前記第1訓練画像の前記特徴マップである第1特徴マップとを前記画像変換モデルから取得し、
  前記第1出力画像を前記特徴抽出モデルに入力して、前記第1出力画像の前記特徴マップである第2特徴マップを前記特徴抽出モデルから取得し、
  前記第1特徴マップと前記第2特徴マップを用いて算出される特徴損失と、前記第1損失との双方を用いて、前記画像変換モデルをパラメータを更新する、付記7から9いずれか一項に記載のモデル訓練方法。
 (付記11)
 前記訓練実行ステップにおいて、
  前記第1訓練画像の部分領域である第1正例パッチ及び第1負例パッチ、並びに前記第1出力画像において前記第1正例パッチに対応する位置の部分領域である第2正例パッチのセットであるパッチセットを1つ以上生成し、
  前記第1特徴マップから前記第1正例パッチと前記第1負例パッチそれぞれに対応する特徴量を抽出し、前記第2特徴マップから前記第2正例パッチに対応する特徴量を抽出し、各前記抽出した特徴量を用いて前記特徴損失を算出し、
 前記訓練実行ステップにおいて、
  前記パッチセットの生成において、前記第1訓練画像に含まれる領域のうち、特定のクラスに属する特定領域から重点的に前記第1正例パッチを抽出するか、又は、
  前記特定領域の中から抽出された前記第1正例パッチを含む前記パッチセットについて算出された損失の影響が、前記特定領域の外から抽出された前記第1正例パッチを含む前記パッチセットについて算出された損失の影響よりも大きくなるように、前記特徴損失を算出する、付記10に記載のモデル訓練方法。
 (付記12)
 前記取得ステップにおいて、前記第1環境下のシーンを表す第2訓練画像と、前記第2訓練画像に含まれる複数の画像領域それぞれのクラスを示す第2クラス情報とを含む第2訓練データセット、及び前記第2環境下のシーンを表す第3訓練画像を取得し、
 前記訓練実行ステップにおいて、
  前記第2訓練画像を前記画像変換モデルに入力することで得られる第2出力画像を前記識別モデルに入力し、前記識別モデルから出力された前記識別データと前記第2クラス情報とを用いて第2損失を算出し、
  前記第3訓練画像を前記識別モデルに入力し、前記識別モデルから出力された前記識別データを用いて第3損失を算出し、
  前記第2損失及び前記第3損失を用いて前記識別モデルのパラメータを更新する、付記7から11いずれか一項に記載のモデル訓練方法。
 (付記13)
 コンピュータに、
 第1環境下のシーンを表す第1訓練画像と、前記第1訓練画像に含まれる複数の画像領域それぞれのクラスを示す第1クラス情報とを含む第1訓練データセットを取得する取得ステップと、
 前記第1訓練データセットを用いて、前記第1環境下のシーンを表す画像が入力されたことに応じて第2環境下のシーンを表す画像を出力する画像変換モデルの訓練を行う訓練実行ステップと、を実行させるプログラムが格納されており、
 前記訓練実行ステップにおいて、前記第1訓練画像を前記画像変換モデルに入力し、前記画像変換モデルから出力された第1出力画像を識別モデルに入力し、前記識別モデルから出力された識別データと前記第1クラス情報とを用いて第1損失を算出し、前記第1損失を用いて前記画像変換モデルのパラメータを更新し、
 前記識別データは、前記識別モデルに入力された画像に含まれる複数の部分領域それぞれについて、その部分領域が偽の画像領域であるか否かを示し、かつ、その部分領域が偽の画像でない場合にはその部分領域のクラスを示す、非一時的なコンピュータ可読媒体。
 (付記14)
 前記第1損失は、前記識別データによって示されているクラスと前記第1クラス情報によって示されているクラスとが一致する画像領域が多いほど小さい、付記13に記載のコンピュータ可読媒体。
 (付記15)
 前記訓練実行ステップにおいて、特定のクラスに属する画像領域に対して、前記特定のクラスに属さない画像領域よりも大きい重みを与えて、前記第1損失を算出する、付記14に記載のコンピュータ可読媒体。
 (付記16)
 前記画像変換モデルは、入力された画像から特徴マップを抽出する特徴抽出モデルを含み、
 前記訓練実行ステップにおいて、
  前記第1訓練画像を前記画像変換モデルに入力して、前記第1出力画像と、前記第1訓練画像の前記特徴マップである第1特徴マップとを前記画像変換モデルから取得し、
  前記第1出力画像を前記特徴抽出モデルに入力して、前記第1出力画像の前記特徴マップである第2特徴マップを前記特徴抽出モデルから取得し、
  前記第1特徴マップと前記第2特徴マップを用いて算出される特徴損失と、前記第1損失との双方を用いて、前記画像変換モデルをパラメータを更新する、付記13から15いずれか一項に記載のコンピュータ可読媒体。
 (付記17)
 前記訓練実行ステップにおいて、
  前記第1訓練画像の部分領域である第1正例パッチ及び第1負例パッチ、並びに前記第1出力画像において前記第1正例パッチに対応する位置の部分領域である第2正例パッチのセットであるパッチセットを1つ以上生成し、
  前記第1特徴マップから前記第1正例パッチと前記第1負例パッチそれぞれに対応する特徴量を抽出し、前記第2特徴マップから前記第2正例パッチに対応する特徴量を抽出し、各前記抽出した特徴量を用いて前記特徴損失を算出し、
 前記訓練実行ステップにおいて、
  前記パッチセットの生成において、前記第1訓練画像に含まれる領域のうち、特定のクラスに属する特定領域から重点的に前記第1正例パッチを抽出するか、又は、
  前記特定領域の中から抽出された前記第1正例パッチを含む前記パッチセットについて算出された損失の影響が、前記特定領域の外から抽出された前記第1正例パッチを含む前記パッチセットについて算出された損失の影響よりも大きくなるように、前記特徴損失を算出する、付記16に記載のコンピュータ可読媒体。
 (付記18)
 前記取得ステップにおいて、前記第1環境下のシーンを表す第2訓練画像と、前記第2訓練画像に含まれる複数の画像領域それぞれのクラスを示す第2クラス情報とを含む第2訓練データセット、及び前記第2環境下のシーンを表す第3訓練画像を取得し、
 前記訓練実行ステップにおいて、
  前記第2訓練画像を前記画像変換モデルに入力することで得られる第2出力画像を前記識別モデルに入力し、前記識別モデルから出力された前記識別データと前記第2クラス情報とを用いて第2損失を算出し、
  前記第3訓練画像を前記識別モデルに入力し、前記識別モデルから出力された前記識別データを用いて第3損失を算出し、
  前記第2損失及び前記第3損失を用いて前記識別モデルのパラメータを更新する、付記13から17いずれか一項に記載のコンピュータ可読媒体。
10      入力画像
20      出力画像
22      正例パッチ
30      入力画像
40      識別データ
50      第1訓練データセット
52      第1訓練画像
54      第1クラス情報
60      第2訓練データセット
62      第2訓練画像
64      第2クラス情報
70      第3訓練画像
100      画像変換モデル
110      特徴抽出モデル
120      画像生成モデル
130      第1特徴マップ
140      第2特徴マップ
200      識別モデル
210      エンコーダ
220      デコーダ
400      抽出確率マップ
410      特定領域
522      正例パッチ
524      負例パッチ
1000     コンピュータ
1020     バス
1040     プロセッサ
1060     メモリ
1080     ストレージデバイス
1100     入出力インタフェース
1120     ネットワークインタフェース
2000     モデル訓練装置
2020     取得部
2040     訓練実行部

Claims (18)

  1.  第1環境下のシーンを表す第1訓練画像と、前記第1訓練画像に含まれる複数の画像領域それぞれのクラスを示す第1クラス情報とを含む第1訓練データセットを取得する取得手段と、
     前記第1訓練データセットを用いて、前記第1環境下のシーンを表す画像が入力されたことに応じて第2環境下のシーンを表す画像を出力する画像変換モデルの訓練を行う訓練実行手段と、を有し、
     前記訓練実行手段は、前記第1訓練画像を前記画像変換モデルに入力し、前記画像変換モデルから出力された第1出力画像を識別モデルに入力し、前記識別モデルから出力された識別データと前記第1クラス情報とを用いて第1損失を算出し、前記第1損失を用いて前記画像変換モデルのパラメータを更新し、
     前記識別データは、前記識別モデルに入力された画像に含まれる複数の部分領域それぞれについて、その部分領域が偽の画像領域であるか否かを示し、かつ、その部分領域が偽の画像でない場合にはその部分領域のクラスを示す、モデル訓練装置。
  2.  前記第1損失は、前記識別データによって示されているクラスと前記第1クラス情報によって示されているクラスとが一致する画像領域が多いほど小さい、請求項1に記載のモデル訓練装置。
  3.  前記訓練実行手段は、特定のクラスに属する画像領域に対して、前記特定のクラスに属さない画像領域よりも大きい重みを与えて、前記第1損失を算出する、請求項2に記載のモデル訓練装置。
  4.  前記画像変換モデルは、入力された画像から特徴マップを抽出する特徴抽出モデルを含み、
     前記訓練実行手段は、
      前記第1訓練画像を前記画像変換モデルに入力して、前記第1出力画像と、前記第1訓練画像の前記特徴マップである第1特徴マップとを前記画像変換モデルから取得し、
      前記第1出力画像を前記特徴抽出モデルに入力して、前記第1出力画像の前記特徴マップである第2特徴マップを前記特徴抽出モデルから取得し、
      前記第1特徴マップと前記第2特徴マップを用いて算出される特徴損失と、前記第1損失との双方を用いて、前記画像変換モデルをパラメータを更新する、請求項1から3いずれか一項に記載のモデル訓練装置。
  5.  前記訓練実行手段は、
      前記第1訓練画像の部分領域である第1正例パッチ及び第1負例パッチ、並びに前記第1出力画像において前記第1正例パッチに対応する位置の部分領域である第2正例パッチのセットであるパッチセットを1つ以上生成し、
      前記第1特徴マップから前記第1正例パッチと前記第1負例パッチそれぞれに対応する特徴量を抽出し、前記第2特徴マップから前記第2正例パッチに対応する特徴量を抽出し、各前記抽出した特徴量を用いて前記特徴損失を算出し、
     前記訓練実行手段は、
      前記パッチセットの生成において、前記第1訓練画像に含まれる領域のうち、特定のクラスに属する特定領域から重点的に前記第1正例パッチを抽出するか、又は、
      前記特定領域の中から抽出された前記第1正例パッチを含む前記パッチセットについて算出された損失の影響が、前記特定領域の外から抽出された前記第1正例パッチを含む前記パッチセットについて算出された損失の影響よりも大きくなるように、前記特徴損失を算出する、請求項4に記載のモデル訓練装置。
  6.  前記取得手段は、前記第1環境下のシーンを表す第2訓練画像と、前記第2訓練画像に含まれる複数の画像領域それぞれのクラスを示す第2クラス情報とを含む第2訓練データセット、及び前記第2環境下のシーンを表す第3訓練画像を取得し、
     前記訓練実行手段は、
      前記第2訓練画像を前記画像変換モデルに入力することで得られる第2出力画像を前記識別モデルに入力し、前記識別モデルから出力された前記識別データと前記第2クラス情報とを用いて第2損失を算出し、
      前記第3訓練画像を前記識別モデルに入力し、前記識別モデルから出力された前記識別データを用いて第3損失を算出し、
      前記第2損失及び前記第3損失を用いて前記識別モデルのパラメータを更新する、請求項1から5いずれか一項に記載のモデル訓練装置。
  7.  コンピュータによって実行されるモデル訓練方法であって、
     第1環境下のシーンを表す第1訓練画像と、前記第1訓練画像に含まれる複数の画像領域それぞれのクラスを示す第1クラス情報とを含む第1訓練データセットを取得する取得ステップと、
     前記第1訓練データセットを用いて、前記第1環境下のシーンを表す画像が入力されたことに応じて第2環境下のシーンを表す画像を出力する画像変換モデルの訓練を行う訓練実行ステップと、を有し、
     前記訓練実行ステップにおいて、前記第1訓練画像を前記画像変換モデルに入力し、前記画像変換モデルから出力された第1出力画像を識別モデルに入力し、前記識別モデルから出力された識別データと前記第1クラス情報とを用いて第1損失を算出し、前記第1損失を用いて前記画像変換モデルのパラメータを更新し、
     前記識別データは、前記識別モデルに入力された画像に含まれる複数の部分領域それぞれについて、その部分領域が偽の画像領域であるか否かを示し、かつ、その部分領域が偽の画像でない場合にはその部分領域のクラスを示す、モデル訓練方法。
  8.  前記第1損失は、前記識別データによって示されているクラスと前記第1クラス情報によって示されているクラスとが一致する画像領域が多いほど小さい、請求項7に記載のモデル訓練方法。
  9.  前記訓練実行ステップにおいて、特定のクラスに属する画像領域に対して、前記特定のクラスに属さない画像領域よりも大きい重みを与えて、前記第1損失を算出する、請求項8に記載のモデル訓練方法。
  10.  前記画像変換モデルは、入力された画像から特徴マップを抽出する特徴抽出モデルを含み、
     前記訓練実行ステップにおいて、
      前記第1訓練画像を前記画像変換モデルに入力して、前記第1出力画像と、前記第1訓練画像の前記特徴マップである第1特徴マップとを前記画像変換モデルから取得し、
      前記第1出力画像を前記特徴抽出モデルに入力して、前記第1出力画像の前記特徴マップである第2特徴マップを前記特徴抽出モデルから取得し、
      前記第1特徴マップと前記第2特徴マップを用いて算出される特徴損失と、前記第1損失との双方を用いて、前記画像変換モデルをパラメータを更新する、請求項7から9いずれか一項に記載のモデル訓練方法。
  11.  前記訓練実行ステップにおいて、
      前記第1訓練画像の部分領域である第1正例パッチ及び第1負例パッチ、並びに前記第1出力画像において前記第1正例パッチに対応する位置の部分領域である第2正例パッチのセットであるパッチセットを1つ以上生成し、
      前記第1特徴マップから前記第1正例パッチと前記第1負例パッチそれぞれに対応する特徴量を抽出し、前記第2特徴マップから前記第2正例パッチに対応する特徴量を抽出し、各前記抽出した特徴量を用いて前記特徴損失を算出し、
     前記訓練実行ステップにおいて、
      前記パッチセットの生成において、前記第1訓練画像に含まれる領域のうち、特定のクラスに属する特定領域から重点的に前記第1正例パッチを抽出するか、又は、
      前記特定領域の中から抽出された前記第1正例パッチを含む前記パッチセットについて算出された損失の影響が、前記特定領域の外から抽出された前記第1正例パッチを含む前記パッチセットについて算出された損失の影響よりも大きくなるように、前記特徴損失を算出する、請求項10に記載のモデル訓練方法。
  12.  前記取得ステップにおいて、前記第1環境下のシーンを表す第2訓練画像と、前記第2訓練画像に含まれる複数の画像領域それぞれのクラスを示す第2クラス情報とを含む第2訓練データセット、及び前記第2環境下のシーンを表す第3訓練画像を取得し、
     前記訓練実行ステップにおいて、
      前記第2訓練画像を前記画像変換モデルに入力することで得られる第2出力画像を前記識別モデルに入力し、前記識別モデルから出力された前記識別データと前記第2クラス情報とを用いて第2損失を算出し、
      前記第3訓練画像を前記識別モデルに入力し、前記識別モデルから出力された前記識別データを用いて第3損失を算出し、
      前記第2損失及び前記第3損失を用いて前記識別モデルのパラメータを更新する、請求項7から11いずれか一項に記載のモデル訓練方法。
  13.  コンピュータに、
     第1環境下のシーンを表す第1訓練画像と、前記第1訓練画像に含まれる複数の画像領域それぞれのクラスを示す第1クラス情報とを含む第1訓練データセットを取得する取得ステップと、
     前記第1訓練データセットを用いて、前記第1環境下のシーンを表す画像が入力されたことに応じて第2環境下のシーンを表す画像を出力する画像変換モデルの訓練を行う訓練実行ステップと、を実行させるプログラムが格納されており、
     前記訓練実行ステップにおいて、前記第1訓練画像を前記画像変換モデルに入力し、前記画像変換モデルから出力された第1出力画像を識別モデルに入力し、前記識別モデルから出力された識別データと前記第1クラス情報とを用いて第1損失を算出し、前記第1損失を用いて前記画像変換モデルのパラメータを更新し、
     前記識別データは、前記識別モデルに入力された画像に含まれる複数の部分領域それぞれについて、その部分領域が偽の画像領域であるか否かを示し、かつ、その部分領域が偽の画像でない場合にはその部分領域のクラスを示す、非一時的なコンピュータ可読媒体。
  14.  前記第1損失は、前記識別データによって示されているクラスと前記第1クラス情報によって示されているクラスとが一致する画像領域が多いほど小さい、請求項13に記載のコンピュータ可読媒体。
  15.  前記訓練実行ステップにおいて、特定のクラスに属する画像領域に対して、前記特定のクラスに属さない画像領域よりも大きい重みを与えて、前記第1損失を算出する、請求項14に記載のコンピュータ可読媒体。
  16.  前記画像変換モデルは、入力された画像から特徴マップを抽出する特徴抽出モデルを含み、
     前記訓練実行ステップにおいて、
      前記第1訓練画像を前記画像変換モデルに入力して、前記第1出力画像と、前記第1訓練画像の前記特徴マップである第1特徴マップとを前記画像変換モデルから取得し、
      前記第1出力画像を前記特徴抽出モデルに入力して、前記第1出力画像の前記特徴マップである第2特徴マップを前記特徴抽出モデルから取得し、
      前記第1特徴マップと前記第2特徴マップを用いて算出される特徴損失と、前記第1損失との双方を用いて、前記画像変換モデルをパラメータを更新する、請求項13から15いずれか一項に記載のコンピュータ可読媒体。
  17.  前記訓練実行ステップにおいて、
      前記第1訓練画像の部分領域である第1正例パッチ及び第1負例パッチ、並びに前記第1出力画像において前記第1正例パッチに対応する位置の部分領域である第2正例パッチのセットであるパッチセットを1つ以上生成し、
      前記第1特徴マップから前記第1正例パッチと前記第1負例パッチそれぞれに対応する特徴量を抽出し、前記第2特徴マップから前記第2正例パッチに対応する特徴量を抽出し、各前記抽出した特徴量を用いて前記特徴損失を算出し、
     前記訓練実行ステップにおいて、
      前記パッチセットの生成において、前記第1訓練画像に含まれる領域のうち、特定のクラスに属する特定領域から重点的に前記第1正例パッチを抽出するか、又は、
      前記特定領域の中から抽出された前記第1正例パッチを含む前記パッチセットについて算出された損失の影響が、前記特定領域の外から抽出された前記第1正例パッチを含む前記パッチセットについて算出された損失の影響よりも大きくなるように、前記特徴損失を算出する、請求項16に記載のコンピュータ可読媒体。
  18.  前記取得ステップにおいて、前記第1環境下のシーンを表す第2訓練画像と、前記第2訓練画像に含まれる複数の画像領域それぞれのクラスを示す第2クラス情報とを含む第2訓練データセット、及び前記第2環境下のシーンを表す第3訓練画像を取得し、
     前記訓練実行ステップにおいて、
      前記第2訓練画像を前記画像変換モデルに入力することで得られる第2出力画像を前記識別モデルに入力し、前記識別モデルから出力された前記識別データと前記第2クラス情報とを用いて第2損失を算出し、
      前記第3訓練画像を前記識別モデルに入力し、前記識別モデルから出力された前記識別データを用いて第3損失を算出し、
      前記第2損失及び前記第3損失を用いて前記識別モデルのパラメータを更新する、請求項13から17いずれか一項に記載のコンピュータ可読媒体。
PCT/JP2022/005395 2022-02-10 2022-02-10 モデル訓練装置、モデル訓練方法、及び非一時的なコンピュータ可読媒体 WO2023152882A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/005395 WO2023152882A1 (ja) 2022-02-10 2022-02-10 モデル訓練装置、モデル訓練方法、及び非一時的なコンピュータ可読媒体

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/005395 WO2023152882A1 (ja) 2022-02-10 2022-02-10 モデル訓練装置、モデル訓練方法、及び非一時的なコンピュータ可読媒体

Publications (1)

Publication Number Publication Date
WO2023152882A1 true WO2023152882A1 (ja) 2023-08-17

Family

ID=87563876

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2022/005395 WO2023152882A1 (ja) 2022-02-10 2022-02-10 モデル訓練装置、モデル訓練方法、及び非一時的なコンピュータ可読媒体

Country Status (1)

Country Link
WO (1) WO2023152882A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018163444A (ja) * 2017-03-24 2018-10-18 キヤノン株式会社 情報処理装置、情報処理方法及びプログラム
JP2019028876A (ja) * 2017-08-02 2019-02-21 株式会社ディジタルメディアプロフェッショナル 機械学習用教師データ生成装置及び生成方法
JP2020014799A (ja) * 2018-07-27 2020-01-30 コニカミノルタ株式会社 X線画像物体認識システム

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018163444A (ja) * 2017-03-24 2018-10-18 キヤノン株式会社 情報処理装置、情報処理方法及びプログラム
JP2019028876A (ja) * 2017-08-02 2019-02-21 株式会社ディジタルメディアプロフェッショナル 機械学習用教師データ生成装置及び生成方法
JP2020014799A (ja) * 2018-07-27 2020-01-30 コニカミノルタ株式会社 X線画像物体認識システム

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
MANSOURIFAR HADI; CHEN LIN; SHI WEIDONG: "Virtual Big Data for GAN Based Data Augmentation", 2019 IEEE INTERNATIONAL CONFERENCE ON BIG DATA (BIG DATA), IEEE, 9 December 2019 (2019-12-09), pages 1478 - 1487, XP033721437, DOI: 10.1109/BigData47090.2019.9006268 *

Similar Documents

Publication Publication Date Title
CN112183203B (zh) 一种基于多尺度像素特征融合的实时交通标志检测方法
CN113066017B (zh) 一种图像增强方法、模型训练方法及设备
CN111539343B (zh) 一种基于卷积注意力网络的黑烟车检测方法
CN113468978B (zh) 基于深度学习的细粒度车身颜色分类方法、装置和设备
CN110826429A (zh) 一种基于景区视频的旅游突发事件自动监测的方法及系统
CN109977832B (zh) 一种图像处理方法、装置及存储介质
Ali et al. Improved YOLOv4 for aerial object detection
CN110807384A (zh) 低能见度下的小目标检测方法和系统
CN114841972A (zh) 基于显著性图和语义嵌入特征金字塔的输电线路缺陷识别方法
CN116895030B (zh) 基于目标检测算法和注意力机制的绝缘子检测方法
Liu et al. DCNet: A deformable convolutional cloud detection network for remote sensing imagery
CN113449811A (zh) 一种基于ms-wsda的低照度目标检测方法
CN115861756A (zh) 基于级联组合网络的大地背景小目标识别方法
CN113963333B (zh) 一种基于改进yolof模型的交通标志牌检测方法
Jin et al. Vehicle license plate recognition for fog‐haze environments
CN112132867B (zh) 一种遥感影像变化检测方法及装置
CN112825116B (zh) 监控视频图像人脸检测和追踪方法、装置、介质及设备
CN115358952B (zh) 一种基于元学习的图像增强方法、系统、设备和存储介质
WO2023152882A1 (ja) モデル訓練装置、モデル訓練方法、及び非一時的なコンピュータ可読媒体
CN116543333A (zh) 电力系统的目标识别方法、训练方法、装置、设备和介质
WO2023037494A1 (ja) モデル訓練装置、制御方法、及び非一時的なコンピュータ可読媒体
CN111539420B (zh) 基于注意力感知特征的全景图像显著性预测方法及系统
CN116030507A (zh) 一种电子设备、识别图像中人脸是否佩戴口罩的方法
Pang et al. PTRSegNet: A Patch-to-Region Bottom-Up Pyramid Framework for the Semantic Segmentation of Large-Format Remote Sensing Images
CN115292538A (zh) 一种基于深度学习的地图线要素提取方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22925903

Country of ref document: EP

Kind code of ref document: A1