Skip to main content

Different Resnet, loss function, and labelling methods

The following runs are used to evaluate which model configuration perform better. The average F1 and F2 scores of the 10 runs are used as the evaluation metric.

The ten runs have different training datasets and testing datasets. The idea of splitting the run into 10 runs is because I want to see how the model configuration performs on different testing dataset. The idea is similar to k-fold cross validation, where each fold has trained on the different training dataset and validated on the different validation datasets. The reason why I train the model this way instead of the actual k-fold cross-validation is that I want to make sure that the testing datasets consist of images that the model has never seen before (images from different videos) since multiple frames from the same video are similar to each other, and those frames can be ended up in testing and validation datasets resulting in a high validation score.

The ten runs are used to evaluate the different model configuration. The actual model for each model configuration is a model trained and validated using the all dataset.

For the model I used in the fine-tuning, I created a new model that used all datasets (including the testing dataset) in training and validation. For the DVN resnet 50 model I used in the fine-tuning with SD1, I created a model using all images from the dataset.

Labels from video vs Labels from access database

  • For image label csv produced base on the video annotation, ~30,000 out of 41,000 of the training dataset were labeled as ND
  • For image label csv produced base on the access database, ~22,000 out of 40,000 of the training dataset were labeled as ND
Run IDF1 normalF1 average (no ND)F2 average (no ND)Labels in test dataset
video annotationaccess databasevideo annotationaccess databasevideo annotationaccess databasevideo annotationaccess database
39/500.96260.95340.55140.59880.53230.5984['ND', 'TB', 'TBA', 'AMH']['ND', 'TB', 'TBA', 'AMH']
40/510.87760.90810.29010.20460.25540.1562['ND', 'TB', 'TBA', 'AMH']['ND', 'DAGS', 'TB', 'TBA', 'AMH']
41/520.97080.95050.12690.46260.11780.4378['ND', 'TB', 'TBB', 'TBA', 'AMH']['ND', 'TB', 'TBA', 'AMH']*
42/5310.9905N/A0.9231N/A0.8824['ND']['ND', 'AMH']
43/540.98810.96380.91360.94860.88360.9256['ND', 'TF', 'TB', 'AMH']['ND', 'TF', 'TB', 'AMH']
44/550.997910.566810.54641['ND', 'TF', 'AMH']['ND', 'TF', 'AMH']
45/560.89380.86930.34420.35580.34850.3411['ND', 'TBA', 'TB', 'AMH', 'RFJ']['ND', 'TBA', 'TB', 'AMH', 'RFJ']
46/570.93610.87370.54510.66190.47830.6309['ND', 'DAGS', 'TB', 'AMH']['ND', 'DAGS', 'TB', 'AMH']
47/580.95760.82330.68410.56580.6510.5627['ND', 'TB', 'DAGS', 'AMH']['ND', 'TB', 'TF', 'TBA', 'DAGS', 'AMH']
48/590.97120.98210.28610.31070.27080.3168['ND', 'TB', 'AMH', 'DAGS', 'TBB', 'SSS', 'TBA']['ND', 'TB', 'AMH', "TBB', 'SSS', 'TBA']**
Average0.955570.931470.47870.603190.4537888890.58519

*ISJ class was removed from test dataset used in RunID 52 because the model did not have ISJ as a class

**SZ class was removed from test dataset used in RunID 59 because the model did not have SZ as a class

Weighted loss function

List of weight assigned for each class

DefectWeigth
'AMH'0.65
    'AOC'8.04
    'BSV'5.15
    'CC'226.74
    'CS'26.36
    'DAE'2.71
    'DAGS'0.14
    'FC'24.12
    'FM'20.99
    'IDJ'19.89
    'IRJ'10.7
    'ISGT'6.26
    'ISJ'377.9
    'JOM'6.37
    'JSM'6.3
    'LD'  5.94
    'LR'6.2
    'MMC'1.96
    'ND'0.05
    'OBB'12.32
    'OBJ'8.52
    'OBN'8.65
    'OBR'8.79
    'RFB'226.74
    'RFJ'5.37
    'RFL'6.63
    'RMB'16.67
    'SAV'14
    'SCP'19.89
    'SRI'5.53
    'SSS'3.8
    'SZ'4.93
    'TB'0.32
    'TBA'2.69
    'TBB'7.61
    'TBI'21.8
    'TF'0.67
    'TFA'4.52
    'TFC'7.18

Weigths assigned to pos_weight parameter of loss function

Run IDF1 normalF1 average (no ND)F2 average (no ND)Label in test dataset
no weighted loss funcweighted loss funcno weighted loss funcweighted loss funcno weighted loss funcweighted loss func
500.9530.7030.5990.4480.5980.389['ND', 'TB', 'TBA', 'AMH']
510.9080.9500.2050.1830.1560.139['ND', 'DAGS', 'TB', 'TBA', 'AMH']
520.9510.8400.4630.4040.438['ND', 'TB', 'TBA', 'AMH']
530.9910.9290.9230.4440.8820.333['ND', 'AMH']
540.9640.9110.9490.7280.9260.676['ND', 'TF', 'TB', 'AMH']
551.0000.9781.0000.6961.0000.643['ND', 'TF', 'AMH']
560.8690.8450.3560.2650.3410.259['ND', 'TBA', 'TB', 'AMH', 'RFJ']
570.8740.7620.6620.5990.6310.523['ND', 'DAGS', 'TB', 'AMH']
580.8230.5990.5660.3660.5630.344['ND', 'TB', 'TF', 'TBA', 'DAGS', 'AMH']
590.9820.3110.317['ND', 'TB', 'AMH', "TBB', 'SSS', 'TBA']
Average0.9310.8350.6030.4590.5850.413

Weigths assigned to weight parameter of loss function

Run IDF1 normalF1 average (no ND)F2 average (no ND)Label in test dataset
no weighted loss funcweighted loss funcno weighted loss funcweighted loss funcno weighted loss funcweighted loss func
500.9530.8080.5990.3250.5980.268['ND', 'TB', 'TBA', 'AMH']
510.9080.5810.2050.0000.1560.000['ND', 'DAGS', 'TB', 'TBA', 'AMH']
520.9510.9310.4630.3640.4380.328['ND', 'TB', 'TBA', 'AMH']
530.9910.7730.9230.8330.8820.758['ND', 'AMH']
540.9640.8200.9490.7340.9260.725['ND', 'TF', 'TB', 'AMH']
551.0000.9971.0000.3301.0000.274['ND', 'TF', 'AMH']
560.8690.8640.3560.3110.3410.306['ND', 'TBA', 'TB', 'AMH', 'RFJ']
570.8740.8540.6620.5000.6310.478['ND', 'DAGS', 'TB', 'AMH']
580.8230.8350.5660.3360.5630.313['ND', 'TB', 'TF', 'TBA', 'DAGS', 'AMH']
590.9820.6810.3110.2620.3170.269['ND', 'TB', 'AMH', "TBB', 'SSS', 'TBA']
Average0.9310.8140.6030.4000.5850.372

Resnet50 vs Resnet101

Train DataImage labelling methodBackboneFine TuneValidation Score (F2 avg no ND)Test Score (F2 avg no ND)Test Dataset
DNV dataset (10 runs)Video’s annotationResnet50-0.940*0.454*2 DNV videos (10 runs)
DNV dataset (10 runs)Video’s annotationResnet101-0.945*0.503*2 DNV videos (10 runs)
DNV dataset (10 runs)Access DatabaseResnet50-0.940*0.585*2 DNV videos (10 runs)
DNV dataset (10 runs)Access DatabaseResnet101-0.910*0.458*2 DNV videos (10 runs)
DNV dataset (all videos)Access DatabaseResnet50SD1 dataset0.7190.85330 SD1 images
DNV dataset (all videos)Access DatabaseResnet101SD1 dataset0.7040.82630 SD1 images
SewerML dataset-Resnet50SD1 dataset30 SD1 images

*These scores are the average F2 score of the 10 runs.