# US 2024/0203005 A1 · Automated evaluation of spatial relationships in images

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

- Number: US 2024/0203005 A1
- Document ID: US20240203005A1
- Status: Published application
- Kind: A1
- Application number: 18/198,593
- Filed: 2023-05-17
- Published: 2024-06-20
- Earliest claimed: 2022-12-16
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Hamid PALANGI; Besmira NUSHI; Vibhav VINEET; Eric J. HORVITZ; Semiha E. KAMAR EDEN; Tejas GOKHALE
- Web page: https://patentgrep.com/patent/US20240203005A1

## CPC

- G06F 40/40: Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30)
- G06T 7/11: Region-based segmentation
- G06T 7/60: Analysis of geometric attributes
- G06T 7/75: {involving models}
- G06T 11/00: Two-dimensional [2D] image generation
- G06T 11/60: Creating or editing images; Combining images with text
- G06V 10/809: {of classification results, e.g. where the classifiers operate on the same input data}
- G06V 10/82: using neural networks
- G06V 20/70: Labelling scene content, e.g. deriving syntactic or semantic representations
- G06T 2207/20081: Training; Learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

This document relates to automated analysis of images. One example method involves obtaining an image and text associated with the image, detecting two or more objects in the image, and determining respective locations of the two or more detected objects in the image. The example method also involves determining whether a spatial relationship between the two or more detected objects matches a corresponding spatial relationship expressed by the text based at least on the respective locations of the two or more detected objects. The example method also involves outputting a value reflecting whether the spatial relationship between the two or more detected objects matches the corresponding spatial relationship expressed by the text.

## Claims

### Claim 1

A method comprising:
obtaining an image and text associated with the image;
detecting two or more objects in the image;
determining respective locations of the two or more detected objects in the image;
based at least on the respective locations of the two or more detected objects, determining whether a spatial relationship between the two or more detected objects matches a corresponding spatial relationship expressed by the text; and
outputting a value reflecting whether the spatial relationship between the two or more detected objects matches the corresponding spatial relationship expressed by the text.

### Claim 2 (depends on 1)

The method of claim 1, wherein the value reflects whether the two or more detected objects match respective object categories expressed by the text.

### Claim 3 (depends on 2)

The method of claim 2, further comprising generating the image from the text by inputting the text to a text-to-image synthesis model.

### Claim 4 (depends on 3)

The method of claim 3, further comprising generating another value reflecting whether at least a threshold number of spatial relationships between multiple detected objects in multiple images generated by inputting the text to the text-to-image synthesis model match the corresponding spatial relationship expressed by the text.

### Claim 5 (depends on 3)

The method of claim 3, further comprising generating another value reflecting a conditional probability that spatial relationships between multiple detected objects in multiple images generated by inputting multiple instances of text to the text-to-image synthesis model match corresponding spatial relationships expressed by the multiple instances of text, given that the multiple detected objects match respective object categories expressed by the multiple instances of text.

### Claim 6 (depends on 3)

The method of claim 3, further comprising ranking the text-to-image synthesis model relative to another text-to-image synthesis model based at least on the value and another value reflecting whether another spatial relationship between two or more detected objects in another image generated by the another text-to-image synthesis model using the text matches the corresponding spatial relationship expressed by the text.

### Claim 7 (depends on 1)

The method of claim 1, wherein the detecting comprises inputting the image to an object detector that outputs respective categories of the two or more detected objects.

### Claim 8 (depends on 6)

The method of claim 6, further comprising:
obtaining, from an object detector, bounding boxes around the two or more detected objects; and
determining the spatial relationship between the two or more detected objects based on a spatial relationship between centroids of the bounding boxes.

### Claim 9

A system comprising:
a processor; and
a storage medium storing instructions which, when executed by the processor, cause the processor to:
determine respective locations of two or more objects in an image;
based at least on the respective locations of the two or more objects, determine whether a spatial relationship between the two or more objects matches a corresponding spatial relationship expressed by text associated with the image; and
output a value reflecting whether the spatial relationship between the two or more objects matches the corresponding relationship expressed by the text associated with the image.

### Claim 10 (depends on 9)

The system of claim 9, wherein the instructions, when executed by the processor, cause the processor to:
filter searchable images to obtain image search results based at least on whether spatial relationships between objects in the searchable images match spatial relationships expressed in search queries.

### Claim 11 (depends on 10)

The system of claim 10, wherein the searchable images are provided by a web-based search engine or in a local or cloud-based image repository associated with a particular user.

### Claim 12 (depends on 9)

The system of claim 9, wherein the text is a caption for the image.

### Claim 13 (depends on 12)

The system of claim 12, wherein the caption is user-generated and the instructions, when executed by the processor, cause the processor to:
output an indication whether the caption matches the spatial relationship between the two or more objects.

### Claim 14 (depends on 13)

The system of claim 13, wherein the instructions, when executed by the processor, cause the processor to:
generate a suggested alternative caption that expresses the spatial relationship between the two or more objects; and
output the suggested alternative caption.

### Claim 15 (depends on 12)

The system of claim 12, wherein the caption is generated by an image-to-text model.

### Claim 16 (depends on 15)

The system of claim 15, wherein the instructions, when executed by the processor, cause the processor to:
perform a comparison of the caption generated by the image-to-text model to another text used to generate the image using a text-to-image synthesis model; and
refine or evaluate the image-to-text model based at least on the comparison.

### Claim 17 (depends on 9)

The system of claim 9, wherein the instructions, when executed by the processor, cause the processor to:
generate an overall image quality score from the value and at least one other value reflecting at least one other characteristic of the image.

### Claim 18 (depends on 9)

The system of claim 9, wherein the instructions, when executed by the processor, cause the processor to:
cleanse a corpus of images and associated text based at least on values reflecting whether spatial relationships between objects in images in the corpus match spatial relationships expressed by the associated text.

### Claim 19 (depends on 18)

The system of claim 18, wherein the instructions, when executed by the processor, cause the processor to:
train a machine learning model based at least on the cleansed corpus.

### Claim 20

A computer-readable storage medium storing instructions which, when executed by a computing device, cause the computing device to perform acts comprising:
obtaining an image and text relating to the image;
detecting two or more objects in the image;
determining respective locations of the two or more detected objects in the image;
based at least on the respective locations of the two or more detected objects, determining whether a spatial relationship between the two or more detected objects matches a corresponding spatial relationship expressed by the text; and
outputting a value reflecting whether the spatial relationship between the two or more detected objects matches a corresponding spatial relationship expressed by the text.
