# US 12,764,281 B2 · External attention in neural network-based video coding

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

- Number: US 12,764,281 B2
- Document ID: US12764281B2
- Status: Granted
- Kind: B2
- Application number: 18/886,375
- Filed: 2024-09-16
- Published: 2025-01-02
- Granted: 2026-10-13
- Earliest claimed: 2021-06-30
- Assignees: Lemon Inc.
- Applicants: Lemon, Inc.
- Inventors: Yue Li; Kai Zhang; Li Zhang
- Web page: https://patentgrep.com/patent/US12764281B2

## CPC

- H04N 19/117: Filters, e.g. for pre-processing or post-processing (sub-band filter banks H04N19/635)
- G06N 3/04: Architecture, e.g. interconnection topology
- H04N 19/132: Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/82: involving filtering within a prediction loop
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method implemented by a video coding apparatus includes applying a neural network (NN) filter to an unfiltered sample of a video unit to generate a filtered sample. The NN filter is based on an NN filter model configured to obtain an attention based on a coding parameter input. The method also includes performing a conversion between a video media file and a bitstream based on the filtered sample that was generated.

## Claims

### Claim 1

A method implemented by a video coding apparatus, comprising:
applying a neural network (NN) filter to an unfiltered sample of a video unit to generate a filtered sample, wherein the NN filter is based on an NN filter model configured to obtain an attention based on a coding parameter input; and
performing a conversion between a video media file and a bitstream based on the filtered sample that was generated,
wherein an intermediate feature map of the NN filter model is to be recalibrated by the attention, and wherein the attention is obtained by concatenating the coding parameter input with the intermediate feature map to provide a concatenated result, and feeding the concatenated result into convolutional layers of the NN filter.

### Claim 2 (depends on 1)

The method of claim 1, wherein the coding parameter input comprises one or more selected from a group consisting of: a partitioning scheme for the video unit; a prediction mode of the video unit; a quantization parameter associated with the video unit; and a boundary strength parameter for a boundary of the video unit.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
extracting features from the coding parameter input using the convolutional layers of the NN filter; and
using the extracted features as an attention in the NN filter model.

### Claim 4 (depends on 3)

The method of claim 3, wherein the attention is obtained using a two-layer convolutional neural network, and wherein the attention is a single-channel feature map having a spatial resolution that is the same as a spatial resolution of the intermediate feature map of the NN filter model to be recalibrated by the attention.

### Claim 5 (depends on 3)

The method of claim 3, further comprising recalibrating intermediate feature maps of the NN filter model using the attention, wherein the intermediate feature maps of the NN filter model are given as G, where G∈RN×W×H, wherein N is a channel number, W is a channel width, and H is a channel height, and wherein the obtained attention is given as A, where A∈RW×H, wherein R is a domain that each element in the intermediate feature maps or the attention belongs to.

### Claim 6 (depends on 5)

The method of claim 5, wherein φ represents the recalibrated intermediate feature maps, and wherein applying the attention comprises providing the recalibrated intermediate feature maps according to φi,j,k=Gi,j,k×Aj,k, wherein 1i≤N, wherein 1j≤W, and wherein 1≤k≤H, wherein i is an index variable for a channel dimension, j is an index variable for a width dimension, and k is an index variable for a height dimension.

### Claim 7 (depends on 5)

The method of claim 5, wherein φ represents the recalibrated intermediate feature maps, and wherein applying the attention comprises providing the recalibrated intermediate feature maps according to φi,j,k=Gi,j,k×ƒ(Aj,k), wherein 1i≤N, wherein 1j≤W, wherein 1≤k≤H, and wherein ƒ represents a mapping function applied on each element of the attention, wherein i is an index variable for a channel dimension, j is an index variable for a width dimension, and k is an index variable for a height dimension.

### Claim 8 (depends on 7)

The method of claim 7, wherein the mapping function ƒ comprises a sigmoid function or a hyperbolic tangent function.

### Claim 9 (depends on 7)

The method of claim 7, wherein a different A or ƒ is used for different channels of the intermediate feature maps.

### Claim 10 (depends on 5)

The method of claim 5, wherein φ represents the recalibrated intermediate feature maps, and wherein applying the attention comprises providing the recalibrated intermediate feature maps according to φi,j,k=Gi,j,k×ƒ(Aj,k)+Gi,j,k, wherein 1i≤N, wherein 1j≤W, wherein 1≤k≤H, and wherein ƒ represents a mapping function applied on each element of the attention, wherein i is an index variable for a channel dimension, j is an index variable for a width dimension, and k is an index variable for a height dimension.

### Claim 11 (depends on 10)

The method of claim 10, wherein the mapping function ƒ comprises a sigmoid function or a hyperbolic tangent function.

### Claim 12 (depends on 10)

The method of claim 10, wherein a different A or ƒ is used for different channels of the intermediate feature maps.

### Claim 13 (depends on 5)

The method of claim 5, wherein the attention is applied to specified layers inside the NN filter model.

### Claim 14 (depends on 13)

The method of claim 13, wherein the NN filter model contains residual blocks, and wherein the attention is only applied on feature maps from a last layer of each residual block.

### Claim 15 (depends on 1)

The method of claim 1, wherein the NN filter is one or more selected from a group consisting of: an adaptive loop filter, a deblocking filter, and a sample adaptive offset filter.

### Claim 16 (depends on 1)

The method of claim 1, wherein the conversion comprises generating the bitstream according to the video media file.

### Claim 17 (depends on 1)

The method of claim 1, wherein the conversion comprises parsing the bitstream to obtain the video media file.

### Claim 18

An apparatus for coding video data comprising a processor and a non-transitory memory with instructions thereon, wherein the instructions upon execution by the processor cause the processor to:
apply a neural network (NN) filter to an unfiltered sample of a video unit to generate a filtered sample, wherein the NN filter is based on an NN filter model configured to obtain an attention based on a coding parameter input; and
convert between a video media file and a bitstream based on the filtered sample that was generated,
wherein an intermediate feature map of the NN filter model is to be recalibrated by the attention, and wherein the attention is obtained by concatenating the coding parameter input with the intermediate feature map to provide a concatenated result, and feeding the concatenated result into convolutional layers of the NN filter.

### Claim 19

A method for storing a bitstream of a video, comprising:
applying a neural network (NN) filter to an unfiltered sample of a video unit to generate a filtered sample, wherein the NN filter is based on an NN filter model configured to obtain an attention based on a coding parameter input;
generating the bitstream based on the filtered sample that was generated; and
storing the bitstream in a non-transitory computer-readable recording medium,
wherein an intermediate feature map of the NN filter model is to be recalibrated by the attention, and wherein the attention is obtained by concatenating the coding parameter input with the intermediate feature map to provide a concatenated result, and feeding the concatenated result into convolutional layers of the NN filter.

### Claim 20 (depends on 18)

The apparatus of claim 18, wherein the coding parameter input comprises one or more selected from a group consisting of: a partitioning scheme for the video unit; a prediction mode of the video unit; a quantization parameter associated with the video unit; and a boundary strength parameter for a boundary of the video unit.
