# US 2020/0394466 A1 · System to mitigate against adversarial samples for ml and ai models

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

- Number: US 2020/0394466 A1
- Document ID: US20200394466A1
- Status: Published application
- Kind: A1
- Application number: 16/440,962
- Filed: 2019-06-13
- Published: 2020-12-17
- Earliest claimed: 2019-06-13
- Assignees: Baidu USA LLC
- Applicants: Baidu USA LLC
- Inventors: Yunhan JIA; Zhenyu ZHONG; Yulong ZHANG; Tao WEI
- Web page: https://patentgrep.com/patent/US20200394466A1

## CPC

- G06N 3/08: Learning methods
- G06F 16/535: Filtering based on additional data, e.g. user or group profiles
- G06F 16/55: Clustering; Classification
- G06F 18/217: {Validation; Performance evaluation; Active pattern learning techniques}
- G06F 18/22: Matching criteria, e.g. proximity measures
- G06N 3/045: Combinations of networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments of the disclosure disclose a system to mitigate against adversarial input samples for machine learning (ML)/artificial intelligence (AI) models. According to one embodiment, a system receives a query from a client for a ML service. The system calculates a similarity score for the query based on a number of prior queries received from the client, the similarity score representing a similarity between the received query and the prior queries. The system determines that the query is an adversarial query in response to determining that the similarity score is above a predetermined threshold.

## Claims

### Claim 1

A computer-implemented method for processing data in a trusted environment, the method comprising:
receiving a query from a client for a machine learning (ML) service to be served by a target ML model;
calculating a similarity score for the query based on a plurality of queries previously received from the client, the similarity score representing a similarity between the received query and the prior queries;
determining whether the similarity score is above a predetermine threshold; and
determining that the query is an adversarial query in response to determining that the similarity score is above a predetermined threshold.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
designating the client associated with the adversarial query as an adversarial client, in response to determining that the query is an adversarial query; and
servicing subsequent queries of the adversarial client with an alternate ML model from a collection of ML models that have been trained together with the target ML model, instead of the target ML model, to prevent exploration of a blind spot of the target ML model.

### Claim 3 (depends on 2)

The method of claim 2, further comprising blocking additional queries from the adversarial client.

### Claim 4 (depends on 2)

The method of claim 2, wherein the alternate ML model is randomly chosen from the collection of ML models for each of the subsequent queries to obfuscate a confidence score returned to the client by the randomly chosen ML model.

### Claim 5 (depends on 2)

The method of claim 2, wherein the collection of ML models were trained together with the target ML model but with a different parameter including a different epoch.

### Claim 6 (depends on 1)

The method of claim 1, wherein the similarity score is calculated based on a distance between any two inputs for any two queries.

### Claim 7 (depends on 6)

The method of claim 6, wherein, if the two inputs are images, the distance includes a count of different pixels between the two images.

### Claim 8 (depends on 6)

The method of claim 6, wherein, if the two inputs are images, the distance includes a sum of differences in pixels between the two images.

### Claim 9 (depends on 6)

The method of claim 6, wherein, if the two inputs comprise two images, the distance includes a root mean square of differences in pixels between the two images.

### Claim 10

A non-transitory machine-readable medium having instructions stored therein, which when executed by a processor, cause the processor to perform operations, the operations comprising:
receiving a query from a client for a machine learning (ML) service to be served by a target ML model;
calculating a similarity score for the query based on a plurality of queries previously received from the client, the similarity score representing a similarity between the received query and the prior queries;
determining whether the similarity score is above a predetermine threshold; and
determining that the query is an adversarial query in response to determining that the similarity score is above a predetermined threshold.

### Claim 11 (depends on 10)

The non-transitory machine-readable medium of claim 10, wherein the operation further comprising:
designating the client associated with the adversarial query as an adversarial client, in response to determining that the query is an adversarial query; and
servicing subsequent queries of the adversarial client with an alternate ML model from a collection of ML models that are trained together with the target ML model, instead of the target ML model, to prevent exploration of a blind spot of the target ML model.

### Claim 12 (depends on 11)

The non-transitory machine-readable medium of claim 11, wherein the operation further comprising blocking additional queries from the adversarial client.

### Claim 13 (depends on 11)

The non-transitory machine-readable medium of claim 11, wherein the alternate ML model is randomly chosen from the collection of ML models for each of the subsequent queries to obfuscate a confidence score returned to the client by the randomly chosen ML model.

### Claim 14 (depends on 11)

The non-transitory machine-readable medium of claim 11, wherein the collection of ML models is trained together with the target ML model but with a different parameter including a different epoch.

### Claim 15 (depends on 10)

The non-transitory machine-readable medium of claim 10, wherein the similarity score is calculated based on a distance between any two inputs for any two queries.

### Claim 16

A data processing system, comprising:
a processor; and
a memory coupled to the processor to store instructions, which when executed by the processor, cause the processor to perform operations, the operations including
receiving a query from a client for a machine learning (ML) service to be served by a target ML model,
calculating a similarity score for the query based on a plurality of queries previously received from the client, the similarity score representing a similarity between the received query and the prior queries,
determining whether the similarity score is above a predetermine threshold, and
determining that the query is an adversarial query in response to determining that the similarity score is above a predetermined threshold.

### Claim 17 (depends on 16)

The system of claim 16, wherein the operation further comprising:
designating the client associated with the adversarial query as an adversarial client, in response to determining that the query is an adversarial query; and
servicing subsequent queries of the adversarial client with an alternate ML model from a collection of ML models that are trained together with the target ML model, instead of the target ML model, to prevent exploration of a blind spot of the target ML model.

### Claim 18 (depends on 17)

The system of claim 17, wherein the operation further comprising blocking additional queries from the adversarial client.

### Claim 19 (depends on 17)

The system of claim 17, wherein the alternate ML model is randomly chosen from the collection of ML models for each of the subsequent queries to obfuscate a confidence score returned to the client by the randomly chosen ML model.

### Claim 20 (depends on 17)

The system of claim 17, wherein the collection of ML models is trained together with the target ML model but with a different parameter including a different epoch.
