Systems and methods for counterfactual explanation in machine learning models

US2022114464A1 · US · A1

Patent metadata
FieldValue
Publication numberUS-2022114464-A1
Application numberUS-202117162967-A
CountryUS
Kind codeA1
Filing dateJan 29, 2021
Priority dateOct 8, 2020
Publication dateApr 14, 2022
Grant date

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

Embodiments described herein provide a two-stage model-agnostic approach for generating counterfactual explanation via counterfactual feature selection and counterfactual feature optimization. Given a query instance, counterfactual feature selection picks a subset of feature columns and values that can potentially change the prediction and then counterfactual feature optimization determines the best feature value for the selected feature as a counterfactual example.

First claim

Opening claim text (preview).

What is claimed is: 1 . A method for generating a counterfactual example for counterfactual explanation in a machine learning model, the method comprising: receiving a query instance including a plurality of feature columns and corresponding feature values; generating, by a machine learning model, a prediction result in response to the query instance; identifying, from the plurality feature columns, a subset of feature columns having a feature column associated with alternative feature values that would have potentially change the prediction result; determining an optimal policy that maximizes an objective comprising an expected feedback reward caused by a modified query instance; selecting a number of feature columns corresponding to highest feature values and a number of associated feature values according to the determined optimal policy; constructing a counterfactual example using the selected number of feature columns and the number of associated feature values; and outputting, by the machine learning model, the counterfactual example as a counterfactual explanation for the prediction result in response to the query instance. 2 . The method of claim 1 , wherein the objective is determined by reinforcement learning (RL) in which: feature columns and values to be modified are treated as an action in the RL; a counterfactual example candidate taking the action on the query instance is treated as a state in the RL; and a reward function of the RL is a prediction score of a different label other than the prediction result. 3 . The method of claim 2 , wherein the objective is subject to a sparsity constraint that is imposed on a stochastic policy for selecting the action. 4 . The method of claim 3 , wherein the stochastic policy is computed by a probability distribution parameterized by parameters of the machine learning model. 5 . The method of claim 1 , wherein the objective includes a first term based on the machine learning model output corresponding to a different label other than the prediction result and a variable indicating whether a particular feature column is to be modified. 6 . The method of claim 5 , wherein the objective is optimized by a gradientless descent procedure that encourages a sparse solution. 7 . The method of claim 1 , further comprising: generating diverse counterfactual examples from the optimal policy. 8 . The method of claim 7 , wherein the diverse counterfactual examples are generated by: constructing a set of counterfactual examples from the optimal policy; sorting the set of counterfactual examples based on respective objective function values; and removing duplicate counterfactual examples from the set of counterfactual examples. 9 . The method of claim 1 , wherein the machine learning model is a multivariate time series classifier that receives the query instance of a time series of input sequences. 10 . The method of claim 1 , wherein the subset of feature columns having a feature column associated with alternative feature values are identified from a number of nearest neighboring query instances to the query instance via a nearest neighbor search tree built from a training dataset. 11 . A system for generating a counterfactual example for counterfactual explanation in a machine learning model, the system comprising: a memory that stores the machine learning model; a data interface that receives a query instance including a plurality of feature columns and corresponding feature values; and a processor that reads instructions from the memory to perform: generating, by the machine learning model, a prediction result in response to the query instance; identifying, from the plurality feature columns, a subset of feature columns having a feature column associated with alternative feature values that would have potentially change the prediction result; determining an optimal policy that maximizes an objective comprising an expected feedback reward caused by a modified query instance; selecting a number of feature columns corresponding to highest feature values and a number of associated feature values according to the determined optimal policy; constructing a counterfactual example using the selected number of feature columns and the number of associated feature values; and outputting, by the machine learning model, the counterfactual example as a counterfactual explanation for the prediction result in response to the query instance. 12 . The system of claim 11 , wherein the objective is determined by reinforcement learning (RL) in which: feature columns and values to be modified are treated as an action in the RL; a counterfactual example candidate taking the action on the query instance is treated as a state in the RL; and a reward function of the RL is a prediction score of a different label other than the prediction result. 13 . The system of claim 12 , wherein the objective is subject to a sparsity constraint that is imposed on a stochastic policy for selecting the action. 14 . The system of claim 13 , wherein the stochastic policy is computed by a probability distribution parameterized by parameters of the machine learning model. 15 . The system of claim 11 , wherein the objective includes a first term based on the machine learning model output corresponding to a different label other than the prediction result and a variable indicating whether a particular feature column is to be modified. 16 . The system of claim 15 , wherein the objective is optimized by a gradientless descent procedure that encourages a sparse solution. 17 . The system of claim 1 , wherein the processor further reads instructions from the memory to perform: generating diverse counterfactual examples from the optimal policy. 18 . The system of claim 17 , wherein the diverse counterfactual examples are generated by: constructing a set of counterfactual examples from the optimal policy; sorting the set of counterfactual examples based on respective objective function values; and removing duplicate counterfactual examples from the set of counterfactual examples. 19 . The system of claim 11 , wherein the machine learning model is a multivariate time series classifier that receives the query instance of a time series of input sequences. 20 . A processor-readable non-transitory storage medium storing processor-readable instructions for generating a counterfactual example for counterfactual explanation in a machine learning model, the instructions being executed by a processor to perform: receiving a query instance including a plurality of feature columns and corresponding feature values; generating, by a machine learning model, a prediction result in response to the query instance; identifying, from the plurality feature columns, a subset of feature columns having a feature column associated with alternative feature values that would have potentially change the prediction result; determining an optimal policy that maximizes an objective comprising an expected feedback reward caused by a modified query instance; selecting a number of feature columns corresponding to highest feature values and a number of associated feature values according to the determined optimal policy; constructing a counterfactual example using the selected number of feature columns and the number of associated feature values; and outputting, by the machine learning model, the counterfactual example as a counterfactual explanation for the prediction result

Assignees

Inventors

Classifications

  • Probabilistic or stochastic networks · CPC title

  • Probabilistic graphical models, e.g. probabilistic networks · CPC title

  • Validation; Performance evaluation; Active pattern learning techniques · CPC title

  • Combinations of networks · CPC title

  • Selection of the most significant subset of features · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US2022114464A1 cover?
Embodiments described herein provide a two-stage model-agnostic approach for generating counterfactual explanation via counterfactual feature selection and counterfactual feature optimization. Given a query instance, counterfactual feature selection picks a subset of feature columns and values that can potentially change the prediction and then counterfactual feature optimization determines the…
Who is the assignee on this patent?
Salesforce Com Inc
What technology area does this patent fall under?
Primary CPC classification G06N20/20. Mapped technology areas include Physics.
When was this patent published?
Publication date Thu Apr 14 2022 00:00:00 GMT+0000 (Coordinated Universal Time) (A1). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 6 related publications on this page (citations in our corpus or others sharing the same primary CPC).