|
42 | 42 | "id": "rNbf1pRlSDby"
|
43 | 43 | },
|
44 | 44 | "source": [
|
45 |
| - "# Copyright 2022 MIT 6.S191 Introduction to Deep Learning. All Rights Reserved.\n", |
| 45 | + "# Copyright 2024 MIT 6.S191 Introduction to Deep Learning. All Rights Reserved.\n", |
46 | 46 | "#\n",
|
47 | 47 | "# Licensed under the MIT License. You may not use this file except in compliance\n",
|
48 | 48 | "# with the License. Use and/or modification of this code outside of 6.S191 must\n",
|
|
113 | 113 | "from tqdm import tqdm\n",
|
114 | 114 | "\n",
|
115 | 115 | "# Download and import the MIT 6.S191 package\n",
|
116 |
| - "!pip install mitdeeplearning\n", |
| 116 | + "!pip install mitdeeplearning --quiet\n", |
117 | 117 | "import mitdeeplearning as mdl"
|
118 | 118 | ],
|
119 | 119 | "execution_count": null,
|
|
643 | 643 | "\n",
|
644 | 644 | "In contrast, for images of **non-faces**, our loss function is solely the classification loss.\n",
|
645 | 645 | "\n",
|
646 |
| - "We can write a single expression for the loss by defining an indicator variable $\\mathcal{I}_f$which reflects which training data are images of faces ($\\mathcal{I}_f(y) = 1$ ) and which are images of non-faces ($\\mathcal{I}_f(y) = 0$). Using this, we obtain:\n", |
| 646 | + "We can write a single expression for the loss by defining an indicator variable ${I}_f$which reflects which training data are images of faces (${I}_f(y) = 1$ ) and which are images of non-faces (${I}_f(y) = 0$). Using this, we obtain:\n", |
647 | 647 | "\n",
|
648 |
| - "$$L_{total} = L_y(y,\\hat{y}) + \\mathcal{I}_f(y)\\Big[L_{VAE}\\Big]$$\n", |
| 648 | + "$$L_{total} = L_y(y,\\hat{y}) + {I}_f(y)\\Big[L_{VAE}\\Big]$$\n", |
649 | 649 | "\n",
|
650 | 650 | "Let's write a function to define the DB-VAE loss function:\n"
|
651 | 651 | ]
|
|
850 | 850 | "\n",
|
851 | 851 | "So, how can we actually use DB-VAE to train a debiased facial detection classifier?\n",
|
852 | 852 | "\n",
|
853 |
| - "Recall the DB-VAE architecture: as input images are fed through the network, the encoder learns an estimate $\\mathcal{Q}(z|X)$ of the latent space. We want to increase the relative frequency of rare data by increased sampling of under-represented regions of the latent space. We can approximate $\\mathcal{Q}(z|X)$ using the frequency distributions of each of the learned latent variables, and then define the probability distribution of selecting a given datapoint $x$ based on this approximation. These probability distributions will be used during training to re-sample the data.\n", |
| 853 | + "Recall the DB-VAE architecture: as input images are fed through the network, the encoder learns an estimate ${Q}(z|X)$ of the latent space. We want to increase the relative frequency of rare data by increased sampling of under-represented regions of the latent space. We can approximate ${Q}(z|X)$ using the frequency distributions of each of the learned latent variables, and then define the probability distribution of selecting a given datapoint $x$ based on this approximation. These probability distributions will be used during training to re-sample the data.\n", |
854 | 854 | "\n",
|
855 | 855 | "You'll write a function to execute this update of the sampling probabilities, and then call this function within the DB-VAE training loop to actually debias the model."
|
856 | 856 | ]
|
|
1091 | 1091 | "* 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",
|
1092 | 1092 | "* Do you have ideas for other ways to address issues of bias, particularly in terms of the training data?\n",
|
1093 | 1093 | "\n",
|
1094 |
| - "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", |
| 1094 | + "**Try to optimize your model to achieve improved performance. To enter the competition, please upload the following to the lab submission site for the Debiasing Faces Lab ([submission upload link](https://www.dropbox.com/request/KGct8m2IyOBVvIoQdef3)).**\n", |
1095 | 1095 | "\n",
|
1096 | 1096 | "* Jupyter notebook with the code you used to generate your results;\n",
|
1097 | 1097 | "* copy of the bar plot from section 2.6 showing the performance of your model;\n",
|
1098 |
| - "* 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", |
1099 |
| - "* discussion of why these modifications helped improve performance.\n", |
| 1098 | + "* a written 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", |
| 1099 | + "* a written discussion of why these modifications helped improve performance.\n", |
| 1100 | + "\n", |
| 1101 | + "**Name your file in the following format: `[FirstName]_[LastName]_Face`, followed by the file format (.zip, .ipynb, .pdf, etc).** ZIP files are preferred over individual files. If you submit individual files, you must name the individual files according to the above nomenclature (e.g., `[FirstName]_[LastName]_Face_TODO.pdf`, `[FirstName]_[LastName]_Face_Report.pdf`, etc.).\n", |
1100 | 1102 | "\n",
|
1101 | 1103 | "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",
|
1102 | 1104 | "\n",
|
|
0 commit comments