{ "cells": [ { "cell_type": "markdown", "id": "a5771c9d-00fb-4cc1-b3eb-6c337a5d9c42", "metadata": {}, "source": [ "# Table 8 (G3) Data augmentation in supervised setting on other datasets." ] }, { "cell_type": "markdown", "id": "c72f5bca-50a5-4462-bc85-de6d24e5af07", "metadata": {}, "source": [ "[:simple-jupyter: :material-download:](/papers/imc23/notebooks/table8_augmentation-at-loading_on_other_datasets.ipynb)" ] }, { "cell_type": "code", "execution_count": 4, "id": "ce97119d-6daf-471a-8fe5-89f91f1c0d16", "metadata": { "execution": { "iopub.execute_input": "2023-09-08T10:57:49.811633Z", "iopub.status.busy": "2023-09-08T10:57:49.811258Z", "iopub.status.idle": "2023-09-08T10:57:49.817063Z", "shell.execute_reply": "2023-09-08T10:57:49.816320Z", "shell.execute_reply.started": "2023-09-08T10:57:49.811603Z" } }, "outputs": [], "source": [ "import pathlib\n", "\n", "import pandas as pd\n", "\n", "AUGMENTATIONS_ORDER = [\n", " \"noaug\",\n", " \"rotate\",\n", " \"horizontalflip\",\n", " \"colorjitter\",\n", " \"packetloss\",\n", " \"timeshift\",\n", " \"changertt\",\n", "]\n", "\n", "RENAME = {\n", " \"noaug\": \"No augmentation\",\n", " \"changertt\": \"Change RTT\",\n", " \"horizontalflip\": \"Horizontal flip\",\n", " \"colorjitter\": \"Color jitter\",\n", " \"packetloss\": \"Packet loss\",\n", " \"rotate\": \"Rotate\",\n", " \"timeshift\": \"Time shift\",\n", "}" ] }, { "cell_type": "code", "execution_count": 5, "id": "40fa5860-bd65-43e3-946b-23e9cbab046a", "metadata": { "execution": { "iopub.execute_input": "2023-09-08T10:57:50.136218Z", "iopub.status.busy": "2023-09-08T10:57:50.135902Z", "iopub.status.idle": "2023-09-08T10:57:50.141960Z", "shell.execute_reply": "2023-09-08T10:57:50.141249Z", "shell.execute_reply.started": "2023-09-08T10:57:50.136190Z" } }, "outputs": [], "source": [ "def load_summary_report(fname, level0):\n", " df = pd.read_csv(fname, header=[0, 1], index_col=[0, 1]).droplevel(0, axis=0)\n", " df = df[\"f1\"]\n", " df = df[[\"mean\", \"ci95\"]]\n", " df = df.loc[AUGMENTATIONS_ORDER].rename(RENAME)\n", " df.columns = pd.MultiIndex.from_arrays([[level0, level0], df.columns])\n", "\n", " return df" ] }, { "cell_type": "code", "execution_count": 6, "id": "ba32618c-3f2e-4b2b-8d72-c33211e4bd35", "metadata": { "execution": { "iopub.execute_input": "2023-09-08T10:57:50.864426Z", "iopub.status.busy": "2023-09-08T10:57:50.864111Z", "iopub.status.idle": "2023-09-08T10:57:50.931004Z", "shell.execute_reply": "2023-09-08T10:57:50.930252Z", "shell.execute_reply.started": "2023-09-08T10:57:50.864399Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
mirage22 - minpkts10mirage22 - minpkts1000utmobilenet21 - minpkts10mirage19 - minpkts10
meanci95meanci95meanci95meanci95
No augmentation90.971.1583.353.1379.821.5369.911.57
Rotate88.251.2087.322.2479.451.2860.351.17
Horizontal flip91.900.8483.822.2680.031.3369.781.28
Color jitter89.771.1681.403.6278.682.1467.001.11
Packet loss92.341.1087.192.5272.071.7367.551.46
Time shift92.801.2186.733.8881.912.1270.331.26
Change RTT93.750.8391.482.1281.321.5474.281.22
\n", "
" ], "text/plain": [ " mirage22 - minpkts10 mirage22 - minpkts1000 \\\n", " mean ci95 mean ci95 \n", "No augmentation 90.97 1.15 83.35 3.13 \n", "Rotate 88.25 1.20 87.32 2.24 \n", "Horizontal flip 91.90 0.84 83.82 2.26 \n", "Color jitter 89.77 1.16 81.40 3.62 \n", "Packet loss 92.34 1.10 87.19 2.52 \n", "Time shift 92.80 1.21 86.73 3.88 \n", "Change RTT 93.75 0.83 91.48 2.12 \n", "\n", " utmobilenet21 - minpkts10 mirage19 - minpkts10 \n", " mean ci95 mean ci95 \n", "No augmentation 79.82 1.53 69.91 1.57 \n", "Rotate 79.45 1.28 60.35 1.17 \n", "Horizontal flip 80.03 1.33 69.78 1.28 \n", "Color jitter 78.68 2.14 67.00 1.11 \n", "Packet loss 72.07 1.73 67.55 1.46 \n", "Time shift 81.91 2.12 70.33 1.26 \n", "Change RTT 81.32 1.54 74.28 1.22 " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df = pd.concat(\n", " (\n", " load_summary_report(\n", " \"campaigns/mirage22/augmentation-at-loading-no-dropout/minpkts10/campaign_summary/augment-at-loading/summary_flowpic_dim_32.csv\",\n", " \"mirage22 - minpkts10\",\n", " ),\n", " load_summary_report(\n", " \"campaigns/mirage22/augmentation-at-loading-no-dropout/minpkts1000/campaign_summary/augment-at-loading/summary_flowpic_dim_32.csv\",\n", " \"mirage22 - minpkts1000\",\n", " ),\n", " load_summary_report(\n", " \"campaigns/utmobilenet21/augmentation-at-loading-no-dropout/minpkts10/campaign_summary/augment-at-loading/summary_flowpic_dim_32.csv\",\n", " \"utmobilenet21 - minpkts10\",\n", " ),\n", " load_summary_report(\n", " \"campaigns/mirage19/augmentation-at-loading-no-dropout/minpkts10/campaign_summary/augment-at-loading/summary_flowpic_dim_32.csv\",\n", " \"mirage19 - minpkts10\",\n", " ),\n", " ),\n", " axis=1,\n", ")\n", "df = (df * 100).round(2)\n", "display(df)\n", "df.to_csv(\"table8_augmentation-at-loading_on_other_datasets.csv\")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.11" } }, "nbformat": 4, "nbformat_minor": 5 }