# US 2022/0284551 A1 · Relighting system for single images

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0284551 A1
- Document ID: US20220284551A1
- Status: Published application
- Kind: A1
- Application number: 17/189,478
- Filed: 2021-03-02
- Published: 2022-09-08
- Earliest claimed: 2021-03-02
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Alexandros Neofytou; Eric Chris Wolfgang Sommerlade; Sunando Sengupta; Yang Liu
- Web page: https://patentgrep.com/patent/US20220284551A1

## CPC

- G06T 5/77: Retouching; Inpainting; Scratch removal
- G06T 5/94: based on local image properties, e.g. for local contrast enhancement
- G06F 18/214: Generating training patterns; Bootstrap methods, e.g. bagging or boosting
- G06N 3/0455: Auto-encoder networks; Encoder-decoder networks
- G06N 3/08: Learning methods
- G06N 3/0895: Weakly supervised learning, e.g. semi-supervised or self-supervised learning
- G06N 3/094: Adversarial learning
- G06T 5/60: using machine learning, e.g. neural networks
- G06T 11/10: Texturing; Colouring; Generation of textures or colours (retouching, inpainting or scratch removal G06T5/77)
- G06T 2207/10004: Still image; Photographic image
- G06T 2207/10024: Color image
- G06T 2207/20081: Training; Learning
- G06T 2207/20084: Artificial neural networks [ANN]
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

In various embodiments, a computer-implemented method of training a neural network for relighting an image is described. A first training set that includes source images and a target illumination embedding is generated, the source images having respective illuminated subjects. A second training set that includes augmented images and the target illumination embedding is generated, where the augmented images corresponding to the source images. A first autoencoder is trained using the first training set to generate a first output set that includes estimated source illumination embeddings and first reconstructed images that correspond to the source images, the reconstructed images having respective subjects that are i) from the corresponding source image, and ii) illuminated based on the target illumination embedding. A second autoencoder is trained using the second training set to generate a second output set that includes estimated augmented illumination embeddings and second reconstructed images that correspond to the augmented images.

## Claims

### Claim 1

A computer-implemented method of training a neural network for relighting an image, the method comprising:
generating a first training set that includes source images and a target illumination embedding, the source images having respective illuminated subjects;
generating a second training set that includes augmented images and the target illumination embedding, the augmented images corresponding to the source images;
training a first autoencoder using the first training set to generate a first output set that includes estimated source illumination embeddings and first reconstructed images that correspond to the source images, the reconstructed images having respective subjects that are i) from the corresponding source image, and ii) illuminated based on the target illumination embedding; and
training a second autoencoder using the second training set to generate a second output set that includes estimated augmented illumination embeddings and second reconstructed images that correspond to the augmented images.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein a loss function for the training of the first and second autoencoders includes minimizing a difference between the estimated source illumination embedding and the corresponding estimated augmented illumination embeddings.

### Claim 3 (depends on 2)

The computer-implemented method of claim 2, wherein:
the loss function represents the estimated source illumination embedding and the corresponding estimated augmented illumination embeddings using spherical harmonics; and
minimizing the difference between the estimated source illumination embedding and the corresponding estimated augmented illumination embeddings includes forcing representations of the target illumination embedding, the estimated source illumination embeddings, and the estimated augmented illumination embeddings to be converted to spherical harmonics.

### Claim 4 (depends on 2)

The computer-implemented method of claim 2, wherein the first and second autoencoders have a same structure and shared weights.

### Claim 5 (depends on 4)

The computer-implemented method of claim 4, wherein:
generating the second training set includes generating an augmented image from a source image by flipping the source image horizontally or vertically; and
minimizing the difference between the estimated source illumination embedding and the corresponding estimated augmented illumination embedding includes flipping one of the estimated source illumination embedding and the corresponding estimated augmented illumination embedding in a manner similar to the augmented image.

### Claim 6 (depends on 4)

The computer-implemented method of claim 4, wherein:
generating the second training set includes generating an augmented image from a source image by rotating the source image; and
minimizing the difference between the estimated source illumination embedding and the corresponding estimated augmented illumination embedding includes rotating one of the estimated source illumination embedding and the corresponding estimated augmented illumination embedding in a manner similar to the augmented image.

### Claim 7 (depends on 4)

The computer-implemented method of claim 4, wherein:
generating the second training set includes generating an augmented image from a source image by color inverting the source image; and
minimizing the difference between the estimated source illumination embedding and the corresponding estimated augmented illumination embedding includes color inverting one of the estimated source illumination embedding and the corresponding estimated augmented illumination embedding in a manner similar to the augmented image.

### Claim 8 (depends on 7)

The computer-implemented method of claim 7, wherein generating the augmented image from the source image by color inverting comprises:
converting the source image from an RGB color space to CIELAB color space to generate the augmented image;
estimating depth of the augmented image using a pretrained depth prediction model;
separating a subject of the augmented image from a background of the augmented image using the estimated depth;
inverting a perceptual lightness channel of the subject of the augmented image using the estimated depth without inverting the perceptual lightness channel of the background.

### Claim 9 (depends on 4)

The computer-implemented method of claim 4, wherein generating the second training set includes generating the augmented images from the source images by flipping, rotating, or color inverting the corresponding source image.

### Claim 10 (depends on 1)

The computer-implemented method of claim 1, wherein the source images are selected from an unlabeled image dataset.

### Claim 11 (depends on 1)

The computer-implemented method of claim 1, the method further comprising:
training a third autoencoder using the first training set to generate a third training set that includes estimated source illumination embeddings and transformed images that correspond to the source images, the transformed images having respective subjects that i) are from the corresponding source image, and ii) illuminated based on the target illumination embedding;
training a fourth autoencoder using the third training set to generate reconstructed images and reconstructed illumination embeddings, wherein the third and fourth autoencoders have a same structure and shared weights.

### Claim 12

A computer-implemented method of training a neural network for relighting an image, the method comprising:
generating a first training set that includes source images and a target illumination embedding, the source images having respective illuminated subjects;
training a first autoencoder using the first training set to generate a second training set that includes estimated source illumination embeddings and transformed images that correspond to the source images, the transformed images having respective subjects that i) are from the corresponding source image, and ii) illuminated based on the target illumination embedding;
training a second autoencoder using the second training set to generate reconstructed images and reconstructed illumination embeddings.

### Claim 13 (depends on 12)

The computer-implemented method of claim 12, wherein the first and second autoencoders have a same structure and shared weights.

### Claim 14 (depends on 13)

The computer-implemented method of claim 13, the method further comprising:
self-supervising the training of the first and second autoencoders using the source images and target illumination embedding as ground truths.

### Claim 15 (depends on 14)

The computer-implemented method of claim 14, wherein a loss function for the training of the first and second autoencoders includes i) mean absolute error loss between the source images and reconstructed images, ii) mean absolute error loss between the reconstructed illumination embeddings and the target illumination embedding, and ii) mean absolute loss of image gradient between the source images and reconstructed images.

### Claim 16 (depends on 12)

The computer-implemented method of claim 12, wherein the target illumination embedding is a randomized illumination embedding.

### Claim 17 (depends on 12)

The computer-implemented method of claim 12, wherein the source images are selected from an unlabeled image dataset.

### Claim 18

A computer-implemented method of relighting an input image, the method comprising:
receiving a single input image having an illuminated subject;
relighting the input image using a neural network and a target spherical harmonic lighting embedding to generate a relighted image having the subject of the single input image illuminated based on the target illumination embedding, the neural network having:
a first autoencoder trained using a first training set that includes source images and a target illumination embedding, the source images having respective illuminated subjects, the first autoencoder being trained to generate a first output set that includes estimated source illumination embeddings and first reconstructed images that correspond to the source images, the reconstructed images having respective subjects that are i) from the corresponding source image, and ii) illuminated based on the target illumination embedding, and
a second autoencoder trained using a second training set that includes augmented images and the target illumination embedding, the augmented images corresponding to the source images, the second autoencoder being trained to generate a second output set that includes estimated augmented illumination embeddings and second reconstructed images that correspond to the augmented images.

### Claim 19 (depends on 18)

The computer-implemented method of claim 18, further comprising receiving a data structure that represents the target spherical harmonic lighting embedding.

### Claim 20 (depends on 18)

The computer-implemented method of claim 18, further comprising:
receiving a reference image; and
generating a data structure that represents a reference spherical harmonic lighting embedding of the reference image using the neural network;
wherein relighting the source image comprises relighting the source image using the reference spherical harmonic lighting embedding as the target spherical harmonic lighting embedding.
