prakharg24 commited on
Commit
83ab461
·
verified ·
1 Parent(s): 4b89a2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -13
app.py CHANGED
@@ -2,24 +2,26 @@ import streamlit as st
2
 
3
  st.set_page_config(layout="wide")
4
 
5
- st.title("AI Model Fairness Auditing")
 
 
 
 
6
 
7
  # --------------------------------------------------
8
  # Strategy Definitions
9
  # --------------------------------------------------
10
 
11
  model_owner_actions = {
12
- "Fine-tuning / overfitting on auditing test": {"cheating": 25, "cost": 0, "open": -5},
13
- "Fine-tuning on auditing-like distribution": {"cheating": 20, "cost": 0, "open": -3},
14
- "Training special audit behaviour": {"cheating": 30, "cost": 5, "open": -10},
15
- "Withholding training details": {"cheating": 15, "cost": 0, "open": -15},
16
  }
17
 
18
  auditor_actions = {
19
- "Audit on one dataset": {"cheating": 20, "cost": 10, "open": 5},
20
- "Audit on multiple datasets": {"cheating": -15, "cost": 25, "open": 10},
21
- "Request internal model access": {"cheating": -25, "cost": 30, "open": 30},
22
- "Request training documentation": {"cheating": -10, "cost": 5, "open": 20},
23
  }
24
 
25
  # --------------------------------------------------
@@ -135,12 +137,38 @@ with right:
135
  # Score Calculation
136
  # --------------------------------------------------
137
 
138
- auditor_cost = 0
139
- owner_cost = 0
140
- reliability = 50
141
- openness = 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
 
 
143
  for action in st.session_state.owner_selected:
 
 
 
 
 
144
  auditor_cost += model_owner_actions[action]["cost"]
145
  owner_cost += 10 # simple baseline cost for owner strategies
146
  reliability -= model_owner_actions[action]["cheating"]
 
2
 
3
  st.set_page_config(layout="wide")
4
 
5
+ margin1, center, margin2 = st.columns([1,9,1])
6
+
7
+ with center:
8
+
9
+ st.title("AI Model Fairness Auditing")
10
 
11
  # --------------------------------------------------
12
  # Strategy Definitions
13
  # --------------------------------------------------
14
 
15
  model_owner_actions = {
16
+ "Overfit to Audit Dataset": "overfit",
17
+ "Overfit to Audit Dataset-like Distribution": "overfitdist",
 
 
18
  }
19
 
20
  auditor_actions = {
21
+ "Audit with One Dataset": "auditone",
22
+ "Audit with Multiple Datasets": "auditmany",
23
+ "Use Private Auditing Datasets": "private",
24
+ "Audit Model Internals": "internals",
25
  }
26
 
27
  # --------------------------------------------------
 
137
  # Score Calculation
138
  # --------------------------------------------------
139
 
140
+ auditor_active_list = []
141
+ for action in st.session_state.auditor_selected:
142
+ auditor_active_list.append(auditor_actions[action])
143
+ owner_active_list = []
144
+ for action in st.session_state.owner_selected:
145
+ owner_active_list.append(owner_actions[action])
146
+
147
+
148
+
149
+ auditor_cost = "🟢 Low"
150
+ if "auditmany" in auditor_active_list:
151
+ auditor_cost = "🟡 Medium"
152
+ if "internals" in auditor_active_list:
153
+ auditor_cost = "🔴 High"
154
+
155
+ owner_cost = "None"
156
+ if "overfit" in owner_active_list:
157
+ owner_cost = "🟢 Low"
158
+ if "overfitdist" in owner_active_list:
159
+ owner_cost = "🟡 Medium"
160
+
161
+ reliability
162
+ openness
163
+
164
 
165
+ owner_current = "none"
166
  for action in st.session_state.owner_selected:
167
+ if model_owner_actions[action]=="overfit" and owner_current = "none":
168
+ owner_current = "overfit"
169
+ if model_owner_actions[action]=="overfitdist" and owner_current = "none":
170
+ owner_current = "overfit"
171
+
172
  auditor_cost += model_owner_actions[action]["cost"]
173
  owner_cost += 10 # simple baseline cost for owner strategies
174
  reliability -= model_owner_actions[action]["cheating"]