Skip to content

Commit

Permalink
GRU model for LOS (#170)
Browse files Browse the repository at this point in the history
* ReadMe file for creating dataset from MIMICIII, and training LOS>3 classifier

* adding links to readMe file

* fixing the LR model

* Mimic_Hnadler, data_processeing, model and the main file

* all attacks are running

* add relevant files from MIMIC_Extract and mimic_code repos

* fix some bugs regarding nivduration

* revert conflicting tabular_mia files

* adding subset to the mimicDataset

* fixing loading the database and indices

* adding GRU

* adding GRU-D structure

* updating grud class

* adding early stopping

* the model is running

* the model is running

* working on meta data

* mimic hanlder gru is added

* LiRA in place

* running lira

* LiRA and RMIA for GRU, temp implmemntation

* adding flag for changing the classifier

* LR and read me

* up to adding report handler module

* renaming files, adding report handler module

* renaming files, adding report handler module

* adding the license, renaming some files and classes

* fixing the accuracy in model handler

* fixing pandas warning and adding a check to saved shadow models model type

* fixing a bug in shadow_model_handler

* ruff fix
  • Loading branch information
fazelehh authored Jan 10, 2025
1 parent e5c363d commit f30b53a
Show file tree
Hide file tree
Showing 14 changed files with 2,063 additions and 488 deletions.
5 changes: 5 additions & 0 deletions examples/mia/LOS/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Lenght-of-Stay Usecase
In this use case, we focus on attacking length-of-stay classifier models. As part of the example, we train a Logistic Regression model and a Gated Recurrent Unit with Decay (GRU-D).

## MIMIC-III Data Preprocessing
To prepare the data, refer to instructions in ```mimic_prepration/ReadMe.md ```
27 changes: 14 additions & 13 deletions examples/mia/LOS/audit.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
audit: # Configurations for auditing
random_seed: 1234 # Integer specifying the random seed
attack_list:
# rmia:
# training_data_fraction: 0.5 # Fraction of the auxilary dataset to use for this attack (in each shadow model training)
# attack_data_fraction: 0.5 # Fraction of auxiliary dataset to sample from during attack
# num_shadow_models: 8 # Number of shadow models to train
# online: True # perform online or offline attack
# temperature: 2
# gamma: 1.0
# offline_a: 0.33 # parameter from which we compute p(x) from p_OUT(x) such that p_IN(x) = a p_OUT(x) + b.
# offline_b: 0.66
rmia:
training_data_fraction: 0.5 # Fraction of the auxilary dataset to use for this attack (in each shadow model training)
attack_data_fraction: 0.5 # Fraction of auxiliary dataset to sample from during attack
num_shadow_models: 8 # Number of shadow models to train
online: True # perform online or offline attack
temperature: 2
gamma: 1.0
offline_a: 0.33 # parameter from which we compute p(x) from p_OUT(x) such that p_IN(x) = a p_OUT(x) + b.
offline_b: 0.66
# qmia:
# training_data_fraction: 1.0 # Fraction of the auxilary dataset (data without train and test indices) to use for training the quantile regressor
# epochs: 5 # Number of training epochs for quantile regression
Expand All @@ -32,12 +32,13 @@ audit: # Configurations for auditing

target:
# Target model path
module_path: "utils/model.py"
model_class: "MimicLR"
module_path: "utils/model_LR.py" # either model_grud.py or model_LR.py for logestic regression
model_class: "LR" # LR/GRUD
# Data paths
target_folder: "./target"
data_path: "./data/dataset.pkl"
target_folder: "./target_LR" # either target_GRUD or target_LR
data_path: "./data/flattened/dataset.pkl" #unflattened dataset for GRUD and flattened dataset for LR

shadow_model:
model_class: # LR/GRUD

distillation_model:
Loading

0 comments on commit f30b53a

Please sign in to comment.