Code for William J. Pearson's entry to the merger challenge.
The swin_tiny_patch4_window7_224_fe Swin Transformer of Sayak Paul that was pre-trained on the ImageNet-1k dataset was used. A fully-connected layer with 256 neurons is added along with an output later of 1 neuron (binary) or 4 neurons (quad).
- TNG100 training Images are cropped to 128x128 pixels with
split_crop_train.py - Images are split ~80%-20% for training-validation, keeping images from the same merger history in each split
- In the training scripts (
TNG100-swin-transfer-###-cut.py) images are:- Cropped again to 112x112 pixels
- Scaled between 0 and 1
- Stacked with itself to form a 3 channel image
- Scaled to 224 with nearest neighbour
- During training, training images (but not validation images) are:
- Randomly rotated by 90o AND
- Randomly flipped left/right AND
- Randomly flipped up/down
- The binary model with the lowest vaidation loss and the quad model with the lowest validation loss and highest validation accuracy are saved
- TNG100 test, HSC and Horizon-AGN images are cropped to 128x128 with
split_crop_test_TNG100.pyorsplit_crop_train.py(for HSC and Horizon-AGN) - In the test scripts (
TNG100-swin-transfer-###-cut-predict.py) images are:- Cropped again to 112x112 pixels
- Scaled between 0 and 1
- Stacked with itself to form a 3 channel image
- Scaled to 224 with nearest neighbour