# US 2025/0157235 A1 · Semantic labeling of images with generative language model

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

- Number: US 2025/0157235 A1
- Document ID: US20250157235A1
- Status: Published application
- Kind: A1
- Application number: 18/509,072
- Filed: 2023-11-14
- Published: 2025-05-15
- Earliest claimed: 2023-11-14
- Assignees: Lemon Inc.
- Applicants: Lemon Inc.
- Inventors: Qihang Yu; Xiaohui Shen; Liang-Chieh Chen
- Web page: https://patentgrep.com/patent/US20250157235A1

## CPC

- G06V 20/70: Labelling scene content, e.g. deriving syntactic or semantic representations
- G06F 16/3344: {using natural language analysis}
- G06F 40/30: Semantic analysis
- G06V 10/25: Determination of region of interest [ROI] or a volume of interest [VOI]
- G06V 10/267: {by performing operations on regions, e.g. growing, shrinking or watersheds}
- G06V 10/7715: {Feature extraction, e.g. by transforming the feature space, e.g. multi-dimensional scaling [MDS]; Mappings, e.g. subspace methods}
- G06V 10/774: Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
- G06V 10/82: using neural networks
- G06V 20/50: Context or environment of the image
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computing system including one or more processing devices configured to receive an image. The processing devices are further configured to compute a segmentation mask that identifies a region of interest included in the image. At a feature extractor, the processing devices are further configured to compute encoded image features based on the image. The processing devices are further configured to receive a text instruction. At a visual resampler, the processing devices are further configured to compute a mask query based on the segmentation mask, the encoded image features, and the text instruction. At a generative language model, the processing devices are further configured to receive a natural language query that includes the mask query and the text instruction. Based on the natural language query, at the generative language model, the processing devices are further configured to generate and output a semantic label associated with the region of interest.

## Claims

### Claim 1

A computing system comprising:
one or more processing devices configured to:
receive an image;
compute a segmentation mask that identifies a region of interest included in the image;
at a feature extractor, compute a plurality of encoded image features based at least in part on the image;
receive a text instruction;
at a visual resampler, compute a mask query based at least in part on the segmentation mask, the plurality of encoded image features, and the text instruction, the mask query including a plurality of text tokens;
at a generative language model:
receive a natural language query that includes the mask query and the text instruction; and
based at least in part on the natural language query, generate a semantic label associated with the region of interest; and
output the semantic label.

### Claim 2 (depends on 1)

The computing system of claim 1, wherein the visual resampler is further configured to:
receive a mode query that indicates a vocabulary specificity mode; and
compute the mask query based at least in part on the mode query.

### Claim 3 (depends on 2)

The computing system of claim 2, wherein the natural language query further includes the mode query.

### Claim 4 (depends on 3)

The computing system of claim 3, wherein the vocabulary specificity mode is:
a vocabulary-specific mode in which the mode query includes a plurality of predefined classification labels; or
a vocabulary-agnostic mode in which the mode query does not include predefined classification labels.

### Claim 5 (depends on 1)

The computing system of claim 1, wherein:
the one or more processing devices are configured to compute the encoded image features at least in part by sampling a plurality of windows of the image; and
the plurality of windows each have a window size that is smaller than a total size of the image.

### Claim 6 (depends on 1)

The computing system of claim 1, wherein:
the one or more processing devices are further configured to compute a context query associated with a bounding box that surrounds the region of interest; and
the visual resampler is further configured to receive the context query as input.

### Claim 7 (depends on 1)

The computing system of claim 1, wherein the visual resampler has a transformer architecture that includes a plurality of transformer layers, each of which includes:
a self-attention layer;
a masked cross-attention layer;
a context cross-attention layer;
a first feed-forward layer; and
a second feed-forward layer.

### Claim 8 (depends on 1)

The computing system of claim 1, wherein the visual resampler is trained with a training corpus including:
a plurality of training images;
a plurality of ground-truth masks associated with respective training regions of interest within the training images; and
a plurality of ground-truth labels associated with the ground-truth masks.

### Claim 9 (depends on 8)

The computing system of claim 8, wherein the visual resampler is trained via instruction tuning.

### Claim 10 (depends on 8)

The computing system of claim 8, wherein:
the training corpus is a union of a plurality of training data subsets in which the corresponding ground-truth labels have different respective label spaces;
the one or more processing devices are further configured to compute a plurality of mode queries that are respectively associated with the training data subsets and indicate the respective label spaces; and
the visual resampler is further configured to receive the mode queries during training.

### Claim 11

A method for image processing, the method comprising:
receiving an image;
computing a segmentation mask that identifies a region of interest included in the image;
computing a plurality of encoded image features based at least in part on the image;
receiving a text instruction;
computing a mask query based at least in part on the segmentation mask, the plurality of encoded image features, and the text instruction, the mask query including a plurality of text tokens;
receiving a natural language query that includes the mask query and the text instruction; and
based at least in part on the natural language query, generating a semantic label associated with the region of interest; and
outputting the semantic label.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
receiving a mode query that indicates a vocabulary specificity mode; and
computing the mask query based at least in part on the mode query.

### Claim 13 (depends on 12)

The method of claim 12, wherein:
the natural language query further includes the mode query; and
the vocabulary specificity mode is:
a vocabulary-specific mode in which the mode query includes a plurality of predefined classification labels; or
a vocabulary-agnostic mode in which the mode query does not include predefined classification labels.

### Claim 14 (depends on 11)

The method of claim 11, wherein:
computing the encoded image features includes sampling a plurality of windows of the image; and
the plurality of windows each have a window size that is smaller than a total size of the image.

### Claim 15 (depends on 11)

The method of claim 11, further comprising:
computing a context query associated with a bounding box that surrounds the region of interest; and
receiving the context query as input.

### Claim 16 (depends on 11)

The method of claim 11, wherein:
the mask query is computed at a visual resampler; and
the visual resampler has a transformer architecture that includes a plurality of transformer layers, each of which includes:
a self-attention layer;
a masked cross-attention layer;
a context cross-attention layer;
a first feed-forward layer; and
a second feed-forward layer.

### Claim 17 (depends on 16)

The method of claim 16, further comprising training the visual resampler with a training corpus including:
a plurality of training images;
a plurality of ground-truth masks associated with respective training regions of interest within the training images; and
a plurality of ground-truth labels associated with the ground-truth masks.

### Claim 18 (depends on 17)

The method of claim 17, wherein the visual resampler is trained via instruction tuning.

### Claim 19 (depends on 17)

The method of claim 17, wherein:
the training corpus is a union of a plurality of training data subsets in which the corresponding ground-truth labels have different respective label spaces; and
the method further comprises:
computing a plurality of mode queries that are respectively associated with the training data subsets and indicate the respective label spaces; and
at the visual resampler, receiving the mode queries during training.

### Claim 20

A computing system comprising:
one or more processing devices configured to:
receive an image;
compute a segmentation mask that identifies a region of interest included in the image;
compute a plurality of encoded image features based at least in part on the image;
compute a context query associated with a bounding box that surrounds the region of interest;
receive a text instruction;
receive a mode query that indicates a vocabulary specificity mode;
compute a mask query based at least in part on the segmentation mask, the plurality of encoded image features, the context query, the text instruction, and the mode query, the mask query including a plurality of text tokens;
receive a natural language query that includes the mask query and the text instruction;
based at least in part on the natural language query, generate a semantic label associated with the region of interest; and
output the semantic label.
