IP Library Granted Patent US 12,468,756
Granted Patent B2
US 12,468,756 · App. 18/615,096 · Granted Nov 11, 2025

Query evaluation for image retrieval and conditional image generation

Inventors: Pratyay Banerjee (San Jose, CA); Ojas Yashwant Joshi (Redwood City, CA); Amita Misra (San Jose, CA)
Assignee: AMAZON TECHNOLOGIES, INC.
G06F16/532G06F16/51G06F40/295
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,468,756
App. No.
18/615,096
Filed
Mar 25, 2024
Granted
Nov 11, 2025
Kind
B2
Examiner
TRAN, LOC
Art Unit
2165
USPC
707/769
Abstract

Techniques are generally described for query evaluation for image retrieval and image generation. In various examples, a first encoded representation of first natural language input data may be generated. An image retrieval process may be selected from among the image retrieval process and an image generation process based at least in part on the first encoded representation of the first natural language input data. A second natural language encoder may generate a second encoded representation of the first natural language input data. The second encoded representation may be used to determine first image data stored in a first data repository. The first image data may be sent for output on a display of a first computing device.

Claims (107)

1 . A computer-implemented method comprising:

receiving first natural language input data comprising a first natural language processing system response to a first user input;

generating, using a first natural language encoder, a first encoded representation of the first natural language input data;

determining, using named entity recognition processing, that the first encoded representation is associated with a mention of an entity;

determining, from among a query embedding-based image retrieval process and an image generation process, that the query embedding-based image retrieval process is more appropriate for responding to the first user input based at least in part on the determining that the first encoded representation of the first natural language input data is associated with the mention of the entity;

generating, using a second natural language encoder, a second encoded representation of the first natural language input data;

determining, by searching an embedding space using the second encoded representation, first embedding data representing first image data based at least in part on a distance in the embedding space between the second encoded representation and the first embedding data; and

sending the first image data for output on a display of a first computing device associated with the first user input.

2 . The computer-implemented method of claim 1 , further comprising:

generating a first graph query comprising first entity data identifying the entity;

querying a first graph-based data structure associated with a plurality of recognized entities using the first graph query;

receiving, in response to the querying the first graph-based data structure, second image data associated with the first entity; and

selecting, from among the first image data and the second image data, the first image data for output on the display of the first computing device.

3 . The computer-implemented method of claim 1 , further comprising:

receiving second natural language input data comprising a second natural language processing system response to a second user input;

generating, using the first natural language encoder, a third encoded representation of the second natural language input data;

determining, using named entity recognition processing, that the third encoded representation does not reference a recognized entity;

determining, using a first machine learning classifier, that the second natural language input data is classified as a creative natural language input;

determining, from among the query embedding-based image retrieval process and the image generation process, that the image generation process is more appropriate for responding to the second user input based at least in part on the determining that the second natural language input data is classified as the creative natural language input;

generating, using a latent diffusion model and the second natural language input data, second image data; and

sending the second image data for output on a display of a second computing device associated with the second user input.

4 . The computer-implemented method of claim 1 , further comprising:

determining, using a first machine learning classifier, that the first natural language input data includes temporal information;

generating, using the second natural language encoder, the second encoded representation of the first natural language input data comprising at least one temporal feature representing the temporal information; and

determining the first embedding data based at least in part on the at least one temporal feature, wherein the first image data is associated with the temporal information.

5 . A method comprising:

receiving first natural language input data;

generating, using a first natural language encoder, a first encoded representation of the first natural language input data;

determining, from among an image retrieval process and an image generation process, that the image retrieval process is appropriate for the first natural language input data based at least in part on the first encoded representation of the first natural language input data;

generating, using a second natural language encoder, a second encoded representation of the first natural language input data;

determining, using the second encoded representation, first image data stored in a first data repository; and

sending the first image data for output on a display of a first computing device.

6 . The method of claim 5 , further comprising:

determining, using named entity recognition processing, that the first encoded representation is associated with a first recognized entity; and

selecting the image retrieval process instead of the image generation process based at least in part on the first encoded representation of the first natural language input data being associated with the first recognized entity.

7 . The method of claim 5 , further comprising:

receiving second natural language input data;

generating, using the first natural language encoder, a second encoded representation of the second natural language input data;

determining, using a first machine learning classifier, that the second natural language input data is classified as a creative input;

selecting, from among the image retrieval process and the image generation process, the image generation process based at least in part on the second natural language input data being classified as the creative input;

generating, using a latent diffusion model and the second natural language input data, second image data; and

sending the second image data for output on a display of a second computing device.

8 . The method of claim 7 , further comprising:

receiving a first training data instance comprising a first natural language query labeled with first label data indicating that the first natural language query is classified as the creative input;

generating, using the first natural language encoder, a third encoded representation of the first natural language query;

generating, by the first machine learning classifier using the first natural language query, first prediction data;

determining first error data representing a difference between the first prediction data and the first label data; and

determining an updated set of parameters for at least one of the first natural language encoder or the first machine learning classifier based on the first error data.

9 . The method of claim 5 , further comprising:

determining, using a first machine learning classifier, that the first natural language input data includes temporal information;

generating, using the second natural language encoder, the second encoded representation of the first natural language input data comprising at least one temporal feature representing the temporal information; and

determining the first image data based at least in part on the at least one temporal feature, wherein the first image data is associated with the temporal information.

10 . The method of claim 5 , further comprising:

receiving second natural language input data;

generating, using the first natural language encoder, a second encoded representation of the second natural language input data; and

determining, using a first machine learning classifier using the second encoded representation, first output data indicating that no image is to be retrieved or generated for the second natural language input data.

11 . The method of claim 5 , further comprising:

identifying a first recognized entity represented in the first natural language input data;

generating a first graph query comprising first entity data identifying the first recognized entity;

querying a first graph-based data structure associated with a plurality of recognized entities using the first graph query;

receiving, in response to the querying the first graph-based data structure, second image data associated with the first recognized entity; and

selecting, from among the first image data and the second image data, the first image data for output on the display of the first computing device.

12 . The method of claim 5 , further comprising:

sending the first image data and second image data to a compositional image generator; and

generating, by the compositional image generator a compositional image using the first image data and the second image data.

13 . A system comprising:

at least one processor; and

non-transitory computer-readable memory storing instructions that, when executed by the at least one processor, are effective to:

receive first natural language input data;

generate, using a first natural language encoder, a first encoded representation of the first natural language input data;

determine, from among an image retrieval process and an image generation process, that the image retrieval process is appropriate for the first natural language input data based at least in part on the first encoded representation of the first natural language input data;

generate, using a second natural language encoder, a second encoded representation of the first natural language input data;

determine, using the second encoded representation, first image data stored in a first data repository; and

send the first image data for output on a display of a first computing device.

14 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

determine, using named entity recognition processing, that the first encoded representation is associated with a first recognized entity; and

select the image retrieval process instead of the image generation process based at least in part on the first encoded representation of the first natural language input data being associated with the first recognized entity.

15 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

receive second natural language input data;

generate, using the first natural language encoder, a second encoded representation of the second natural language input data;

determine, using a first machine learning classifier, that the second natural language input data is classified as a creative input;

select, from among the image retrieval process and the image generation process, the image generation process based at least in part on the second natural language input data being classified as the creative input;

generate, using a latent diffusion model and the second natural language input data, second image data; and

send the second image data for output on a display of a second computing device.

16 . The system of claim 15 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

receive a first training data instance comprising a first natural language query labeled with first label data indicating that the first natural language query is classified as the creative input;

generate, using the first natural language encoder, a third encoded representation of the first natural language query;

generate, by the first machine learning classifier using the first natural language query, first prediction data;

determine first error data representing a difference between the first prediction data and the first label data; and

determine an updated set of parameters for at least one of the first natural language encoder or the first machine learning classifier based on the first error data.

17 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

determine, using a first machine learning classifier, that the first natural language input data includes temporal information;

generate, using the second natural language encoder, the second encoded representation of the first natural language input data comprising at least one temporal feature representing the temporal information; and

determine the first image data based at least in part on the at least one temporal feature, wherein the first image data is associated with the temporal information.

18 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

receive second natural language input data;

generate, using the first natural language encoder, a second encoded representation of the second natural language input data; and

determine, using a first machine learning classifier using the second encoded representation, first output data indicating that no image is to be retrieved or generated for the second natural language input data.

19 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

identify a first recognized entity represented in the first natural language input data;

generate a first graph query comprising first entity data identifying the first recognized entity;

query a first graph-based data structure associated with a plurality of recognized entities using the first graph query;

receive, in response to the querying the first graph-based data structure, second image data associated with the first recognized entity; and

select, from among the first image data and the second image data, the first image data for output on the display of the first computing device.

20 . The system of claim 13 , the non-transitory computer-readable memory storing further instructions that, when executed by the at least one processor, are further effective to:

generate, using the first natural language input data and a latent diffusion model, second image data; and

select, from among the first image data and the second image data, the first image data for output on the display of the first computing device.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 25, 2024
From: BANERJEE, PRATYAY; JOSHI, OJAS YASHWANT; MISRA, AMITA
To: AMAZON TECHNOLOGIES, INC.
Reel/Frame 066889/0733 →
Continuity (1)
Related Publication 20250298839A1 · Sep 25, 2025
References Cited (7)
US 10552541B1 · Dreher · 2020 [cited by examiner]
US 12229192B2 · Lott · 2025 [cited by examiner]
US 20060053000A1 · Moldovan · 2006 [cited by examiner]
US 20230161808A1 · Bursztyn · 2023 [cited by examiner]
US 20240251178A1 · Basu · 2024 [cited by examiner]
Budaraju, Hema; New ways to get inspired 1-15 with generative AI in Search; Google Blog; Oct. 12, 2023; 5 pgs. [cited by applicant]
Rameseder, Jonathan; International Search Report and Written Opinion of PCT/US2025/020160; Jun. 5, 2025; 3 pgs. [cited by applicant]