📆 Project Period | October, 2023 |
📍 GitHub | gitlab.esa.int |
Example of the aitlas toolbox in the context of benchmarking a dataset
This notebook shows a sample implementation of a multi class image classification using the aitlas toolbox using the UC Merced dataset.
import pandas as pd
import matplotlib.pyplot as plt
from aitlas.datasets import UcMercedDataset
from aitlas.models import VGG16
from aitlas.tasks import StratifiedSplitTask
Define the splits and dataset paths
splits = [(10, 90), (20, 80), (30, 70), (40, 60), (50, 50), (60, 40), (70, 30),
(80, 20), (90, 10)] # one tuple is (train, test)
data_dir = "./media/hdd/multi-class/UCMerced" # where is the dataset on disk
Loop through the splits, train and evaluate
See the results
df = pd.DataFrame(zip(splits, [round(float(r["F1_score Micro"]), 4) for r in results]),
columns=["Train/Test", "Micro F1 score"])
dfdf.plot(x='Train/Test', y='Micro F1 score', kind = 'line')
plt.show()