Skip to content

Commit 277d042

Browse files
committed
going back to debiasing name
1 parent 7e1e3bd commit 277d042

File tree

1 file changed

+51
-30
lines changed

1 file changed

+51
-30
lines changed

lab2/solutions/Part2_Debiasing_Solution.ipynb

Lines changed: 51 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,15 @@
856856
"source": [
857857
"### Linking model performance to uncertainty and bias\n",
858858
"\n",
859-
"We begin by considering the examples in the test dataset with the highest loss. What can you tell about which features seemed harder to learn for the VAE? What might this tell us about where the model struggles, and what predictions it may be more biased or uncertain about?"
859+
"We begin by considering the examples in the test dataset with the highest loss. What can you tell about which features seemed harder to learn for the VAE? What might this tell us about where the model struggles, and what predictions it may be more biased or uncertain about?\n",
860+
"\n",
861+
"#### **TODO: Analysis and reflection**\n",
862+
"\n",
863+
"Complete the analysis in the code block below. Write short answers to the following questions and include them in your Lab 2 submission to complete the `TODO`s!\n",
864+
"\n",
865+
"1. What, if any, trends do you observe comparing the samples with the highest and lowest reconstruction loss?\n",
866+
"2. Based on these observations, which features seemed harder to learn for the VAE?\n",
867+
"3. How does reconstruction loss relate to uncertainty? Think back to our lecture on Robust & Trustworthy Deep Learning! What can you say about examples on which the model may be more or less uncertain?"
860868
],
861869
"metadata": {
862870
"id": "QfVngr5J6sj3"
@@ -917,7 +925,16 @@
917925
"\n",
918926
"How can we determine the relative frequencies and distributions of different latent features learned by the model? How may these metrics reveal underlying biases?\n",
919927
"\n",
920-
"Let's investigate how well the SS-VAE actually learned the latent features of the faces. To do this, we will inspect individual latent features -- holding all others constant -- and look at the distribution of these features in the data and their corresponding examples. We can examine how the shape and probability density of the learned latent features."
928+
"Let's investigate how well the SS-VAE actually learned the latent features of the faces. To do this, we will inspect individual latent features -- holding all others constant -- and look at the distribution of these features in the data and their corresponding examples. We can examine the shape and probability density of the learned latent features. Further we directly compare different values of individual latent variables to corresponding relative classification accuracies (marginalizing out the effects of the other latent variables).\n",
929+
"\n",
930+
"#### **TODO: Analysis and reflection**\n",
931+
"\n",
932+
"Complete the analysis in the code blocks below. Carefully inspect the different latent variables and their corresponding frequency distributions. Write short answers to the following questions and include them in your Lab 2 submission to complete the `TODO`s!\n",
933+
"\n",
934+
"1. Pick two latent variables and describe what semantic meaning they reflect. Include screenshots of the realizations and probability distribution for the latent variables you select.\n",
935+
"2. For the latent variables selected, what can you tell about which features are under- or over-represented in the data? What might this tell us about how the model is biased?\n",
936+
"3. For the latent variables selected, how do these feature distribution differences affect classification performance? What, if any, general trends do you observe across the latent variables?\n",
937+
"4. Based on these observations, please describe your understanding of the bias of the facial detection classifier."
921938
]
922939
},
923940
{
@@ -948,24 +965,12 @@
948965
"ax[1].set_ylabel(\"Visualization\");\n"
949966
],
950967
"metadata": {
951-
"id": "8qcR9uvfCJku"
968+
"id": "8qcR9uvfCJku",
969+
"cellView": "form"
952970
},
953971
"execution_count": null,
954972
"outputs": []
955973
},
956-
{
957-
"cell_type": "markdown",
958-
"source": [
959-
"Carefully inspect the different latent variables and their corresponding frequency distributions. What can you tell about which features are under- or over-represented in the data? What might this tell us about how the model is biased?\n",
960-
"\n",
961-
"How do these feature distribution differences affect classification performance? In addition to these qualitative inspections, we can directly compare different values of individual latent variables to corresponding relative classification accuracies (marginalizing out the effects of the other latent variables).\n",
962-
"\n",
963-
"What trends do you observe with this evaluation? How does this affect your understanding of the bias of the facial detection classifier?"
964-
],
965-
"metadata": {
966-
"id": "y97C5Qsh8GvB"
967-
}
968-
},
969974
{
970975
"cell_type": "code",
971976
"source": [
@@ -1005,26 +1010,42 @@
10051010
"source": [
10061011
"## 2.8 Conclusion and submission information\n",
10071012
"\n",
1008-
"We encourage you to think about and maybe even address some questions raised by the approach and results outlined here:\n",
1009-
"* How do the samples with highest reconstruction loss and samples with highest bias compare? Which features is each one highlighting? Why do you think this is?\n",
1010-
"* In what ways is the dataset biased so far? Can you imagine other features that the dataset is biased against that we haven't uncovered yet?\n",
1011-
"* How does the supervised VAE's performance so far compare with the regular classifier on the test dataset? Is this surprising in any way?\n",
1012-
"* How can the performance of the supervised VAE classifier and the bias score be improved even further? We purposely did not optimize hyperparameters to leave this up to you!\n",
1013-
"* In which applications (either related to facial detection or not!) would debiasing in this way be desired? Are there applications where you may not want to debias your model? \n",
1014-
"* Do you think it should be necessary for companies to demonstrate that their models, particularly in the context of tasks like facial detection, are not biased? If so, do you have thoughts on how this could be standardized and implemented?\n",
1015-
"* Do you have ideas for other ways to address issues of bias, particularly in terms of the training data?\n",
1013+
"**To be eligible for the Debiasing Faces Lab prize, you must submit a document of your answers to the short-answer `TODO`s with your complete lab submission.** Please see the short-answer `TODO`s replicated again here:\n",
1014+
"\n",
1015+
"#### **TODO: Linking model performance to uncertainty and bias**\n",
1016+
"\n",
1017+
"1. What, if any, trends do you observe comparing the samples with the highest and lowest reconstruction loss?\n",
1018+
"2. Based on these observations, which features seemed harder to learn for the VAE?\n",
1019+
"3. How does reconstruction loss relate to uncertainty? Think back to our lecture on Robust & Trustworthy Deep Learning! What can you say about examples on which the model may be more or less uncertain?\n",
1020+
"\n",
1021+
"#### **TODO: Uncovering hidden biases through learned latent features**\n",
10161022
"\n",
1017-
"Try to optimize your model to achieve improved performance. **MIT students and affiliates will be eligible for prizes during the IAP offering.** To enter the competition, MIT students and affiliates should upload the following to the course Canvas:\n",
1023+
"1. Pick two latent variables and describe what semantic meaning they reflect. Include screenshots of the realizations and probability distribution for the latent variables you select.\n",
1024+
"2. For the latent variables selected, what can you tell about which features are under- or over-represented in the data? What might this tell us about how the model is biased?\n",
1025+
"3. For the latent variables selected, how do these feature distribution differences affect classification performance? What, if any, general trends do you observe across the latent variables?\n",
1026+
"4. Based on these observations, please describe your understanding of the bias of the facial detection classifier.\n",
1027+
"\n",
1028+
"**MIT students, employees, and affiliates will be eligible for prizes during the IAP offering. To enter the competition, MIT students, employees, and affiliates should upload a document write-up as part of their complete lab submission for the Debiasing Faces Lab ([submission upload link](https://www.dropbox.com/request/TTYz3Ikx5wIgOITmm5i2)).**"
1029+
]
1030+
},
1031+
{
1032+
"cell_type": "markdown",
1033+
"source": [
1034+
"## 2.9 Thinking ahead\n",
10181035
"\n",
1019-
"* Jupyter notebook with the code you used to generate your results;\n",
1020-
"* copy of the bar plot from section 2.6 showing the performance of your model;\n",
1021-
"* a description and/or diagram of the architecture and hyperparameters you used -- if there are any additional or interesting modifications you made to the template code, please include these in your description;\n",
1022-
"* discussion of why these modifications helped improve performance.\n",
1036+
"Beyond this, we encourage you to think about the following questions as you prepare for the next lab, which will focus on mitigating the issues of bias and uncertainty that you just uncovered. Consider:\n",
1037+
"* How do the samples with highest reconstruction loss and samples with highest bias compare? Which features is each one highlighting? Why do you think this is?\n",
1038+
"* In what ways is the dataset biased so far? Can you imagine other features that the dataset is biased against that we have not uncovered yet?\n",
1039+
"* How can the performance of the supervised VAE classifier be improved?\n",
1040+
"* Do you have ideas for other ways to address issues of bias, particularly in terms of the training data?\n",
10231041
"\n",
10241042
"Hopefully this lab has shed some light on a few concepts, from vision based tasks, to VAEs, to algorithmic bias. We like to think it has, but we're biased ;).\n",
10251043
"\n",
10261044
"<img src=\"https://i.ibb.co/BjLSRMM/ezgif-2-253dfd3f9097.gif\" />"
1027-
]
1045+
],
1046+
"metadata": {
1047+
"id": "mPRZReq4p68k"
1048+
}
10281049
}
10291050
],
10301051
"metadata": {

0 commit comments

Comments
 (0)