Skip to content
Snippets Groups Projects
Commit dd5d15be authored by Formanek Balázs István's avatar Formanek Balázs István
Browse files

augmentation learning

parent 31ba987e
Branches
No related tags found
No related merge requests found
Showing
with 63563 additions and 602 deletions
figures/confusion_matrix_resnet18_flips.png

34.5 KiB

figures/confusion_matrix_resnet18_flips_180.png

36.1 KiB

figures/confusion_matrix_resnet18_flips_360.png

35.9 KiB

figures/confusion_matrix_resnet18_flips_90.png

36.1 KiB

figures/learning_curves_resnet18_flips.png

75.8 KiB

figures/learning_curves_resnet18_flips_180.png

71.7 KiB

figures/learning_curves_resnet18_flips_360.png

75.4 KiB

figures/learning_curves_resnet18_flips_90.png

73.2 KiB

Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
Source diff could not be displayed: it is too large. Options to address this: view the blob.
...@@ -59,13 +59,14 @@ def get_transform(use_hflip, use_vflip, rotation, contrast, resample): ...@@ -59,13 +59,14 @@ def get_transform(use_hflip, use_vflip, rotation, contrast, resample):
if use_vflip: if use_vflip:
transform_list.append(transforms.RandomVerticalFlip()) transform_list.append(transforms.RandomVerticalFlip())
# rotation # rotation
transform_list.append(transforms.RandomRotation(degrees=rotation)) transform_list.append(transforms.RandomRotation(degrees=rotation, expand=True)) # expand=True: esnure that the whole image is represented on the rotated image
# contrast # contrast
if contrast > 0: if contrast > 0:
transform_list.append(v2.ColorJitter(contrast=contrast)) transform_list.append(v2.ColorJitter(contrast=contrast))
# resample # resample
if resample != 1: if resample != 1:
transform_list.append(RandomResample(scale_factor=resample)) transform_list.append(RandomResample(scale_factor=resample))
transform_list.append(transforms.Resize(224))
transform_list.append(transforms.ToTensor()) transform_list.append(transforms.ToTensor())
return transforms.Compose(transform_list) return transforms.Compose(transform_list)
......
...@@ -182,4 +182,63 @@ transforms.ToTensor() ...@@ -182,4 +182,63 @@ transforms.ToTensor()
balanced accuracy: 98.77% balanced accuracy: 98.77%
size: 43MB size: 43MB
checkpoints: /net/travail/bformanek/checkpoints/transfer_checkpoints_resnet18_augmentation4 checkpoints: /net/travail/bformanek/checkpoints/transfer_checkpoints_resnet18_augmentation4
note: as expected: much better results, but the learning curves still show overfitting note: as expected: much better results, but the learning curves still show overfitting
\ No newline at end of file
augmentation using horizontal and vertical flips:
MODEL_NAME = 'resnet18_flips'
transforms.v2.RandomHorizontalFlip(p=0.5),
transforms.v2.RandomVerticalFlip(p=0.5),
transforms.ToTensor()
time: 20 min 16 sec
Best epoch: 22
validation accuracy: 0.9294
validation loss: 1.9463
test accuracy: 98.71%
balanced accuracy: 98.73%
size: 43MB
checkpoints: /net/travail/bformanek/checkpoints/transfer_checkpoints_resnet18_flips
augmentation using horizontal, vertical flips and 90 degrees random rotation:
MODEL_NAME = 'resnet18_flips_90'
transforms.v2.RandomHorizontalFlip(p=0.5),
transforms.v2.RandomVerticalFlip(p=0.5),
transforms.v2.RandomRotation(degrees=90, expand=True),
transforms.ToTensor()
time: 20 min 19 sec
Best epoch: 13
validation accuracy: 89.24%
validation loss: 1.8287
test accuracy: 93.27%
balanced accuracy: 95.00%
size: 43
checkpoints: /net/travail/bformanek/checkpoints/transfer_checkpoints_resnet18_flips_90
augmentation using horizontal, vertical flips and 180 degrees random rotation:
MODEL_NAME = 'resnet18_flips_180'
transforms.v2.RandomHorizontalFlip(p=0.5),
transforms.v2.RandomVerticalFlip(p=0.5),
transforms.v2.RandomRotation(degrees=180, expand=True),
transforms.ToTensor()
time: 20 min 12 sec
Best epoch: 22
validation accuracy: 1.7595
validation loss: 90.17%
test accuracy: 95.95%
balanced accuracy: 95.60%
size: 43
checkpoints: /net/travail/bformanek/checkpoints/transfer_checkpoints_resnet18_flips_180
augmentation using horizontal, vertical flips and 360 degrees random rotation:
MODEL_NAME = 'resnet18_flips_360'
transforms.v2.RandomHorizontalFlip(p=0.5),
transforms.v2.RandomVerticalFlip(p=0.5),
transforms.v2.RandomRotation(degrees=360, expand=True),
transforms.ToTensor()
time: 20 min 12 sec
Best epoch: 22
validation accuracy: 1.8767
validation loss: 90.58%
test accuracy: 95.13%
balanced accuracy: 95.60%
size: 43
checkpoints: /net/travail/bformanek/checkpoints/transfer_checkpoints_resnet18_flips_360
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment