# US 2022/0292623 A1 · Method for watermarking a machine learning model

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

- Number: US 2022/0292623 A1
- Document ID: US20220292623A1
- Status: Published application
- Kind: A1
- Application number: 17/199,526
- Filed: 2021-03-12
- Published: 2022-09-15
- Earliest claimed: 2021-03-12
- Assignees: NXP B.V.
- Applicants: NXP B.V.
- Inventors: Wilhelmus Petrus Adrianus Johannus MICHIELS; Frederik Dirk Schalij
- Web page: https://patentgrep.com/patent/US20220292623A1

## CPC

- G06T 1/0021: {Image watermarking}
- G06T 1/0028: {Adaptive watermarking, e.g. Human Visual System [HVS]-based watermarking}
- G06F 18/214: Generating training patterns; Bootstrap methods, e.g. bagging or boosting
- G06F 18/217: {Validation; Performance evaluation; Active pattern learning techniques}
- G06F 21/16: Program or content traceability, e.g. by watermarking
- G06N 3/09: Supervised learning
- G06N 20/00: Machine learning
- G06T 1/0064: {Geometric transfor invariant watermarking, e.g. affine transform invariant}
- G06V 10/25: Determination of region of interest [ROI] or a volume of interest [VOI]
- G06V 10/774: Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
- G06T 2201/0051: Embedding of the watermark in the spatial domain
- 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
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

A method is provided for watermarking a machine learning model used for object detection or image classification. In the method, a first subset of a labeled set of ML training samples is selected. The first subset is of a predetermined class of images. In one embodiment, the first pixel pattern is selected and sized to have substantially the same dimensions as each sample of the first subset or each bounding box in the case of an object detector. Each sample of the first subset is relabeled to have a different label than the original label. An opacity of the pixel pattern may be adjusted independently for different parts of the pattern. The ML model is trained with the labeled set of ML training samples and the first subset of relabeled ML training samples. Using multiple different opacity factors provides both reliability and credibility to the watermark.

## Claims

### Claim 1

A method for watermarking a machine learning (ML) model for use in object detection, the method comprising:
selecting a set of training samples to use for training the ML model;
selecting a first subset of samples from the set of training samples, each of the first subset of samples having an object of a predetermined class;
selecting a first pixel pattern to use as a watermark in the first subset of samples;
drawing a bounding box around each of the objects in the first subset of samples, wherein the bounding box has a first dimension and a second dimension;
selecting a target label that is unrelated to the predetermined class;
labeling each bounding box of the first set of images with the target label;
inserting the first pixel pattern into each bounding box of the first subset of samples, wherein the first pixel pattern is scaled for each bounding box for each of the objects such that a first dimension of the first pixel pattern substantially matches one of the first or second dimensions of the bounding box; and
training the ML model with the set of training samples and the first subset of samples to produce a trained and watermarked ML model.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first pixel pattern comprises a first set of pixels having a first opacity factor and a second set of pixels having a second opacity factor, wherein the first opacity factor and the second opacity factor are independently selectable.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
selecting a set of test samples to use for testing the ML model after training;
selecting a second subset of samples from the set of test samples, each of the second subset of samples having an object of the predetermined class;
drawing a bounding box around each of the objects of the second subset of samples;
inserting the first pixel pattern into each bounding box of the second subset of samples; and
using the second subset of samples to identify the ML model.

### Claim 4 (depends on 1)

The method of claim 1, wherein a second dimension of the first pixel pattern is changed to match the second dimension of the bounding box for each of the objects.

### Claim 5 (depends on 1)

The method of claim 1, wherein the objects in the first subset of samples have varying sizes and shapes, and wherein, for each of the objects, the first pixel pattern is scaled to fit within each bounding box around each of the objects in the first subset of samples according to a ratio of object width to pixel pattern width and according to object length to pixel pattern length.

### Claim 6 (depends on 1)

The method of claim 1, wherein inserting the first pixel pattern into each bounding box of the first subset of samples further comprises inserting the first pixel pattern into each bounding box of the first subset of samples so that there is a margin between an edge of the object within each of the bounding boxes and an edge of the pixel pattern.

### Claim 7 (depends on 1)

The method of claim 1, wherein selecting a first subset of samples from the set of training samples further comprises selecting the first subset of samples so that there are no overlapping objects of the predetermined class.

### Claim 8 (depends on 1)

The method of claim 1, wherein inserting the first pixel pattern into each bounding box of the first subset of samples further comprises inserting the first pixel pattern into a bounding box of the first subset of samples having an object that is partially behind another object so that the first pixel pattern overlaps the another object.

### Claim 9 (depends on 1)

The method of claim 1, wherein inserting the first pixel pattern into each bounding box of the first subset of samples further comprises selecting a minimum size and inserting the first pixel pattern into each bound box of the first subset of samples that are larger than the minimum size.

### Claim 10 (depends on 1)

The method of claim 1, further comprising removing the bounding box and target label from around each of the objects in the first subset of samples.

### Claim 11 (depends on 1)

The method of claim 1, further comprising:
operating the trained and watermarked ML model in an inference operating mode;
inputting a sample having at least one object of the predetermined class; and
outputting, by the trained and watermarked ML model a class label and a bounding box that includes the at least one object, wherein the class label is the target label that is unrelated to the predetermined class.

### Claim 12

A method for watermarking a machine learning model (ML), the method comprising:
selecting a labeled set of ML training samples to use for training the ML model;
selecting a first subset of the labeled set of ML training samples for use in generating a watermark in the ML model, wherein the first subset is of a predetermined classification of images;
selecting a first pixel pattern for use as the watermark;
inserting the first pixel pattern into each sample of the first subset of the labeled ML training data samples, wherein the first pixel pattern comprises a first set of pixels having a first opacity factor and a second set of pixels having a second opacity factor, wherein the first opacity factor and the second opacity factor are independently selectable;
selecting a target label that is unrelated to the predetermined class;
relabeling each sample of the first subset of labeled ML training data samples with the target label; and
training the ML model with the labeled set of ML training samples and the first subset of relabeled ML training samples having the first pixel pattern to produce a trained and watermarked ML model.

### Claim 13 (depends on 12)

The method of claim 12, wherein the machine learning model is for use in an object detector, and wherein a bounding box is drawn around an object in each sample of the first subset of samples, wherein each of the objects in the first subset of samples are in a predetermined class, and wherein inserting the first pixel pattern into each sample of the first subset of samples further comprises inserting the first pixel pattern into each bounding box of the first subset of samples.

### Claim 14 (depends on 13)

The method of claim 13, wherein the bounding box has a first dimension and a second dimension, wherein the first pixel pattern has a first dimension and a second dimension, and wherein the first pixel pattern is scaled for each bounding box for each of the objects such that a first dimension of the first pixel pattern substantially matches one of the first or second dimensions of the bounding box.

### Claim 15 (depends on 14)

The method of claim 14, wherein a second dimension of the first pixel pattern is changed to match the second dimension of the bounding box for each of the objects.

### Claim 16 (depends on 13)

The method of claim 13, wherein the objects in the first subset of samples have varying sizes and shapes, and wherein, for each of the objects, the first pixel pattern is scaled to fit within each bounding box around each of the objects in the first subset of samples according to a ratio of object width to pixel pattern width and according to object length to pixel pattern length.

### Claim 17 (depends on 13)

The method of claim 13, wherein inserting the first pixel pattern into each bounding box of the first subset of samples further comprises inserting the first pixel pattern into each bounding box of the first subset of samples such that there is a margin between an edge of the object within each of the bounding boxes and an edge of the pixel pattern.

### Claim 18 (depends on 13)

The method of claim 13, wherein selecting a first subset of samples from the set of training samples further comprises selecting the first subset of samples such that there are no overlapping objects of the predetermined class.

### Claim 19 (depends on 13)

The method of claim 13, wherein inserting the first pixel pattern into each bounding box of the first subset of samples further comprises inserting the first pixel pattern into a bounding box of the first subset of samples having an object that is partially behind another object so that the first pixel pattern overlaps the another object.

### Claim 20 (depends on 13)

The method of claim 13, wherein inserting the first pixel pattern into each bounding box of the first subset of samples further comprises selecting a minimum size and inserting the first pixel pattern into each bound box of the first subset of samples that are larger than the minimum size.

### Claim 21 (depends on 13)

The method of claim 13, further comprising removing the bounding box and target label from around each of the objects in the first subset of samples.

### Claim 22 (depends on 13)

The method of claim 13, further comprising:
operating the trained and watermarked ML model in an inference operating mode;
inputting a sample having at least one object of the predetermined class; and
outputting, by the trained and watermarked ML model a class label and a bounding box that includes the at least one object, wherein the class label is the target label that is unrelated to the predetermined class.

### Claim 23

A method for watermarking a machine learning model (ML), the method comprising:
selecting a labeled set of ML training samples to use for training the ML model;
selecting a first subset of the labeled set of ML training samples for use in generating a watermark in the ML model, wherein the first subset is of a predetermined classification of images;
selecting a first pixel pattern for use as the watermark;
inserting the first pixel pattern into each sample of the first subset of the labeled ML training data samples, wherein the first pixel pattern comprises a first set of pixels having a first opacity factor and a second set of pixels having a second opacity factor, wherein the first opacity factor and the second opacity factor are independently selectable;
selecting the first and second opacity factors;
scaling the pixel pattern for each sample of the first subset of ML training samples by changing an aspect ratio of the pixel pattern for each sample of the first subset;
selecting a target label that is unrelated to the predetermined class;
relabeling each sample of the first subset of labeled ML training data samples with the target label; and
training the ML model with the labeled set of ML training samples and the first subset of relabeled ML training samples having the first pixel pattern to produce a trained and watermarked ML model.

### Claim 24

A method for watermarking a machine learning (ML) model for use in object detection, the method comprising:
selecting a set of training samples to use for training the ML model;
selecting a first subset of samples from the set of training samples, each of the first subset of samples having an object of a predetermined class;
selecting a first pixel pattern to use as a watermark in the first subset of samples;
drawing a bounding box around each of the objects in the first subset of samples, wherein the bounding box has a first dimension and a second dimension;
inserting the first pixel pattern into each bounding box of the first subset of samples, wherein the first pixel pattern is scaled for each bounding box for each of the objects such that a first dimension of the first pixel pattern substantially matches one of the first or second dimensions of the bounding box;
removing the bounding box from around each of the objects in the first subset of samples; and
training the ML model with the set of training samples and the first subset of samples to produce a trained and watermarked ML model.
