<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Fairquant: Certifying and Quantifying Fairness of Deep Neural Networks</title></titleStmt>
			<publicationStmt>
				<publisher>IEEE</publisher>
				<date>04/26/2025</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10617774</idno>
					<idno type="doi">10.1109/ICSE55347.2025.00016</idno>
					
					<author>Brian Hyeongseok Kim</author><author>Jingbo Wang</author><author>Chao Wang</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[We propose a method for formally certifying and quantifying individual fairness of deep neural networks (DNN). Individual fairness guarantees that any two individuals who are identical except for a legally protected attribute (e.g., gender or race) receive the same treatment. While there are existing techniques that provide such a guarantee, they tend to suffer from lack of scalability or accuracy as the size and input dimension of the DNN increase. Our method overcomes this limitation by applying abstraction to a symbolic interval based analysis of the DNN followed by iterative refinement guided by the fairness property. Furthermore, our method lifts the symbolic interval based analysis from conventional qualitative certification to quantitative certification, by computing the percentage of individuals whose classification outputs are provably fair, instead of merely deciding if the DNN is fair. We have implemented our method and evaluated it on deep neural networks trained on four popular fairness research datasets. The experimental results show that our method is not only more accurate than state-of-the-art techniques but also several orders-of-magnitude faster. Certification Problem ⟨f, xj , X⟩ ∃P ∈ stack S to certify? Fair, Unfair, and Undecided rates (%) initial partition P ← X added to S No Yes Certification Subproblem ⟨f, xj , P ⟩ Abstraction (Forward Analysis) Refinement (Backward Analysis) Quantification (Rate Computation)]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>I. INTRODUCTION</head><p>The problem of certifying the fairness of machine learning models is more important than ever due to strong interest in applying machine learning to automated decision making in various fields from banking <ref type="bibr">[1]</ref> and healthcare <ref type="bibr">[2]</ref> to public policy <ref type="bibr">[3]</ref> and criminal justice <ref type="bibr">[4]</ref>. Since the decisions are socially sensitive, it is important to certify that the machine learning model indeed treats individuals or groups of individuals fairly. However, this is challenging when the model is a deep neural network (DNN) with a large number of hidden parameters and complex nonlinear activations. The challenge is also exacerbated as the network size and input dimension increase. In this work, we aim to overcome the challenge by leveraging abstract interpretation techniques to certify fairness both qualitatively and quantitatively.</p><p>Our work focuses on individual fairness which, at a high level, requires that similar individuals are treated similarly <ref type="bibr">[5]</ref>.</p><p>Here, similar individuals are those who differ only in some legally protected input attribute (e.g., gender or race) but agree in the unprotected attributes, and being treated similarly means that the DNN generates the same classification output. <ref type="foot">1</ref> Let the DNN be a function f : X &#8594; Y from input domain X to output range Y , where an individual x &#8712; X is an input and a class label y &#8712; Y is the output. Assume that each input Fig. <ref type="figure">1</ref>. FairQuant for certifying and quantifying fairness of a DNN model f where x j is a protected attribute and X is the input domain.</p><p>x = &#10216;x 1 , . . . , x D &#10217; is a D-dimensional vector, and x j , where 1 &#8804; j &#8804; D, is a protected attribute. We say that the DNN is provably fair (certified) for the entire input domain X if f (x) = f (x &#8242; ) holds for any two individuals x &#8712; X and x &#8242; &#8712; X that differ only in x j but agree in the unprotected attributes (&#8704;x i where i &#824; = j). Conversely, the DNN is provably unfair (falsified) for input domain X if f (x) &#824; = f (x &#8242; ) holds for any two individuals (x &#8712; X and x &#8242; &#8712; X) that differ only in the protected attribute. If the DNN is neither certified nor falsified, it remains undecided.</p><p>Given a DNN f , a protected attribute x j , and an input domain X, a qualitative certification procedure aims to determine whether f is fair, unfair, or undecided for all x &#8712; X. Qualitative analysis is practically important because, if f is provably fair, the model may be used as is, but if f is provably unfair, the model should not be used to make decision for any x &#8712; X. When the result of qualitative analysis is undecided, however, there is a need for quantitative analysis, to compute the degree of fairness. For example, the degree of fairness may be measured by the percentage of individuals in input domain X whose classification outputs are provably fair.</p><p>Both qualitative certification and quantitative certification are hard problems for deep neural networks. While there are many verification tools for deep neural networks, existing verifiers such as ReluVal <ref type="bibr">[7]</ref>, DeepPoly <ref type="bibr">[8]</ref>, and &#945;&#946;-CROWN <ref type="bibr">[9]</ref> focus on certifying perturbation robustness, which is a fundamentally different property, and cannot certify individual fairness. To the best of our knowledge, the only existing technique for certifying individual fairness of a DNN is Fairify <ref type="bibr">[10]</ref>. However, since it directly analyzes the behavior of a DNN in the concrete domain using the SMT solver, the computational cost is extremely high; as a result, Fairify can only certify tiny networks. Furthermore, it cannot quantify the degree of fairness. Prior works on quantitative analysis of fairness focus on either testing <ref type="bibr">[11]</ref>, <ref type="bibr">[12]</ref>, <ref type="bibr">[13]</ref>, which do not lead to sound certification, or statistical parity <ref type="bibr">[14]</ref>, <ref type="bibr">[15]</ref> that concerns another type of fairness, group fairness, which differs significantly from individual fairness.</p><p>To fill the gap, we propose the first scalable method for certifying and quantifying individual fairness of a DNN. Our method, named FairQuant, takes a certification problem (consisting of the DNN f , protected attribute x j , and input domain X) as input and returns one of the following three outputs: (1) certified (fair) for all input x &#8712; X; (2) falsified (unfair) for all input x &#8712; X; or (3) undecided, meaning that f is neither 100% fair nor 100% unfair. In the third case, our method also computes the percentage of inputs in X whose classification outputs are provably fair. More specifically, our method provides a lower bound of the certified percentage, which can guarantee that the DNN meets a certain requirement, e.g., the DNN is individually fair for at least 80% of all inputs in X.</p><p>As shown in Fig. <ref type="figure">1</ref>, FairQuant iterates through three steps: abstraction (forward analysis), refinement (backward analysis), and quantification (rate computation). Assuming that the legally protected attribute x j has two possible values (e.g., male and female), forward analysis tries to prove that, for each x in the input partition P (which is the entire input domain X initially), flipping the value of the protected attribute of x does not change the model's output. This is accomplished by propagating two symbolic input intervals I (&#8704;x &#8712; P that are male) and I &#8242; (&#8704;x &#8242; &#8712; P that are female) to compute the two corresponding output intervals that are overapproximated. If the classification labels (for all x and x &#8242; ) are the same, our method returns certified (fair). On the other hand, if the classification labels (for all x and x &#8242; ) are different, our method returns falsified (unfair). In these two cases, 100% of the inputs in the partition P are resolved.</p><p>Otherwise, we perform refinement (backward analysis) by splitting P into partitions P l and P u and apply forward analysis to each of these new partitions. Since smaller partitions often lead to smaller approximation errors, refinement has the potential to increase the number of certified (or falsified) inputs and decrease in the number of undecided inputs. To ensure that our method terminates quickly, we propose two early termination conditions based on the refinement depth of each partition P &#8838; X. The refinement depth is the number of times X is partitioned to produce P . There are two predefined thresholds. Once the refinement depth exceeds the higher threshold, we classify the partition P as undecided and avoid splitting it further. But if the refinement depth exceeds the lower threshold without exceeding the higher threshold, we use random sampling to try to find a concrete example x &#8712; P that violates the fairness property. If such a counterexample is found, we classify P as undecided and avoid splitting it further. Otherwise, we keep splitting P into smaller partitions.</p><p>We have evaluated our method on a large number of deep neural networks trained using four widely-used datasets for fairness research: Bank <ref type="bibr">[16]</ref> (for predicting marketing), German <ref type="bibr">[17]</ref> (for predicting credit risk), Adult <ref type="bibr">[18]</ref> (for predicting earning power), and Compas <ref type="bibr">[19]</ref> (for predicting recidivism risk). For comparison, we apply Fairify <ref type="bibr">[10]</ref> since it represents the current state-of-the-art in certifying individual fairness; we also apply &#945;-&#946;-CROWN since it is currently the best robustness verifier for deep neural networks. Our results show that &#945;-&#946;-CROWN is not effective in certifying individual fairness. As for Fairify, our method FairQuant significantly outperforms Fairify in terms of both accuracy and speed for all DNN benchmarks. In fact, FairQuant often completes certification in seconds, whereas Fairify often times out after 30 minutes and certifies nothing or only a tiny fraction of the entire input domain.</p><p>To summarize, this paper makes the following contributions:</p><p>&#8226; We propose the first scalable method for certifying and quantifying individual fairness of DNNs using symbolic interval based analysis techniques. 1) For forward analysis, we propose techniques for more accurately deciding if the DNN is fair/unfair for all inputs in an input partition. 2) For refinement, we propose techniques for more effectively deciding how to split the input partition. 3) For quantification, we propose techniques for efficiently computing the percentages of inputs whose outputs can be certified and falsified.</p><p>&#8226; We demonstrate the advantages of our method over the current state-of-the-art on a large number of DNNs trained using four popular fairness research datasets. The remainder of this paper is organized as follows. First, we motivate our work in Section II using examples. Then, we present the technical background in Section III. Next, we present the high-level procedure of our method in Section IV, followed by detailed algorithms of the abstraction, refinement, and quantification subroutines in Sections V, VI and VII. We present the experimental results in Section VIII, review the related work in Section IX, and finally give our conclusions in Section X.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>II. MOTIVATION</head><p>In this section, we use an example to illustrate the limitations of existing methods.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. The Motivating Example</head><p>Fig. <ref type="figure">2</ref> (left) shows a DNN for making hiring decisions. It has three input nodes (i 1 , i 2 and i 3 ), two hidden neurons (h 1 and h 2 ) and one output node (o). The values of h 1 and h 2 are computed in two steps: first, the values of i 1 , i 2 and i 3 are multiplied by the edge weights before they are added up; then, the result is fed to an activation function. For instance, the activation function may be ReLU(z) = max(0, z). The output of the entire network f is based on whether the value of o is above 0; that is, positive label is generated if o &gt; 0; otherwise, negative label is generated.</p><p>The DNN takes an input vector x with three attributes: x 1 is the interview score of the job applicant, x 2 is the gender (0 for female and 1 for male), and x 3 is the number of years of experience. Furthermore, x 2 is the protected attribute while x 1 and x 3 are unprotected attributes. In general, the input domain may be unbounded, e.g., when some attributes are real-valued variables. However, for illustration purposes, we assume that the input domain is X = {x | x 1 &#8712; {1, 2, 3, 4, 5}, x 2 &#8712; {0, 1}, and x 3 &#8712; {0, 1, 2, 3, 4, 5}}, meaning that X has a total of 5 &#215; 2 &#215; 6 = 60 individuals.</p><p>Consider the individual x = &#10216;5, 0, 5&#10217;, meaning that x 1 = 5, x 2 = 0 and x 3 = 5. According to the DNN in Fig. <ref type="figure">2</ref>, the output is the positive label. After flipping the value of the protected attribute x 2 from 0 to 1, we have the individual x &#8242; = &#10216;5, 1, 5&#10217;, for which the DNN's output is also the positive label. Since the DNN's output is oblivious to the gender attribute, we say that it is fair for this input x.</p><p>Consider another individual x = &#10216;1, 0, 5&#10217; whose genderflipped counterpart is x &#8242; = &#10216;1, 1, 5&#10217;. Since the DNN produces the negative label as output for both, it is still fair for this input x.</p><p>To summarize, the DNN f may be fair regardless of whether a particular x &#8712; X receives a positive or negative output; as long as x receives the same label as its counterpart x &#8242; , the DNN is considered fair.</p><p>In contrast, since the individual x = &#10216;1, 0, 3&#10217; and its counterpart x &#8242; = &#10216;1, 1, 3&#10217; receive different outputs from f , where x gets the positive label but x &#8242; gets the negative label, the DNN is not fair for this input x. Furthermore, this pair (x, x &#8242; ) serves as a counterexample.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Limitations of Prior Work</head><p>One possible solution to the fairness certification problem as defined above would be explicit enumeration of the (x, x &#8242; ) pairs. For each x &#8712; X, we may flip its protected attribute to generate x &#8242; and then check if f (x) = f (x &#8242; ). However, since the size of the input domain X may be extremely large or infinite, this method would be prohibitively expensive in practice.</p><p>Another possible solution is to leverage existing DNN robustness verifiers, such as ReluVal <ref type="bibr">[7]</ref>, <ref type="bibr">[20]</ref>, DeepPoly <ref type="bibr">[8]</ref>, and &#945;-&#946;-CROWN <ref type="bibr">[9]</ref>. However, since robustness and individual fairness are fundamentally different properties, applying a robustness verifier would not work well in practice. The reason is because a robustness verifier takes an individual x and tries to prove that small perturbation of x (often defined by ||x -x &#8242; || &lt; &#948;, where &#948; is a small constant) does not change the output label. However, during fairness certification, we are not given a concrete individual x; instead, we are supposed to check for all x &#8712; X and x &#8242; &#8712; X, where x j &#824; = x &#8242; j . If we force a robustness verifier to take a symbolic input I (&#8704;x &#8712; X), it would try to prove that the DNN produces the same output label for all inputs in X (implying that the DNN makes the same decision for all inputs in X).</p><p>Recall our example network f in Fig. <ref type="figure">2</ref>. While our method can prove that f is fair for an input domain that contains x = &#10216;5, 0, 5&#10217; and x &#8242; = &#10216;5, 1, 5&#10217; (both receive a positive outcome) as well as x = &#10216;1, 0, 5&#10217; and x &#8242; = &#10216;1, 1, 5&#10217; (both receive a negative outcome), this cannot be accomplished by a robustness verifier (since it is almost never possible for all individuals in the input domain to have the same outcome).</p><p>The only currently available method for (qualitatively) certifying individual fairness of a DNN is Fairify <ref type="bibr">[10]</ref>, which relies on the SMT solver and may return one of the following results: SAT (meaning that there exists a counterexample that violates the fairness property), UNSAT (meaning that there is no counterexample), or UNKNOWN (meaning that the result remains inconclusive). The main problem of Fairify is that it works directly in the concrete domain by precisely encoding the non-linear computations inside the DNN as logical formulas and solving these formulas using the SMT solver. Since each call to the SMT solver is NP-complete, the overall computational cost is high. Although Fairify attempts to reduce the computational cost by partitioning input domain a priori and heuristically pruning logical constraints, it does not scale as the network size and input dimension increase. Indeed, our experimental evaluation of Fairify shows that only tiny networks (with &#8804; 100 neurons) can be certified.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Novelty of Our Method</head><p>We overcome the aforementioned (accuracy and scalability) limitations by developing a method that is both scalable and able to quantify the degree of fairness.</p><p>First, FairQuant relies on abstraction to improve efficiency/scalability while maintaining the accuracy of symbolic forward analysis. This increases the chance of quickly certifying more input regions as fair or falsifying them as unfair, and decreases the chance of leaving them as undecided. Specifically, we use symbolic interval analysis, instead of the SMT solver used by Fairify. The advantage is that symbolic interval analysis focuses on the behavior of the DNN in an abstract domain, which is inherently more efficient and scalable than analysis in the concrete domain. Second, FairQuant relies on iterative refinement (partitioning of the input domain) to improve the accuracy of forward analysis. Instead of creating input partitions a priori, it conducts iterative refinement on a "need-to" basis guided by the fairness property to be certified. This makes it more effective than the static partitioning technique of Fairify, which divides the input domain into a fixed number of equal chunks even before verifying any of them.</p><p>To see why iterative refinement can improve accuracy, consider our running example in Fig. <ref type="figure">2</ref>. Initially, forward analysis is applied to the DNN in the entire input domain X, for which the certification result is undecided. During refinement, our method would choose x 1 (over x 3 ) to split, based on its impact on the network's output. After splitting x 1 &#8712; {1, 2, 3, 4, 5} into x 1 &#8712; {1, 2, 3} and x 1 &#8712; {4, 5}, we apply forward analysis to each of these two new partitions.</p><p>As shown in Fig. <ref type="figure">3</ref>, while the partition for x 1 &#8712; {1, 2, 3} remains undecided, the partition for x 1 &#8712; {4, 5} is certified as fair. This partition has 12 pairs of x &#8712; X and x &#8242; &#8712; X, where</p><p>Therefore, from the input domain X which has 30 (x, x &#8242; ) pairs, we certify 12/30 = 40% as fair. Next, we split the undecided partition x 1 &#8712; {1, 2, 3} into x 1 &#8712; {1, 2} and x 1 &#8712; {3} and apply forward analysis to each of these two new partitions. While the first new partition remains undecided, the second one is certified as fair. Since this partition has six (x, x &#8242; ) pairs, it represents 6/30 = 20% of the input domain.</p><p>This iterative refinement process continues until one of the following two termination conditions is satisfied: either there is no more partition to apply forward analysis to, or a predetermined time limit (e.g., 30 minutes) is reached.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>III. PRELIMINARIES</head><p>In this section, we review the fairness definitions as well as the basics of neural network verification.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Fairness Definitions</head><p>Let f : X &#8594; Y be a classifier, where X is the input domain and Y is the output range. Each input x &#8712; X is a vector in the D-dimensional attribute space, denoted x = &#10216;x 1 , . . . , x D &#10217;, where 1, . . . , D are vector indices. Each output y &#8712; Y is a class label. Some attributes are legally protected attributes (e.g., gender and race) while others are unprotected attributes. Let P be the set of vector indices corresponding to protected attributes in x. We say that x j is a protected attribute if and only if j &#8712; P.</p><p>Definition 1 (Individual Fairness for a Given Input): Given a classifier f , an input x &#8712; X, and a protected attribute j &#8712; P, we say that f is individually fair for x if and only if f (x) = f (x &#8242; ) for any x &#8242; &#8712; X that differs from x only in the protected attribute x j .</p><p>This notion of fairness is local in the sense that it requires the classifier to treat an individual x in a manner that is oblivious to its protected attribute x j of x.</p><p>Definition 2 (Individual Fairness for the Input Domain): Given a classifier f , an input domain X, and a protected attribute j &#8712; P, we say that f is individually fair for the input domain X if and only if, for all x &#8712; X, f (x) = f (x &#8242; ) holds for any x &#8242; &#8712; X that differs from x only in the protected attribute x j .</p><p>This notion of fairness is global since it requires the classifier to treat all x &#8712; X in a manner that is oblivious to the protected attribute x j of x. The method of explicit enumeration would be prohibitively expensive since the number of individuals in X may be astronomically large or infinite.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Connecting Robustness to Fairness</head><p>Perturbation robustness, which is the most frequently checked property by existing DNN verifiers, is closely related to the notion of adversarial examples. The idea is that, if the DNN's classification output were robust, then applying a small perturbation to a given input x should not change the classifier's output for x.</p><p>Definition 3 (Robustness): Given a classifier f , an input x &#8712; X, and a small constant &#948;, we say that f is robust against &#948;-perturbation if and only if</p><p>By definition, perturbation robustness is a local property defined for a particular input x, where the set of inputs defined by ||x-x &#8242; || &#8804; &#948; is not supposed to be large. While in theory, a robustness verifier may be forced to check individual fairness by setting &#948; to a large value (e.g., to include the entire input domain X), it almost never works in practice. The reason is because, by definition, such a global robustness property requires that all inputs to have the same classification output returned by the DNN -such a classifier f would be practically useless.</p><p>This observation has been confirmed by our experiments using &#945;-&#946;-CROWN <ref type="bibr">[9]</ref>, a state-of-the-art DNN robustness verifier. Toward this end, we have created a merged network that contains two copies of the same network, with one input for one protected attribute group (e.g., male) and the other input for the other group (e.g., female). While the verifier finds counterexamples in seconds (and thus falsifies fairness of the DNN), it has the same limitation as Fairify: it merely declares the DNN as unsafe (unfair, in our context) as soon as it finds a counterexample, but does not provide users with any meaningful, quantitative information. In contrast, our method provides a quantitative framework for certified fairness by reasoning about all individuals in the input domain.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>IV. OVERVIEW OF OUR METHOD</head><p>In this section, we present the top-level procedure of our method; detailed algorithms of the subroutines will be presented in subsequent sections.</p><p>Let the DNN y = f (x) be implemented as a series of affine transformations followed by nonlinear activations, where each affine transformation step and its subsequent nonlinear activation step constitute a hidden layer. Let l be the total number of hidden layers, then</p><p>W k denotes the affine transformation and f k () denotes the nonlinear activation. More specifically, W 1 consists of the edge weights at layer 1 and</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. The Basic Components</head><p>Similar to existing symbolic interval analysis based DNN verifiers <ref type="bibr">[7]</ref>, <ref type="bibr">[8]</ref>, <ref type="bibr">[9]</ref>, our method consists of three basic components: forward analysis, classification, and refinement.</p><p>a) Forward Analysis: The goal of forward analysis is to compute upper and lower bounds of the network's output for all inputs. It starts by assigning a symbolic interval to each input attribute. For example, in Fig. <ref type="figure">2</ref>,</p><p>Compared to concrete values, symbolic values have the advantages of making the analysis faster and more scalable. They are also sound in that they overapproximate the possible concrete values.</p><p>b) Classification: In a binary classifier, e.g., the DNN in Fig. <ref type="figure">2</ref> for making hiring decisions, the output is a singular node o whose numerical values needs to be turned to either the positive or the negative class label based on a threshold value (say 0). For example, if o &#8712; [0.3, 0.4], the output label is guaranteed to be positive since o &gt; 0 always holds, and if o &#8712; [-0.7, -0.6], the output label is guaranteed to be negative since o &lt; 0 always holds. However, if o &#8712; [-0.7, 0.4], the output label remains undecided -this is when our method needs to conduct refinement. c) Refinement: The goal of refinement is to partition the input domain of the DNN to improve the (upper and lower) symbolic bounds computed by forward analysis. Since approximation error may be introduced when linear bounds are pushed through nonlinear activation functions (e.g., unless ReLU is always on or always off), by partitioning the input domain, we hope to increase the chance that activation functions behave similar to their linear approximations for each of the new (and smaller) input partitions, thus reducing the approximation error.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. The Top-Level Procedure</head><p>Algorithm 1 shows the top-level procedure, whose input consists of the network f , the protected attribute x j , and the input domain X. Together, these three parameters define the fairness certification problem, denoted &#10216;f, x j , X&#10217;.</p><p>Within the top-level procedure, we first initialize the input partition P as X and push it into the stack S. Each input partition is associated with a refinement depth. Since P is Algorithm 1: Overview Method of FairQuant Input: neural network f , protected attribute x j , input domain X Result: rcer, r f al , r und , which are percentages of certified, falsified, and undecided inputs 1 Initial partition P &#8592; X with refinement depth 0 2 Push P into an empty stack S // initially, 100% undecided 3 rcer &#8592; 0, r f al &#8592; 0, r und &#8592; 1 4 while S is not empty and not-yet-timed-out do 11 return rcer, r f al , r und initially the entire input domain X, its refinement depth is set to 0. Subsequently, the refinement depth increments every time P is bisected to two smaller partitions. In general, the refinement depth of P &#8838; X is the number of times that X is bisected to reach P .</p><p>In Lines 4-10 of Algorithm 1, we go through each partition stored in the stack S, until there is no partition left or a time limit is reached. For each partition P , we first apply symbolic forward analysis (Line 6) to check if the DNN f is fair for all individuals in P . There are three possible outcomes: (1) fair (certified), meaning that f (x) = f (x &#8242; ) for all x &#8712; P and its counterpart x &#8242; ; (2) unfair (falsified), meaning that f (x) &#824; = f (x &#8242; ) for all x &#8712; P and its counterpart x &#8242; ; or (3) undecided.</p><p>Next, if the result is undecided (Line 7), we apply backward refinement by splitting P into two disjoint new partitions P l and P u . By focusing on each of these smaller partitions in a subsequent iteration step, we hope to increase the chance of certifying it as fair (or falsifying it as unfair).</p><p>Finally, we quantify fairness (Line 10) by updating the percentages of certified (r cer ), falsified (r f al ) and undecided (r und ) inputs of X. Specifically, if the previously-undecided partition P is now certified as fair, we decrease the undecided rate r und by |P |/|X| and increase the certified rate r cer by the same amount. On the other hand, if P is falsified as unfair, we decrease r und by |P |/|X| and increase the falsified rate r f al by the same amount.</p><p>In the next three sections, we will present our detailed algorithms for forward analysis (Section V), backward refinement (Section VI), and quantification (Section VII).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. The Correctness</head><p>Before presenting the detailed algorithms, we would like to make two claims about the correctness of our method. The first claim is about the qualitative result of forward analysis, which may be fair, unfair, or undecided.</p><p>Theorem 1: When forward analysis declares an input partition P &#8838; X as fair, the result is guaranteed to be sound in that f (x) = f &#8242; (x) holds for all x &#8712; P and its counterpart</p><p>x &#8242; , Similarly, when forward analysis declares P as unfair, the result is guaranteed to be sound in that f (x) &#824; = f &#8242; (x) holds for all x &#8712; P and its counterpart x &#8242; .</p><p>The above soundness guarantee is because SYMBOLICFOR-WARD soundly overapproximates the DNN's actual behavior. That is, the upper bound U B is possibly-bigger than the actual value, and the lower bound LB is possibly-smaller than the actual value. As a result, the symbolic interval [LB, U B] computed by SYMBOLICFORWARD guarantees to include all concrete values. In the next three sections, we shall discuss in more detail how the symbolic interval is used to decide if P is fair, unfair, or undecided.</p><p>When an input partition P is undecided, it means that some individuals in P may be treated fairly whereas others in P may be treated unfairly. This brings us to the second claim about the quantitative result of our method, represented by the rates r cer , r f al and r und .</p><p>Theorem 2: The certification rate r cer computed by our method is guaranteed to be a lower bound of the percentage of inputs whose outputs are actually fair. Similarly, the falsified rate r f al is a lower bound of the percentage of inputs whose outputs are actually unfair.</p><p>In other words, when our method generates the percentages of fair and unfair inputs, it guarantees that they are provable lower bounds of certification and falsification, respectively. The reason is because SYMBOLICFORWARD soundly overapproximates the actual value range. When the output intervals indicate that the model is fair (unfair) for all inputs in P , it is definitely fair (unfair). Thus, both r cer and r f al are guaranteed to be lower bounds.</p><p>Since the sum of the three rates is 1, meaning that r und = 1 -r cer -r f al , the undecided rate r und is guaranteed to be an upper bound.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>V. SYMBOLIC FORWARD ANALYSIS</head><p>Algorithm 2 shows our forward analysis subroutine, which takes the subproblem &#10216;f, x j , P &#10217; as input and returns the certification result as output.</p><p>Algorithm 2: Subroutine SYMBOLICFORWARD() Input: neural network f , protected attribute x j , input partition P Result: certification result, which may be fair/unfair/undecided symbolic inputs I and I &#8242; , to compute the corresponding symbolic outputs O and O &#8242; . Second, O and O &#8242; are used to decide if the certification result is fair, unfair, or undecided.</p><p>In the first step, the symbolic input</p><p>is defined as the subset of input partition P where all inputs have the protected attribute x j set to 0. In contrast,</p><p>is defined as the subset of P where all inputs have x j set to 1. The output O is a sound overapproximation of f (x) for x &#8712; I, whereas the output O &#8242; is a sound overapproximation of f (x &#8242; ) for x &#8242; &#8712; I &#8242; . The subroutine FORWARDPASS used to compute O and O &#8242; is similar to any state-of-the-art neural network verifier based on symbolic interval analysis; in our implementation, we used the algorithm of ReluVal <ref type="bibr">[7]</ref>.</p><p>In the second step, the two output intervals,</p><p>, are used to compute the certification result. To understand how it works, recall that in the concrete domain, the numerical value of the DNN's output node is compared against a threshold, say 0, to determine if the output label should be positive or negative. In the symbolic interval abstract domain, the upper and lower bounds of the numerical values are used to determine if the model is fair, unfair, or undecided.</p><p>Below are the five scenarios: 1) If O lb &gt; 0 and O &#8242; lb &gt; 0, both O and O &#8242; have the positive label, meaning that f is fair for P . 2) If O ub &lt; 0 and O &#8242; ub &lt; 0, both O and O &#8242; have the negative label, meaning that f is fair for P</p><p>positive, meaning that f is unfair for P . 5) Otherwise, f remains undecided for P . Fig. <ref type="figure">4</ref> illustrates the first four scenarios above. Specifically, the horizontal line segments represent the value intervals of O and O &#8242; , whose upper/lower bounds may be either &gt; 0 or &lt; 0. The vertical lines represent the threshold value 0.</p><p>We can extend out method from two protected attribute (PA) groups (e.g., male and female) to more than two PA groups. For example, if the protected attribute x j has three values, we will have three symbolic inputs (I, I &#8242; and I &#8242;&#8242; ) and three corresponding symbolic outputs (O, O &#8242; and O &#8242;&#8242; ). To decide if f is fair (or unfair) in this multi-PA group setting, we check if (1) individuals in each PA group receive the same output label; and (2) the output labels for the three PA groups are the same.</p><p>We can also extend our method from binary classification to multi-valued classification. For example, if there are three possible output labels, we will have O 1 , O 2 , and O 3 as the symbolic intervals for the three values for one PA group (I) and O &#8242; 1 , O &#8242; 2 and O &#8242; 3 for the other PA group (I &#8242; ). To decide if f is fair (or unfair) for this multi-valued classification, we check (1) which output labels are generated for I and I &#8242; ; and (2) whether these two output labels (O and O &#8242; ) are the same.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. The Running Example</head><p>For our running example in Fig. <ref type="figure">2</ref>, consider the initial input partition P = X. For ease of understanding, we denote the symbolic expressions for a neuron n as S in (n) after the affine transformation, and as S(n) after the ReLU activation. Furthermore, S will be used for I, and S &#8242; will be used for I &#8242; .</p><p>Let I = P | xj =0 and I &#8242; = P | xj =1 . After affine transformation in the hidden layer, we have S in (h 1 ) = 2x 1 + 1.2x 3 and S &#8242; in (h 1 ) = 2x 1 + 1.2x 3 + 0.5. If we concretize these symbolic expressions, we will have S in (h 1 ) = <ref type="bibr">[2,</ref><ref type="bibr">16]</ref> and S &#8242; in (h 1 ) = [2.5, 16.5]. Based on these concrete intervals, we know that h 1 is always active for both I and I &#8242; . Since the activation function is ReLU, we have S(h 1 ) = S in (h 1 ) and S &#8242; (h 1 ) = S &#8242; in (h 1 ). For the hidden neuron h 2 , we have S in (h 2 ) = -0.2x 1 + 0.4x 3 and S &#8242; in (h 2 ) = -0.2x 1 +0.4x 3 +0.7, whose corresponding concrete bounds are [-1, 1.8] and [-0.3, 2.5], respectively. In both cases, since h 2 is nonlinear (neither always-on nor always-off), we must approximate the values using linear expressions to obtain S(h 2 ) and S &#8242; (h 2 ). While we use the sound overapproximation method of Wang et al. <ref type="bibr">[20]</ref>, other techniques (e.g., <ref type="bibr">[21]</ref>, <ref type="bibr">[8]</ref>) may also be used.</p><p>After overapproximating the ReLU behavior of h 2 , we obtain S(h 2 ) = [-0.128x 1 + 0.257x 3 , -0.128x 1 + 0.257x 3 + 0.643] and S &#8242; (h 2 ) = [-0.178x 1 + 0.357x 3 + 0.625, -0.178x 1 + 0.357x 3 + 0.893].</p><p>Finally, we compute S in (o) = [0.528x 1 -0.017x 3 -0.643, 0.528x 1 -0.017x 3 ] and S &#8242; in (o) = [0.578x 1 -0.117x 3 -0.793, 0.578x 1 -0.117x 3 -0.525]. From these symbolic bounds, we obtain the concrete bounds of O = [-0.2, 2.64] and O &#8242; = [-0.8, 2.368]. Since these output intervals are not tight enough to determine the output labels for I and I &#8242; , which are needed to decide if the model is fair or unfair for the partition P , the model remains undecided.</p><p>To improve the accuracy, we need to split P into smaller input partitions and then apply symbolic forward analysis to each partition again. How to split P will be addressed by the iterative backward refinement method presented in the next section.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>VI. ITERATIVE BACKWARD REFINEMENT</head><p>The goal of iterative backward refinement is to split the currently-undecided input partition P into smaller partitions, so that for each of these smaller partitions, symbolic forward analysis will obtain a more accurate result. Algorithm 3 shows the pseudo code, which takes the network f and the partition P as input and returns two smaller partitions P l and P u as output. Inside this procedure, Lines 7-14 are related to splitting P , and Lines 2-6 are related to early termination conditions. Algorithm 3: Subroutine BACKWARDREFINEMENT()</p><p>: neural network f , input partition P Result: smaller partitions P l and Pu, if any 1 Let cex count be the total number of counterexamples found 2 if (P.depth &#8805; max refinement depth) then 3 return (null,null) // do not split P 4 else if (P.depth &#8805; min sample depth) and SAMPLEDCEX(P ) then 5 cex count += 1 6 return (null,null) // do not split P 7 else // R, R &#8242; are gradient masks computed for I, I &#8242; 8</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Early Termination Conditions</head><p>In Lines 2-6 of Algorithm 3, we check if P.depth exceeds the predefined max refinement depth. If the answer is yes, we avoid splitting P further. For example, if max refinement depth= 20, it means the current partition P occupies only |P |/|X| = 1 2 20 of the entire input domain X. By increasing the refinement depth, we can decrease the percentage of undecided inputs over X.</p><p>If P.depth has not exceeded the maximal refinement depth, we check if P.depth exceeds the predefined min sample depth, which is set to a value (e.g., 15) smaller than max refinement depth. When P.depth exceeds this threshold, we start searching for counterexamples in P via random sampling.</p><p>Inside the random sampling subroutine SAMPLEDCEX(P ) shown in Line 4, we sample up to 10 concrete inputs in P and check if x and its counterpart x &#8242; satisfy f (x) &#824; = f (x &#8242; ). If this condition is satisfied, a counterexample is found (but P remains undecided); in this case, we increment cex count and stop splitting P . If no counterexample is found, we continue splitting P into smaller partitions.</p><p>Note that in both early termination cases (Lines 3 and 6), the partition P will be marked as undecided since we are not able to decide whether the DNN model is fair or unfair to all individuals in P .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Splitting Input Intervals</head><p>In Lines 7-14 of Algorithm 3, we split P into smaller partitions P l and P u by first identifying the input attribute x i that has the largest influence on the output (Lines 8-12) and then bisecting its input interval x i &#8712; [lb, ub].</p><p>Our method for identifying the input attribute x i is based on maximizing the impact of an input attribute on the network's output. One way to estimate the impact is taking the product of the gradient g(x i ) and the input range |ub(x i ) -lb(x i )|. In the literature, the product is often called the smear value <ref type="bibr">[22]</ref>, <ref type="bibr">[23]</ref>. Unlike existing methods such as Wang et al. <ref type="bibr">[7]</ref>, however, our computation of the smear value is different because we must consider both inputs I and I &#8242; , which may have different gradients.</p><p>Specifically, during forward analysis, we store the neuron activation information in two gradient mask matrices denoted R and R &#8242; , where R[i][j] is <ref type="bibr">[1,</ref><ref type="bibr">1]</ref> if the j-th neuron at i-th layer is always active, [0,0] if it is always inactive, and [0,1] if it is unknown. The neuron activation information is used later to perform backward refinement for this partition P .</p><p>During refinement, we first compute the two gradients g I and g I &#8242; and then take the average. Our goal is to identify the input attribute that has the largest overall influence on the network's output.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. The Running Example</head><p>Consider our running example in Fig. <ref type="figure">2</ref> again. To compute the smear value, we start with the output layer's edge weights, which are 0.2 for h 1 and -1 for h 2 . Since the ReLU associated with h 1 is always-on, g I (h 1 ) and g I &#8242; (h 1 ) are set to the interval [0.2, 0.2]. However, since the ReLU associated with h 2 is nonlinear, as indicated by the gradient mask matrices R and R &#8242; , g I (h 2 ) and g I &#8242; (h 2 ) are set to the interval [-1.0, 0].</p><p>Then, we propagate these gradient intervals backwardly, to get g</p><p>Next, we compute the average g, based on which we compute smear values. Since x 1 has the smear value of 0.6 &#215; 4 = 2.4 and x 3 has the smear value of 0.24 &#215; 5 = 1.2, we choose to partition P by bisecting the input interval of x 1 . This leads to the smaller partitions shown in Fig. <ref type="figure">3</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D. Generalization</head><p>While we only consider ReLU networks in this paper, our refinement technique can be extended to non-ReLU activations. Recall that, by definition, ReLU(z) = 0 (inactive) if z &lt; 0, and ReLU(z) = 1 (active) if z &gt; 0. Let &#963;(z) be a non-ReLU activation function. To compute the gradient mask matrices R and R &#8242; , we use thresholds (&#1013; 1 , &#1013; 2 ) to approximate the on/off behavior: the mask is</p><p>Although the approximate on/off behavior of non-ReLU activation function &#963;(z) is not the same as the on/off behavior of ReLU(z), it serves as a practically-useful heuristic to rank the input attributes. Furthermore, this generalization will not affect the soundness of our method, since the gradient masks computed in this manner are only used for picking which input attribute to split first.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>VII. FAIRNESS QUANTIFICATION</head><p>We now present our method for updating the percentages of certified and falsified inputs, when the DNN model is found to be fair or unfair for the current input partition P . The pseudo code is shown in Algorithm 4.</p><p>Algorithm 4: Subroutine QUANTIFYFAIRNESS()</p><p>// percentage of inputs in partition P There are three cases. First, if the current partition P is found to be fair, meaning that all inputs in P are treated fairly, we compute the percentage of input domain X covered by the partition P , denoted r P , and then add r P to r cer , the percentage of certified inputs. Second, if the current partition P is found to be unfair, meaning that all inputs in P are treated unfairly, we add r P to r f al , the percentage of falsified inputs. In both cases, we also subtract r p from r und . Otherwise, the current partition P remains undecided and the percentages remain unchanged.</p><p>Consider our running example with input partition P defined as <ref type="bibr">5]</ref>, as shown by the right child of the root node in Fig. <ref type="figure">3</ref>. This partition has a total of 24 individuals, and its corresponding I = P | x2=0 and I &#8242; = P | x2=1 contain 12 individuals each. In contrast, the entire input domain X has 60 individuals, or 30 pairs of x and its counterpart x &#8242; (where x 2 &#824; = x &#8242; 2 ). For this input partition P , O = [1.49, 2.65] and O &#8242; = [1.0, 2.36] are the output intervals. Assuming that the decision threshold is 0, the bounds of O and O &#8242; imply that the DNN model will generate the positive label for both I and I &#8242; , meaning that the DNN model is fair for all individuals in P .</p><p>Since the input partition size is 12 and the input domain size is 30, the rate r P = 12 30 = 40%. After certifying P to be fair, we can add 40% to r cer , the certification rate, and consequently subtract 40% from r und , the undecided rate.</p><p>While the above computation assumes that population distribution for each feature is uniform and thus the percentage (e.g., 40%) is computed directly from the partition size (e.g., <ref type="bibr">12</ref>) and the domain size (e.g., 30), the method can be easily extended to consider a non-uniform population distribution. Furthermore, note that the method works regardless of whether the input attributes have integer or real values.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>VIII. EXPERIMENTS</head><p>We have implemented FairQuant in a software tool written in C, by leveraging the OpenBlas<ref type="foot">foot_1</ref> library for fast matrix multiplication and symbolic representation of the upper and lower bounds. Our forward analysis follows that of Wang et al. <ref type="bibr">[7]</ref>, <ref type="bibr">[20]</ref>. For experimental comparison, we also run Fairify</p><p>TABLE I STATISTICS OF THE DATASETS AND DNNS USED IN OUR EXPERIMENTS. Dataset (PA) # Inputs DNN # Layers # Neurons Accuracy (%) Bank (age) 16 BM-1 [10] 2 80 89.20 BM-2 [10] 2 48 88.76 BM-3 [10] 1 100 88.22 BM-4 [10] 3 300 89.55 BM-5 [10] 2 32 88.90 BM-6 [10] 2 18 88.94 BM-7 [10] 2 128 88.70 BM-8 [10] 5 124 89.20 German (age) 20 GC-1 [10] 1 50 72.67 GC-2 [10] 1 100 74.67 GC-3 [10] 1 9 75.33 GC-4 [10] 2 10 70.67 GC-5 [10] 5 124 69.33 Adult (gender) 13 AC-1 [10] 2 24 85.24 AC-2 [10] 1 100 84.70 AC-3 [10] 1 50 84.52 AC-4 [10] 2 200 84.86 AC-5 [10] 2 128 85.19 AC-6 [10] 2 24 84.77 AC-7 [10] 5 124 84.85 AC-8 [10] 2 10 82.15 AC-9 [10] 4 12 81.22 AC-10 [10] 4 20 78.56 AC-11 [10] 4 40 79.25 AC-12 [10] 9 45 81.46 Compas (race) 6 compas-1 2 24 73.46 compas-2 5 124 72.82 compas-3 3 600 72.98 compas-4 9 90 72.98 compas-5 10 2000 72.01 compas-6 4 4000 73.95 compas-7 10 10000 72.49</p><p>which is the only currently-available tool for DNN individual fairness certification. Since Fairify cannot quantify the degree of fairness, we compute the certified/falsified/undecided rates based on its reported statistics.</p><p>It is worth noting that Fairify and our method (FairQuant) have a fundamental difference in falsification. Fairify stops and declares an input partition as SAT as soon as it finds a counterexample in that partition; thus, the number of counterexamples that it finds is always the same as the number of SAT partitions it reports. However, SAT partitions are not necessarily unfair partitions, since unfair partitions require all inputs to be counterexamples, but a SAT partition, excluding the one counterexample, still remains undecided.</p><p>FairQuant checks if an entire partition is unfair. Moreover, when the partition is undecided, it can minimize the amount of undecided inputs by only sampling for counterexamples after it reaches a deep enough refinement depth. This is made possible through our iterative refinement.</p><p>For example, in a DNN model named GC-3, Fairify finds 194 SAT partitions (together with 6 UNSAT and 1 UNKNOWN partitions). However, none of these 194 SAT partitions are unfair partitions. Instead, the percentage of falsified inputs is close to being 0% (representing 194 counterexamples out of over 435 trillion individuals in the input domain), the percentage of certified inputs is 2.985% (6 UNSAT partitions out of 201 partitions), and the rest remains undecided. FairQuant, on the other hand, finds 25,963 counterexamples; furthermore, it is able to formally certify 58.44% of the inputs as fair.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Benchmarks</head><p>Table <ref type="table">I</ref> shows the statistics of the benchmarks, including 32 deep neural networks trained on four popular datasets for fairness research. Among the 32 networks, 25 came from Fairify <ref type="bibr">[10]</ref> and the other 7 were trained by ourselves using TensorFlow. All of these networks have a single node in the output layer, to determine the binary classification result. Columns 1-2 show the name of each dataset with its considered protected attribute (PA) and the number of input attributes. Columns 3-6 show the name of each DNN model, its number of hidden layers, number of hidden neurons, and classification accuracy. The accuracy for DNNs trained on Bank, German, and Adult was provided by the Fairify paper. For the models we trained using Compas, we have reserved 10% of the data for testing. All the networks coming directly from Fairify on Bank, German, and Adult datasets are small, where the largest has only 200 hidden neurons. Moreover, most of them have only 1 or 2 hidden layers. Thus, we additionally trained much larger networks, with up to 10,000 hidden neurons, using the Compas dataset.</p><p>Details of the four datasets are given as follows. Bank <ref type="bibr">[16]</ref> is a dataset for predicting if a bank client will subscribe to its marketing; it consists of 45,000 samples. German <ref type="bibr">[17]</ref> is a dataset for predicting the credit risk of a person; it consists of 1,000 samples. Adult <ref type="bibr">[18]</ref> is a dataset for predicting if a person earns more than $50,000; it consists of 32,561 samples. Finally, Compas <ref type="bibr">[19]</ref> is a dataset for predicting the risk of recidivism; it consists of 6,172 samples. <ref type="foot">3</ref>We evaluate our method using three legally-protected input attributes. For Bank and German, we use age; for Adult, we use gender; and for Compas, we use race. <ref type="foot">4</ref> These are consistent with Fairify and other prior works in the fairness research.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. Experimental Setup</head><p>We ran all experiments on a computer with 2 CPU, 4GB memory, and Ubuntu 20.04 Linux operating system. We set a time limit of 30 minutes for each DNN model. Our experiments were designed to answer three research questions:</p><p>1) Is FairQuant more accurate than the current state-of-theart in certifying individual fairness of a DNN model? 2) Is FairQuant more scalable than the current state-ofthe-art in handling DNN models, especially when the network size increases? 3) Is FairQuant more effective than the current state-ofthe-art in providing feedback, e.g., by quantitatively measuring the percentages of certified, falsified, and undecided inputs? Fairify requires a parameter MS (maximum size of an input attribute) based on which it creates a fixed number of input partitions prior to certification. On the DNN models trained for Bank, German, and Adult, we used the default MS values</p><p>TABLE II RESULTS FOR FAIRNESS CERTIFICATION: FAIRIFY VIS-&#192;-VIS FAIRQUANT Dataset DNN Fairify [10] FairQuant (new) Time Cex #Cex Cer% Fal% Und% Time Cex #Cex Cer% Fal% Und% Bank BM-1 30m &#10003; 11 10.00 0 90.00 4.82s &#10003; 2820 94.23 0 5.76 BM-2 31m &#10003; 28 16.07 0 83.93 3.23s &#10003; 2479 93.41 0 6.58 BM-3 31m &#10003; 27 19.60 0 81.40 1.21s &#10003; 1864 95.69 0 4.30 BM-4 35m &#10003; 4 3.72 0 96.18 71.12s &#10003; 5135 87.03 0 12.96 BM-5 23m &#10003; 114 77.25 0 22.75 1.03s &#10003; 1474 96.27 0 3.72 BM-6 12m &#10003; 155 69.41 0 30.59 0.44s &#10003; 1426 96.44 0 3.55 BM-7 30m &#10003; 57 9.41 0 90.59 12.26s &#10003; 7017 83.65 0 16.34 BM-8 30m &#10003; 1 0.98 0 99.02 18.99s &#10003; 3074 90.75 0 9.24 German GC-1 32m &#10003; 22 0 0 100 9.73s &#10003; 31585 32.67 0 67.33 GC-2 33m &#10003; 6 0 0 100 31.72s &#10003; 32655 42.21 0 57.79 GC-3 8m &#10003; 194 2.98 0 97.02 6.77s &#10003; 25963 58.44 0 41.55 GC-4 4m &#10003; 2 99.00 0 1.00 0.29s &#10003; 77 99.65 0 0.34 GC-5 30m &#10007; 0 0 0 100 1.24s &#10003; 9 99.80 0 0.19 Adult AC-1 32m &#10003; 3 0.03 0 99.97 3.23s &#10003; 6151 90.68 0 9.31 AC-2 31m &#10003; 9 0.01 0 99.99 30.04s &#10003; 13008 79.93 0 20.06 AC-3 32m &#10003; 20 0 0 100 37.12s &#10003; 60494 33.29 0 66.70 AC-4 36m &#10007; 0 0 0 100 8m &#10003; 61324 24.79 0 75.20 AC-5 33m &#10007; 0 0 0 100 4m &#10003; 71012 19.12 0 80.87 AC-6 33m &#10003; 4 0.01 0 99.99 10.20s &#10003; 31593 58.82 0 41.17 AC-7 30m &#10007; 0 0.01 0 99.99 4m &#10003; 25588 31.72 0 68.27 AC-8 30m &#10003; 39 0.03 0 99.97 11.18s &#10003; 26179 66.50 0 33.49 AC-9 30m &#10003; 126 0.64 0 99.36 3.50s &#10003; 5470 91.13 0 8.86 AC-10 32m &#10003; 8 0.03 0 99.97 5.01s &#10003; 9033 87.65 0 12.34 AC-11 30m &#10007; 0 0 0 100 36.44s &#10003; 24516 58.01 0 41.98 AC-12 30m &#10007; 0 0.02 0 99.98 0.91s &#10003; 8824 70.82 0 29.17 Compas compas-1 17m &#10003; 2 80.00 0.32 19.68 0.01s &#10003; 17 97.27 2.72 0 compas-2 31m &#10007; 0 0 0 100 0.01s &#10003; 15 97.59 2.40 0 compas-3 30m &#10007; 0 0 0 100 0.30s &#10003; 12 98.07 1.92 0 compas-4 30m &#10007; 0 0 0 100 0.01s &#10003; 14 97.75 2.24 0 compas-5 T/O &#10007; 0 0 0 100 5.24s &#10003; 11 98.23 1.76 0 compas-6 M/O &#10007; 0 0 0 100 9.19s &#10003; 12 98.07 1.92 0 compas-7 M/O &#10007; 0 0 0 100 101.25s &#10003; 15 97.59 2.40 0 (100, 100, and 10) for Fairify to create 510, 201, and 16000 partitions, respectively. On the new DNN models trained for Compas, we set MS to a small value of 2 to create 20 partitions for Fairify.</p><p>This was done to maximize Fairify's performance such that it does not "choke" in verifying each input partition. By default, Fairify uses 100 seconds as "soft timeout" for each input partition and uses 30 minutes as "hard timeout" for the entire DNN. This means that it takes at most 100 seconds to verify a single input partition, and if unsolved, it just moves to the next partition, until the entire 30 minutes runs out.</p><p>To run FairQuant, we set the parameters min check depth to 15 and max refinement depth to 20 for all DNN models. We also use 30 minutes as "hard timeout", but FairQuant always finished before the limit.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>C. Experimental Results</head><p>Table <ref type="table">II</ref> shows the results of our method (FairQuant) in comparison with Fairify<ref type="foot">foot_4</ref> . Columns 1-2 show the names of the dataset and the DNN model. Columns 3-5 show the statistics reported by Fairify, including the time taken, whether a counterexample is found (Cex) and the number of counterexamples found (#Cex). T/O or M/O in Column 3 respectively means that Fairify either spent all 30m or ran out of memory in the network pruning step prior to verifying any input partition. Columns 6-8 show the percentage of certified, falsified and undecided inputs (Cer%, Fal%, Und%). Columns 9-14 show the corresponding results from FairQuant. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>1) Results for RQ 1:</head><p>To answer the first research question (RQ 1), i.e., whether our method is more accurate than the current state-of-the-art, we need to compare the results shown in Columns 4-5 (for Fairify) with the results shown in Columns 10-11 (for FairQuant). Specifically, Columns 4 and 10 indicate whether the tool is able to find a counterexample (&#10003;) or not (&#10007;) within the time limit.</p><p>While our method (FairQuant) found counterexamples for all 32 DNNs, Fairify found counterexamples for only 20 of the 32 models. In addition, it found counterexamples for only one of the 7 newly added models. Moreover, Columns 5 and 11 show that, on models where both tools found counterexamples, the number of counterexamples found by FairQuant is often thousands of times more. For example, the largest number of counterexamples found by Fairify is 194 (for GC-3) but the large number of counterexamples found by FairQuant is 71,012 (for AC-5).</p><p>2) Results for RQ 2: To answer the second research question (RQ 2), i.e., whether our method is more scalable than the current state-of-the-art, we need to compare the running time shown in Column 3 (for Fairify) with the running time shown in Column 9 (for FairQuant). While our method (FairQuant) always finished within the time limit of 30 minutes, Fairify timed out on compas-5 and ran out of memory on compas-6 and compas-7. Even on the models where both tools finished, the time taken by Fairify is significantly longer.</p><p>To illustrate the scalability advantage of our method, we took a subset of the models for which both FairQuant and Fairify finished, and plot the running time in a bar chart, shown on the left side of Fig. <ref type="figure">5</ref>. Here, the red bars represent the time taken by Fairify and the blue bars represent the time taken by FairQuant. The results show that FairQuant is many orders of magnitude faster, and can certify DNN models that are well beyond the reach of Fairify.</p><p>3) Results for RQ 3: To answer the third research question (RQ 3), i.e., whether our method is more effective in providing feedback to the user, we need to compare the results in Columns 6-8 (for Fairify) with the results in Columns 12-14 (for FairQuant), which show the certified, falsified, and undecided percentages. Since Fairify was not designed to quantitatively measure the degree of fairness, it did poorly in almost all cases. Except for a few DNN models for Bank, GC-4, and compas-1, its certified percentages are either 0 or close to 0, and its undecided percentages are almost 100%. It means that, for the vast majority of individuals in the input domain, whether they are treated by the DNN model fairly or not remains undecided.</p><p>In contrast, the certified percentages reported by our method (FairQuant) are significantly higher. For the models trained using the Compas dataset, in particular, the certified percentages are around or above 90%, and more importantly, the undecided percentages are always 0. It means that FairQuant has partitioned the input domain in such a way that each partition is either certified as being fair, or falsified as being unfair. Even on the subset of DNN models where some inputs remain undecided by FairQuant, the undecided percentages reported by our method are significantly lower than Fairify, as shown on the right side of Fig. <ref type="figure">5</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>D. Summary</head><p>The results show that our method is more accurate and more scalable than the current state-of-the-art techniques for qualitative certification. In addition, our method is able to formally quantify the degree of fairness, which is a capability that existing methods do not have.</p><p>For some DNN models, FairQuant still has a significant percentage of inputs left undecided. This is because we set min check depth=15 and max refinement depth=20 for all benchmarks. Thus, as soon as FairQuant reaches the refinement depth 15 (see the refinement tree shown in Fig. <ref type="figure">3</ref>) and finds a counterexample in the input partition, it will stop refining further; at that moment, all inputs in the partition are treated conservatively as undecided.</p><p>In general, a smaller refinement depth allows FairQuant to terminate quickly. During our experiments, FairQuant terminated after 0.29s and 1.24s for GC-4 and GC-5, respectively, compared to the 4 minutes and 30 minutes taken by Fairify and yet returned better results. In fact, for GC-5, Fairify spent 30 minutes but failed to find any counterexample. If we increase the refinement depth, by increasing the two threshold values of FairQuant, its quantification results will get even better.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>IX. RELATED WORK</head><p>Our method is the first scalable method for certifying and quantifying individual fairness of a deep neural network, and it outperforms the most closely related prior work, Fairify <ref type="bibr">[10]</ref>. To the best of our knowledge, no other methods can match the accuracy, scalability, and functionality of our method.</p><p>Our method differs from existing techniques for verifying individual fairness properties for neural networks. Libra <ref type="bibr">[31]</ref>, <ref type="bibr">[32]</ref> uses abstract domains to perform verification but is limited in scalability due to the expensive pre-analysis, where a network of 20 hidden nodes takes several hours even with leveraging multiple CPUs. DeepGemini [?], which outperforms Libra, is built on top of Marabou [?], a SMTbased neural network verification tool, and thus shares the same limitations of Fairify. Furthermore, it only evaluates on networks with up to around 250 hidden neurons. Other works have tackled neural network verification of different definitions of individual fairness. Benussi et al. <ref type="bibr">[26]</ref> and Khedr et al. <ref type="bibr">[27]</ref> proposed different methods to certify a definition of global individual fairness proposed in <ref type="bibr">[28]</ref>. Ruoss et al. <ref type="bibr">[29]</ref> verify a type of a local individual fairness property that is similar to robustness, given an input x and a small constant &#949; for perturbation. This is different from a global perspective we have discussed so far in this paper.</p><p>Group fairness is yet another type of fairness property, which can be verified using probabilistic techniques <ref type="bibr">[14]</ref>, <ref type="bibr">[15]</ref>, <ref type="bibr">[30]</ref>. The difference between individual fairness and group fairness is that, while individual fairness requires similar individuals to be treated similarly, group fairness requires similar demographic groups to be treated similarly.</p><p>There are other prior works related to fairness verification of other types of machine learning models <ref type="bibr">[28]</ref>, <ref type="bibr">[33]</ref>, <ref type="bibr">[6]</ref>, but they are not applicable to deep neural networks. Testing techniques can quickly detect fairness violations in machine learning models including neural networks <ref type="bibr">[34]</ref>, <ref type="bibr">[35]</ref>, <ref type="bibr">[11]</ref>, <ref type="bibr">[36]</ref>, <ref type="bibr">[12]</ref>, <ref type="bibr">[37]</ref>, but it does not provide formal guarantee that is important for certain applications. There are also techniques for improving fairness of machine learning models <ref type="bibr">[38]</ref>, <ref type="bibr">[39]</ref>, <ref type="bibr">[40]</ref>, <ref type="bibr">[41]</ref>, <ref type="bibr">[42]</ref>, <ref type="bibr">[43]</ref>, <ref type="bibr">[44]</ref>, which are orthogonal to our method that focuses on certifying and quantifying fairness of existing DNN models.</p><p>At a high level, our method is related to the large number of robustness verifiers for deep neural networks based on interval analysis <ref type="bibr">[7]</ref>, <ref type="bibr">[20]</ref>, <ref type="bibr">[8]</ref>, <ref type="bibr">[45]</ref>, SMT solving <ref type="bibr">[21]</ref>, <ref type="bibr">[46]</ref>, [?], <ref type="bibr">[47]</ref>, and mixed-integer linear programming <ref type="bibr">[48]</ref>, <ref type="bibr">[?]</ref>. While these verifiers can decide if a model is robust against adversarial perturbation, they cannot directly certify individual fairness, as explained earlier in Section II. Other neural network verifiers that deal with differential <ref type="bibr">[49]</ref>, <ref type="bibr">[50]</ref>, [?] or equivalence verification <ref type="bibr">[52]</ref> are also different, since they evaluate over two networks instead of one network.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>X. CONCLUSION</head><p>We have presented FairQuant, a scalable method for certifying and quantifying individual fairness of a deep neural network over the entire input domain. It relies on sound abstraction during symbolic forward analysis to improve scalability, and iterative refinement based on backward analysis to improve accuracy. In addition to certifying fairness, it is able to quantify the degree of fairness by computing the percentages of inputs whose classification outputs can be certified as fair or falsified as unfair. We have evaluated the method on a large number of DNN models trained using four popular fairness research datasets. The experimental results show that the method significantly outperforms state-of-the-art techniques in terms of both accuracy and scalability, as well as the ability to quantify the degree of fairness.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>This notion can be understood as causal fairness<ref type="bibr">[35]</ref> or dependency fairness<ref type="bibr">[31]</ref>, which is a non-probabilistic form of counterfactual fairness<ref type="bibr">[6]</ref>.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1"><p>http://www.openblas.net</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="3" xml:id="foot_2"><p>We used the preprocessed Compas data provided by<ref type="bibr">[24]</ref>.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_3"><p>For Bank and German, we use binarized age attribute provided by Fairify. For Compas, we binarize race attribute into {white, non-white} as done in<ref type="bibr">[25]</ref>.</p></note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="5" xml:id="foot_4"><p>The order in which Fairify sorts the partitions before running the verification query is random and non-deterministic, so there may be minor difference in the reported counterexamples in the original evaluation and ours.</p></note>
		</body>
		</text>
</TEI>
