Skip to main content

Cross Validation runs with images from 73 videos

  • We have 43536 images with labels from 73 videos (including Clement Ave video).
  • I created 2 sets of data:
    • 95% training data and 5% test data split
    • 90% training data and 10% test data split
    • from skmultilearn.model_selection import iterative_train_test_split (a special library for multilabel stratified splitting) was used to do the split.
  • The training data were further split into training and validation datasets using from iterstrat.ml_stratifiers import MultilabelStratifiedKFold.
  • Outputs:
    • 10 sets of training and validation data generated from 95/5 split training dataset
    • 10 sets of training and validation data generated from 90/10 split training dataset

Summary Tables

The tables below show the average validation and test F1 normal and average F2 without ND scores of the 10 fold runs. 90/10 split dataset are used for training/validation and testing.

Using weight from previous model

ModelVal F1 normalTest F1 normalVal F2 avg no NDTest F2 avg no ND
Baseline0.9890.9870.9740.971
Image augmentation0.9850.9870.9790.972
Weighted Loss0.9430.9450.9590.940

Train from scratch

ModelVal F1 normalTest F1 normalVal F2 avg no NDTest F2 avg no ND
Baseline0.9750.9700.9490.904
Image augmentation0.9670.9650.9420.910
Weighted Loss0.8330.8390.8830.780

Baseline model

The parameters of the baseline model:

  • Backbone: ResNet50
  • Image argumentation: '[Resize((470, 700),method='squish', pad_mode='zeros')]
  • Batch Size: 32
  • Epoch: 10
  • Metric threshold = 0.5
  • Weight from the previous model is used as an initial weight

90(train-val)/10(test) split

  • Train/Validation Dataset: 90% of 43536 images (73 videos)
  • Test Dataset: 10% of 43536 images (73 videos)
  • Image labelling Method: B (Access database)
nok foldValidation Score (F1 normalTest Score (F1 normalValidation Score (F2 avg no ND)Test Score (F2 avg no ND)
cv_000.9860.9800.9770.971
cv_110.9880.9900.9690.974
cv_220.9910.9850.9710.966
cv_330.9890.9890.9860.971
cv_440.9860.9850.9630.971
cv_550.9900.9880.9740.968
cv_660.9870.9870.9760.972
cv_770.9900.9910.9820.985
cv_880.9900.9870.9750.961
cv_990.9880.9870.9700.971
Average0.9890.9870.9740.971

95(train-val)/5(test) split

  • Train/Validation Dataset: 95% of 43536 images (73 videos)
  • Test Dataset: 5% of 43536 images (73 videos)
  • Image labelling Method: B (Access database)
nok foldValidation Score (F1 normalTest Score (F1 normalValidation Score (F2 avg no ND)Test Score (F2 avg no ND)
cv_1000.9900.9950.9860.960
cv_1110.9860.9930.9560.937
cv_1220.9910.9910.9900.969
cv_1330.9900.9880.9780.957
cv_1440.9900.9920.9690.953
cv_1550.9890.9900.9850.955
cv_1660.9900.9900.9790.964
cv_1770.9900.9910.9780.959
cv_1880.9890.9900.9550.950
cv_1990.9880.9900.9710.950
Average0.9890.9910.9750.955

Image Augmentation

The parameters of the model:

  • Backbone: ResNet50
  • Image argumentation: '[Resize((470, 700),method='squish', pad_mode='zeros')]; [Flip(),Brightness(), Warp(), Rotate()]
  • Batch Size: 32
  • Epoch: 10
  • Metric threshold = 0.5
  • Weight from the previous model is used as an initial weight

90(train-val)/10(test) split

  • Train/Validation Dataset: 90% of 43536 images (73 videos)
  • Test Dataset: 10% of 43536 images (73 videos)
  • Image labelling Method: B (Access database)
noK foldValidation Score (F1 normalTest Score (F1 normalValidation Score (F2 avg no ND)Test Score (F2 avg no ND)
cv_img_000.9850.9810.9780.971
cv_img_110.9770.9870.9670.966
cv_img_220.9810.9870.9740.963
cv_img_330.9930.9880.9890.980
cv_img_440.9870.9880.9820.980
cv_img_550.9830.9890.9770.968
cv_img_660.9830.9890.9780.963
cv_img_770.9910.9890.9870.979
cv_img_880.9840.9880.9770.970
cv_img_990.9860.9880.9810.980
Average0.9850.9870.9790.972

Weighted loss function

The parameters of the model:

  • Backbone: ResNet50
  • Image argumentation: '[Resize((470, 700),method='squish', pad_mode='zeros')]; [Flip(),Brightness(), Warp(), Rotate()]
  • Batch Size: 32
  • Epoch: 10
  • Metric threshold = 0.5
  • Weight from the previous model is used as an initial weight
  • Weighted loss function. The rare labels have bigger weight that the common labels

90(train-val)/10(test) split

noK foldValidation Score (F1 normalTest Score (F1 normalValidation Score (F2 avg no ND)Test Score (F2 avg no ND)
cv_wl_000.94520.9429673230.9570.932
cv_wl_110.94770.94440.9550.946
cv_wl_220.92510.93030.9430.928
cv_wl_330.95330.95350.9790.954
cv_wl_440.93730.93820.9530.928
cv_wl_550.94630.94850.9640.933
cv_wl_660.94930.95540.9600.957
cv_wl_770.94010.94190.9720.952
cv_wl_880.94610.94910.9560.940
cv_wl_990.94280.94610.9510.930
Average0.9430.9450.9590.940

Train from scratch (pretrain=False)

The parameters of the model:

  • Backbone: ResNet50
  • Set pretrain=False (weight of the previous model will not be used)
  • Image argumentation: '[Resize((470, 700),method='squish', pad_mode='zeros')]
  • Batch Size: 32
  • Epoch: 10
  • Metric threshold = 0.5
  • dataset = 90(train-val)/10(test) split
  • Image labelling Method: B (Access database)

Baseline

  • no additional parameters
noK foldValidation Score (F1 normalTest Score (F1 normalValidation Score (F2 avg no ND)Test Score (F2 avg no ND)
cv_nopre_000.9750.9720.9560.922
cv_nopre_110.9730.9700.9300.904
cv_nopre_220.9750.9660.9450.902
cv_nopre_330.9740.9710.9490.910
cv_nopre_440.9760.9680.9480.906
cv_nopre_550.9740.9650.9560.905
cv_nopre_660.9730.9730.9480.897
cv_nopre_770.9770.9700.9650.897
cv_nopre_880.9750.9670.9440.892
cv_nopre_990.9750.9730.9470.908
Average0.9750.9700.9490.904

Image augmentation

  • Image argumentation: '[Resize((470, 700),method='squish', pad_mode='zeros')]; [Flip(),Brightness(), Warp(), Rotate()]
noK foldValidation Score (F1 normalTest Score (F1 normalValidation Score (F2 avg no ND)Test Score (F2 avg no ND)
cv_nopre_img_000.9610.9590.9580.909
cv_nopre_img_110.9700.9660.9400.918
cv_nopre_img_220.9680.9610.9400.909
cv_nopre_img_330.9650.9620.9170.893
cv_nopre_img_440.9650.9610.9440.916
cv_nopre_img_550.9690.9670.9430.925
cv_nopre_img_660.9700.9670.9430.899
cv_nopre_img_770.9710.9700.9640.916
cv_nopre_img_880.9660.9680.9470.899
cv_nopre_img_990.9680.9690.9270.913
Average0.9670.9650.9420.910

Weighted loss function

noK foldValidation Score (F1 normalTest Score (F1 normalValidation Score (F2 avg no ND)Test Score (F2 avg no ND)
cv_nopre_wl_000.8370.8490.9080.809
cv_nopre_wl_110.7920.8000.8640.777
cv_nopre_wl_220.8330.8580.9000.786
cv_nopre_wl_330.8410.8580.8770.796
cv_nopre_wl_440.8530.8680.8810.678
cv_nopre_wl_550.8260.8550.8770.781
cv_nopre_wl_660.8490.8230.8800.780
cv_nopre_wl_770.8400.8530.9010.788
cv_nopre_wl_880.8330.8280.8950.829
cv_nopre_wl_990.8260.8030.8490.774
Average0.8330.8390.8830.780