Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated ml playbook step file #76

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions playbooks/besman-counterfit-0.0.1-steps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"Open a new terminal in your machine and run the below steps\n",
"\n",
"#### 1. Change directory to counterfit\n",
"`cd counterfit`\n",
"`cd ~/counterfit`\n",
"\n",
"#### 2. Activate conda environment.\n",
"`conda activate counterfit`\n",
"\n",
"#### 3. Activate counterfit.\n",
"`counterfit`\n",
"\n",
"verify that the prompt changes to \\(coounterfit>\\)\n",
"verify that the prompt changes to \\(counterfit>\\)\n",
"\n",
"#### 4. List available targets\n",
"`list targets`\n",
Expand All @@ -40,9 +40,11 @@
" The new target name should be same as BESMAN_ARTIFACT_NAME and should have been git cloned. \n",
"\n",
"#### 6. Copy the model files to counterfit target. \\(This step is applicable only if the target is not available in list\\) \n",
"`cp -f <BESMAN_ARTIFCAT_NAME>/counterfit/<BESMAN_ARTIFCAT_NAME>.py counterfit/targets/<BESMAN_ARTIFCAT_NAME>.py`\n",
"`cp -f <BESMAN_ARTIFCAT_NAME>/counterfit/<BESMAN_ARTIFCAT_NAME>.npz counterfit/targets/<BESMAN_ARTIFCAT_NAME>/<BESMAN_ARTIFCAT_NAME>.npz`\n",
"`cp -f <BESMAN_ARTIFCAT_NAME>/<BESMAN_ARTIFCAT_NAME>.h5 counterfit/targets/<BESMAN_ARTIFCAT_NAME>/<BESMAN_ARTIFCAT_NAME>.h5`\n",
"`cp -f <BESMAN_ARTIFCAT_NAME>/counterfit/<BESMAN_ARTIFCAT_NAME>.py counterfit/targets/`\n",
"\n",
"`cp -f <BESMAN_ARTIFCAT_NAME>/counterfit/<BESMAN_ARTIFCAT_NAME>.npz counterfit/targets/<BESMAN_ARTIFCAT_NAME>/`\n",
"\n",
"`cp -f <BESMAN_ARTIFCAT_NAME>/<BESMAN_ARTIFCAT_NAME>.h5 counterfit/targets/<BESMAN_ARTIFCAT_NAME>/`\n",
"\n",
"#### 7. List available targets\n",
"`list targets`\n",
Expand All @@ -67,23 +69,27 @@
"#### 11. Test model without attack.\n",
"`predict -i <sample_index>`\n",
"\n",
"sample_index is the index of file given as input to the model under test. The model is provided with a set of input bundled in a .npz file (This file is expected to be created when we the tartget folder under counterfit is created). Based on the index number in this command the input will be feed to the model for prediction.\n",
"sample_index is the index of file given as input to the model under test. The model is provided with a set of input bundled in a .npz file (This file is expected to be created when we the tartget folder under counterfit is created). Based on the index number in this command the input will be feed to the model for prediction. Please check the index number range from the model documentation.\n",
"\n",
"Verify that the model predicts the output as expected.\n",
"\n",
"#### 12. Now set the model prameters for attack.\n",
"\n",
"To execute the attack, the user needs to configure several parameters in Counterfit. These parameters can be viewed using the `show options` command. To set the parameters use the command below.\n",
"\n",
"`set_params <list of params and their value in format \\\"--\\<key\\> value\\\">`\n",
"\n",
"e.g set_params --sample_index=5 --max_eval 5000 --max_iter 10\n",
"\n",
"To know the parameters use `show options` command.\n",
"\n",
"#### 13. Run the attcack\n",
"`run`\n",
"\n",
"#### 14. Check the model output now \n",
"`predict -a`\n",
"\n",
"In this step, the user can compare the prediction with the output from step 11. They can verify if the prediction after the attack differs from the prediction before the attack in step 11.\n",
"\n",
"#### 15. Save the results\n",
"`save -r`\n",
"\n",
Expand Down