Skip to content

Table 8 (G3) Data augmentation in supervised setting on other datasets.

import pathlib

import pandas as pd

AUGMENTATIONS_ORDER = [
    "noaug",
    "rotate",
    "horizontalflip",
    "colorjitter",
    "packetloss",
    "timeshift",
    "changertt",
]

RENAME = {
    "noaug": "No augmentation",
    "changertt": "Change RTT",
    "horizontalflip": "Horizontal flip",
    "colorjitter": "Color jitter",
    "packetloss": "Packet loss",
    "rotate": "Rotate",
    "timeshift": "Time shift",
}
def load_summary_report(fname, level0):
    df = pd.read_csv(fname, header=[0, 1], index_col=[0, 1]).droplevel(0, axis=0)
    df = df["f1"]
    df = df[["mean", "ci95"]]
    df = df.loc[AUGMENTATIONS_ORDER].rename(RENAME)
    df.columns = pd.MultiIndex.from_arrays([[level0, level0], df.columns])

    return df
df = pd.concat(
    (
        load_summary_report(
            "campaigns/mirage22/augmentation-at-loading-no-dropout/minpkts10/campaign_summary/augment-at-loading/summary_flowpic_dim_32.csv",
            "mirage22 - minpkts10",
        ),
        load_summary_report(
            "campaigns/mirage22/augmentation-at-loading-no-dropout/minpkts1000/campaign_summary/augment-at-loading/summary_flowpic_dim_32.csv",
            "mirage22 - minpkts1000",
        ),
        load_summary_report(
            "campaigns/utmobilenet21/augmentation-at-loading-no-dropout/minpkts10/campaign_summary/augment-at-loading/summary_flowpic_dim_32.csv",
            "utmobilenet21 - minpkts10",
        ),
        load_summary_report(
            "campaigns/mirage19/augmentation-at-loading-no-dropout/minpkts10/campaign_summary/augment-at-loading/summary_flowpic_dim_32.csv",
            "mirage19 - minpkts10",
        ),
    ),
    axis=1,
)
df = (df * 100).round(2)
display(df)
df.to_csv("table8_augmentation-at-loading_on_other_datasets.csv")
mirage22 - minpkts10 mirage22 - minpkts1000 utmobilenet21 - minpkts10 mirage19 - minpkts10
mean ci95 mean ci95 mean ci95 mean ci95
No augmentation 90.97 1.15 83.35 3.13 79.82 1.53 69.91 1.57
Rotate 88.25 1.20 87.32 2.24 79.45 1.28 60.35 1.17
Horizontal flip 91.90 0.84 83.82 2.26 80.03 1.33 69.78 1.28
Color jitter 89.77 1.16 81.40 3.62 78.68 2.14 67.00 1.11
Packet loss 92.34 1.10 87.19 2.52 72.07 1.73 67.55 1.46
Time shift 92.80 1.21 86.73 3.88 81.91 2.12 70.33 1.26
Change RTT 93.75 0.83 91.48 2.12 81.32 1.54 74.28 1.22