├── backend ├── __init__.py ├── utils.py ├── metrics.py ├── callbacks.py ├── config.py ├── data_loader.py └── pipeline.py ├── CITATION.cff ├── .gitignore ├── config.json ├── models ├── r2u_net.py ├── resunet.py ├── vnet.py ├── psp_net.py ├── fpn.py ├── link_net.py ├── unet_plus.py ├── swin_unet.py ├── att_unet.py ├── u2net.py ├── unet_3_plus.py ├── transunet.py ├── unet_kuc.py ├── __init__.py ├── deeplab.py ├── unet.py ├── mc_wbdn_resnet50.py ├── layers.py ├── losses.py ├── utils.py └── mc_wbdn.py ├── LICENSE ├── README.md ├── main.py └── batches ├── tiles.json ├── transplanted_tiles_5_timestamp_1.json ├── transplanted_tiles_5_timestamp_2.json ├── transplanted_tiles_5_timestamp_3.json ├── transplanted_tiles_10_timestamp_1.json ├── transplanted_tiles_10_timestamp_2.json ├── transplanted_tiles_10_timestamp_3.json ├── transplanted_tiles_15_timestamp_1.json ├── transplanted_tiles_15_timestamp_2.json ├── transplanted_tiles_15_timestamp_3.json ├── transplanted_tiles_20_timestamp_1.json ├── transplanted_tiles_20_timestamp_2.json └── transplanted_tiles_20_timestamp_3.json /backend/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | message: "If you use this software, please cite it as below." 3 | authors: 4 | - family-names: "Billson" 5 | given-names: "JoshuaE" 6 | title: "Waterbody-Detection-Via-Deep-Learning" 7 | version: 1.0.0 8 | date-released: 2022-08-04 9 | url: "https://github.com/JoshuaBillson/Waterbody-Detection-Via-Deep-Learning" 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea 3 | images 4 | data 5 | __pycache__ 6 | logs 7 | checkpoints 8 | predictions/ 9 | predictions/* 10 | validation/ 11 | test/ 12 | old_data/ 13 | experiments 14 | remove_experiment.py 15 | resample.py 16 | compare_decision_boundaries.py 17 | compare_models.py 18 | demonstrate_pct.py 19 | evaluate_models.py 20 | plot_learning_curves.py 21 | waterbody-data.tar.gz 22 | scripts/ 23 | 24 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "timestamp": 3, 3 | "patch_size": 512, 4 | "experiment_tag": "waterbody_transfer_15_timestamp_3", 5 | "create_logs": true, 6 | "train": true, 7 | "test": true, 8 | "experiments": 1, 9 | "use_mixed_precision": true, 10 | "hyperparameters": { 11 | "model": "r2_unet", 12 | "bands": ["RGB", "NIR", "SWIR"], 13 | "backbone": null, 14 | "learning_rate": 0.00005, 15 | "fusion_head": "naive", 16 | "loss": "jaccard_bce", 17 | "batch_size": 2, 18 | "epochs": 50, 19 | "apply_transfer": true, 20 | "random_subsample": true, 21 | "water_threshold": 15 22 | } 23 | } -------------------------------------------------------------------------------- /models/r2u_net.py: -------------------------------------------------------------------------------- 1 | from keras_unet_collection.models import r2_unet_2d 2 | from models.utils import assemble_model 3 | from backend.config import get_input_channels 4 | 5 | 6 | def r2_unet(config): 7 | """ 8 | Construct an R2U-Net model that takes the input bands and uses the backbone specified in the config 9 | :param config: The model configuration 10 | :return: The assembled R2U-Net model 11 | """ 12 | # Construct Base Model 13 | model = r2_unet_2d((config['patch_size'], config['patch_size'], get_input_channels(config)), [64, 128, 256, 512], n_labels=1, 14 | stack_num_down=2, stack_num_up=1, recur_num=2, activation='ReLU', output_activation='Sigmoid', 15 | batch_norm=True, pool='max', unpool='nearest', name='r2unet') 16 | model.summary() 17 | 18 | # Replace Input And Output Layers 19 | return assemble_model(model, config) 20 | -------------------------------------------------------------------------------- /models/resunet.py: -------------------------------------------------------------------------------- 1 | from keras_unet_collection.models import resunet_a_2d 2 | from models.utils import assemble_model 3 | from backend.config import get_input_channels 4 | 5 | 6 | def resunet(config): 7 | """ 8 | Construct a ResUNet model that takes the input bands and uses the backbone specified in the config 9 | :param config: The model configuration 10 | :return: The assembled ResUNet model 11 | """ 12 | # Construct Base Model 13 | model = resunet_a_2d((config['patch_size'], config['patch_size'], get_input_channels(config)), [32, 64, 128, 256, 512], 14 | dilation_num=[1, 3, 15, 31], n_labels=1, aspp_num_down=256, aspp_num_up=128, activation='ReLU', 15 | output_activation='Sigmoid', batch_norm=True, pool=False, unpool='nearest', name='resunet') 16 | model.summary() 17 | 18 | # Replace Input And Output Layers 19 | return assemble_model(model, config) 20 | -------------------------------------------------------------------------------- /models/vnet.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | from tensorflow.keras.models import Model 3 | from keras_unet_collection.models import vnet_2d 4 | from backend.config import get_input_channels 5 | from models.utils import assemble_model 6 | 7 | 8 | def vnet(config: Dict[str, Any]) -> Model: 9 | """ 10 | Construct a V-Net model that takes the input bands and uses the backbone specified in the config 11 | :param config: The model configuration 12 | :return: The assembled V-Net model 13 | """ 14 | # Construct Base Model 15 | model = vnet_2d((config["patch_size"], config['patch_size'], get_input_channels(config)), filter_num=[32, 64, 128, 256, 512], 16 | n_labels=1, res_num_ini=1, res_num_max=3, activation='PReLU', output_activation='Sigmoid', 17 | batch_norm=True, pool=False, unpool=False, name='vnet') 18 | model.summary() 19 | 20 | # Replace Input And Output Layers 21 | return assemble_model(model, config) 22 | -------------------------------------------------------------------------------- /models/psp_net.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | from tensorflow.keras.models import Model 3 | from segmentation_models import Linknet 4 | from backend.config import get_model_config 5 | from models.utils import assemble_model 6 | 7 | 8 | def psp_net(config: Dict[str, Any]) -> Model: 9 | """ 10 | Construct a V-Net model that takes the input bands and uses the backbone specified in the config 11 | :param config: The model configuration 12 | :return: The assembled V-Net model 13 | """ 14 | # Get Backbone And Input Channels 15 | _, backbone = get_model_config(config) 16 | 17 | # Construct Base Model 18 | backbone = backbone if backbone is not None else "efficientnetb0" 19 | model = Linknet(backbone_name=None, input_shape=(config["patch_size"], config['patch_size'], 1), classes=1, activation='sigmoid', encoder_weights=None, weights=None) 20 | model.summary() 21 | 22 | # Replace Input And Output Layers 23 | return assemble_model(model, config) 24 | -------------------------------------------------------------------------------- /models/fpn.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | from tensorflow.keras.models import Model 3 | from segmentation_models import FPN 4 | from backend.config import get_model_config 5 | from models.utils import assemble_model 6 | 7 | 8 | def fpn(config: Dict[str, Any]) -> Model: 9 | """ 10 | Construct a V-Net model that takes the input bands and uses the backbone specified in the config 11 | :param config: The model configuration 12 | :return: The assembled V-Net model 13 | """ 14 | # Get Backbone And Input Channels 15 | input_channels, backbone = get_model_config(config) 16 | 17 | # Construct Base Model 18 | backbone = backbone if backbone is not None else "efficientnetb0" 19 | model = FPN(backbone_name=backbone, input_shape=(config["patch_size"], config['patch_size'], input_channels), classes=1, activation='sigmoid', encoder_weights=None, weights=None) 20 | model.summary() 21 | 22 | # Replace Input And Output Layers 23 | return assemble_model(model, config) 24 | -------------------------------------------------------------------------------- /models/link_net.py: -------------------------------------------------------------------------------- 1 | 2 | from typing import Dict, Any 3 | from tensorflow.keras.models import Model 4 | from segmentation_models import Linknet 5 | from backend.config import get_model_config 6 | from models.utils import assemble_model 7 | 8 | 9 | def link_net(config: Dict[str, Any]) -> Model: 10 | """ 11 | Construct a V-Net model that takes the input bands and uses the backbone specified in the config 12 | :param config: The model configuration 13 | :return: The assembled V-Net model 14 | """ 15 | # Get Backbone And Input Channels 16 | channels, backbone = get_model_config(config) 17 | 18 | # Construct Base Model 19 | backbone = backbone if backbone is not None else "efficientnetb0" 20 | model = Linknet(backbone_name=backbone, input_shape=(config["patch_size"], config['patch_size'], channels), classes=1, activation='sigmoid', encoder_weights=None, weights=None) 21 | model.summary() 22 | 23 | # Replace Input And Output Layers 24 | return assemble_model(model, config) 25 | -------------------------------------------------------------------------------- /models/unet_plus.py: -------------------------------------------------------------------------------- 1 | from keras_unet_collection.models import unet_plus_2d 2 | from models.utils import assemble_model 3 | from backend.config import get_model_config 4 | 5 | 6 | def unet_plus(config): 7 | """ 8 | Construct a U-Net++ model that takes the input bands and uses the backbone specified in the config 9 | :param config: The model configuration 10 | :return: The assembled U-Net++ model 11 | """ 12 | # Get Backbone And Input Channels 13 | input_channels, backbone = get_model_config(config) 14 | 15 | # Construct Base Model 16 | model = unet_plus_2d((config['patch_size'], config['patch_size'], input_channels), [64, 128, 256, 512, 1024], 17 | n_labels=1, stack_num_down=2, stack_num_up=1, activation='ReLU', output_activation='Sigmoid', 18 | batch_norm=True, pool='max', unpool='nearest', name='unet_plus', backbone=backbone, freeze_backbone=False) 19 | model.summary() 20 | 21 | # Replace Input And Output Layers 22 | return assemble_model(model, config) 23 | -------------------------------------------------------------------------------- /models/swin_unet.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | from keras_unet_collection.models import swin_unet_2d 3 | from tensorflow.keras.models import Model 4 | from models.utils import assemble_model 5 | from backend.config import get_input_channels 6 | 7 | 8 | def swin_unet(config: Dict[str, Any]) -> Model: 9 | """ 10 | Construct a Swin-UNet model that takes the input bands and uses the backbone specified in the config 11 | :param config: The model configuration 12 | :return: The assembled Swin-UNet model 13 | """ 14 | # Construct Base Model 15 | model = swin_unet_2d((config['patch_size'], config['patch_size'], get_input_channels(config)), filter_num_begin=64, n_labels=1, depth=4, 16 | stack_num_down=2, stack_num_up=2, patch_size=(2, 2), num_heads=[4, 8, 8, 8], window_size=[4, 2, 2, 2], 17 | num_mlp=512, output_activation='Sigmoid', shift_window=True, name='swin_unet') 18 | model.summary() 19 | 20 | # Replace Input And Output Layers 21 | return assemble_model(model, config) 22 | -------------------------------------------------------------------------------- /models/att_unet.py: -------------------------------------------------------------------------------- 1 | from keras_unet_collection.models import att_unet_2d 2 | from backend.config import get_model_config 3 | from models.utils import assemble_model 4 | 5 | 6 | def att_unet(config): 7 | """ 8 | Construct an Attention U-Net model that takes the input bands and uses the backbone specified in the config 9 | :param config: The model configuration 10 | :return: The assembled Attention U-Net model 11 | """ 12 | # Get Backbone And Input Channels 13 | channels, backbone = get_model_config(config) 14 | 15 | # Construct Base Model 16 | model = att_unet_2d((config['patch_size'], config['patch_size'], channels), [64, 128, 256, 512], n_labels=1, stack_num_down=2, 17 | stack_num_up=2, activation='ReLU', atten_activation='ReLU', attention='add', output_activation="Sigmoid", 18 | batch_norm=True, pool=False, unpool='bilinear', name='attunet', backbone=backbone) 19 | model.summary() 20 | 21 | # Replace Input And Output Layers 22 | return assemble_model(model, config) 23 | -------------------------------------------------------------------------------- /models/u2net.py: -------------------------------------------------------------------------------- 1 | from keras_unet_collection.models import u2net_2d 2 | from models.utils import assemble_model 3 | from backend.config import get_model_config 4 | 5 | 6 | def u2net(config): 7 | """ 8 | Construct a U2-Net model that takes the input bands and uses the backbone specified in the config 9 | :param config: The model configuration 10 | :return: The assembled U2-Net model 11 | """ 12 | # Construct Base Model 13 | channels, _ = get_model_config(config) 14 | model = u2net_2d((config['patch_size'], config['patch_size'], channels), n_labels=1, filter_num_down=[64, 128, 256, 512], 15 | filter_num_up=[64, 64, 128, 256], filter_mid_num_down=[32, 32, 64, 128], filter_mid_num_up=[16, 32, 64, 128], 16 | filter_4f_num=[512, 512], filter_4f_mid_num=[256, 256], activation='ReLU', output_activation='Sigmoid', 17 | batch_norm=True, pool=False, unpool=False, deep_supervision=True, name='u2net') 18 | model.summary() 19 | 20 | # Replace Input And Output Layers 21 | return assemble_model(model, config) 22 | -------------------------------------------------------------------------------- /models/unet_3_plus.py: -------------------------------------------------------------------------------- 1 | from keras_unet_collection.models import unet_3plus_2d 2 | from models.utils import assemble_model 3 | from backend.config import get_model_config 4 | 5 | 6 | def unet_3_plus(config): 7 | """ 8 | Construct a U-Net 3+ model that takes the input bands and uses the backbone specified in the config 9 | :param config: The model configuration 10 | :return: The assembled U-Net 3+ model 11 | """ 12 | # Get Backbone And Input Channels 13 | channels, backbone = get_model_config(config) 14 | 15 | # Construct Base Model 16 | model = unet_3plus_2d((config['patch_size'], config['patch_size'], channels), n_labels=1, 17 | filter_num_down=[64, 128, 256, 512], filter_num_skip='auto', filter_num_aggregate='auto', 18 | stack_num_down=2, stack_num_up=1, activation='ReLU', output_activation='Sigmoid', batch_norm=True, 19 | pool='max', unpool=False, deep_supervision=True, name='unet3plus', backbone=backbone) 20 | model.summary() 21 | 22 | # Replace Input And Output Layers 23 | return assemble_model(model, config) 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 JoshuaBillson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /models/transunet.py: -------------------------------------------------------------------------------- 1 | from keras_unet_collection.models import transunet_2d 2 | from models.utils import assemble_model 3 | from backend.config import get_model_config 4 | 5 | 6 | def transunet(config): 7 | """ 8 | Construct a TransUNet model that takes the input bands and uses the backbone specified in the config 9 | :param config: The model configuration 10 | :return: The assembled TransUNet model 11 | """ 12 | # Get Backbone And Input Channels 13 | input_channels, backbone = get_model_config(config) 14 | 15 | # Construct Base Model 16 | model = transunet_2d((config['patch_size'], config['patch_size'], input_channels), filter_num=[64, 128, 256, 512], n_labels=1, 17 | stack_num_down=2, stack_num_up=2, embed_dim=768, num_mlp=3072, num_heads=12, num_transformer=12, 18 | activation='ReLU', mlp_activation='GELU', output_activation='Softmax', batch_norm=True, pool=True, 19 | unpool='bilinear', name='transunet', backbone=backbone) 20 | model.summary() 21 | 22 | # Replace Input And Output Layers 23 | return assemble_model(model, config) 24 | -------------------------------------------------------------------------------- /backend/utils.py: -------------------------------------------------------------------------------- 1 | import math 2 | import numpy as np 3 | from cv2 import normalize, NORM_MINMAX, CV_8U, LUT, cvtColor, COLOR_BGR2GRAY 4 | 5 | 6 | def adjust_rgb(rgb_img: np.ndarray, gamma: float = 0.45) -> np.ndarray: 7 | return adjust_gamma(normalize(rgb_img, None, 0, 255, NORM_MINMAX, dtype=CV_8U), gamma) 8 | 9 | 10 | def compute_gamma_correction(img): 11 | # convert img to gray 12 | gray = cvtColor(img, COLOR_BGR2GRAY) 13 | 14 | # compute gamma = log(mid*255)/log(mean) 15 | mid = 0.5 16 | mean = np.mean(gray) 17 | gamma = math.log(mid*255)/math.log(mean) 18 | return gamma 19 | 20 | 21 | def adjust_gamma(image: np.ndarray, gamma: float = 1.0): 22 | """ 23 | Perform gamma correction on the provided image 24 | :param image: The image to which we want to apply gamme correction 25 | :param gamma: The ammount of gamma correction to apply 26 | :returns: The gamma corrected image 27 | """ 28 | 29 | gamma = compute_gamma_correction(image) if gamma == 1.0 else 1.0 30 | invGamma = (1 / gamma) + 0.2 31 | table = np.array([((i / 255.0) * invGamma) * 255 for i in np.arange(0, 256)]).astype("uint8") 32 | return LUT(image, table) 33 | -------------------------------------------------------------------------------- /models/unet_kuc.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any 2 | from tensorflow.keras.models import Model 3 | from keras_unet_collection.models import unet_2d 4 | from models.utils import assemble_model 5 | from backend.config import get_model_config 6 | 7 | 8 | def unet_deep(config: Dict[str, Any]) -> Model: 9 | """ 10 | Construct a U-Net model that takes the input bands and uses the backbone specified in the config 11 | :param config: The model configuration 12 | :return: The assembled U-Net model 13 | """ 14 | # Get Backbone And Input Channels 15 | input_channels, backbone = get_model_config(config) 16 | 17 | # Construct Base Model 18 | model = unet_2d(input_size=(config["patch_size"], config["patch_size"], input_channels), filter_num=[64, 128, 256, 512, 1024, 2048], n_labels=1, backbone=backbone, batch_norm=True) 19 | model.summary() 20 | 21 | # Replace Input And Output Layers 22 | return assemble_model(model, config) 23 | 24 | 25 | def unet(config: Dict[str, Any]) -> Model: 26 | """ 27 | Construct a regulard model that takes the input bands and uses the backbone specified in the config 28 | :param config: The model configuration 29 | :return: The assembled U-Net model 30 | """ 31 | # Get Backbone And Input Channels 32 | input_channels, backbone = get_model_config(config) 33 | 34 | # Construct Base Model 35 | model = unet_2d(input_size=(config["patch_size"], config["patch_size"], input_channels), filter_num=[64, 128, 256, 512, 1024], n_labels=1, backbone=backbone, batch_norm=True) 36 | model.summary() 37 | 38 | # Replace Input And Output Layers 39 | return assemble_model(model, config) 40 | -------------------------------------------------------------------------------- /models/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | from typing import Dict, Any 3 | from tensorflow.keras.models import Model 4 | from models.vnet import vnet 5 | from models.unet_plus import unet_plus 6 | from models.unet_3_plus import unet_3_plus 7 | from models.r2u_net import r2_unet 8 | from models.resunet import resunet 9 | from models.u2net import u2net 10 | from models.transunet import transunet 11 | from models.swin_unet import swin_unet 12 | from models.att_unet import att_unet 13 | from models.fpn import fpn 14 | from models.link_net import link_net 15 | from models.psp_net import psp_net 16 | from models.deeplab import DeeplabV3Plus, DeeplabV3PlusImageNet 17 | from models.mc_wbdn import mc_wbdn 18 | # from models.unet_kuc import unet_deep, unet 19 | from models.mc_wbdn_resnet50 import MC_WBDN_ResNet50 20 | from models.unet import Unet, DeepUnet 21 | from backend.config import get_model_type 22 | 23 | 24 | def get_model(config: Dict[str, Any]) -> Model: 25 | """ 26 | Takes the project configuration and returns the desired model 27 | :param config: A dictionary representing the project config which is typically loaded from an external file 28 | :returns: The model we want to train 29 | """ 30 | model = get_model_type(config) 31 | models = {"unet": Unet, 32 | "unet_deep": DeepUnet, 33 | "vnet": vnet, 34 | "unet_plus": unet_plus, 35 | "unet_3_plus": unet_3_plus, 36 | "r2_unet": r2_unet, 37 | "resunet": resunet, 38 | "u2net": u2net, 39 | "transunet": transunet, 40 | "swin_unet": swin_unet, 41 | "att_unet": att_unet, 42 | "fpn": fpn, 43 | "psp_net": psp_net, 44 | "link_net": link_net, 45 | "deeplab": DeeplabV3Plus, 46 | "deeplab_imagenet": DeeplabV3PlusImageNet, 47 | "mc_wbdn": mc_wbdn, 48 | "mc_wbdn_resnet50": MC_WBDN_ResNet50, 49 | } 50 | if model in os.listdir("checkpoints"): 51 | print(model) 52 | base_model: Model = models[model.split(".")[0]](config) 53 | base_model.load_weights(f"checkpoints/{model}/{model}") 54 | return base_model 55 | elif model in models: 56 | return models[model](config) 57 | raise ValueError(f"Error: Invalid Model Received (Must Be One Of {list(models.keys())})!") 58 | -------------------------------------------------------------------------------- /backend/metrics.py: -------------------------------------------------------------------------------- 1 | import tensorflow as tf 2 | from tensorflow.keras.backend import flatten 3 | 4 | 5 | def tf_round(x, decimals = 0): 6 | multiplier = tf.constant(10**decimals, dtype=x.dtype) 7 | return tf.round(x * multiplier) / multiplier 8 | 9 | 10 | def MIOU(decision_boundary=0.5): 11 | m = tf.keras.metrics.MeanIoU(num_classes=2) 12 | def MIoU(y_true, y_pred): 13 | m.reset_states() 14 | y_true, y_pred = y_true, tf.where(y_pred >= decision_boundary, 1.1, 0.0) 15 | _ = m.update_state(y_true, y_pred) 16 | return m.result() 17 | return MIoU 18 | 19 | 20 | def CombinedMIoU(y_true, y_pred): 21 | """Compute Mean Intersection Over Union For A Single Channel Binary Prediction Mask""" 22 | y_true, y_pred = flatten(y_true), flatten(tf.where(y_pred >= 0.5, 1.0, 0.0)) 23 | water_MIoU = MIoU2(y_true, y_pred) 24 | background_MIoU = MIoU2(tf.where(y_true == 0, 1.0, 0.0), tf.ones_like(y_pred) - y_pred) 25 | return tf_round((water_MIoU + background_MIoU) / tf.constant(2.0), decimals=3) 26 | 27 | 28 | #def MIoU(y_true, y_pred): 29 | # """Compute Mean Intersection Over Union For A Single Channel Binary Prediction Mask""" 30 | # y_true, y_pred = flatten(y_true), flatten(tf.where(y_pred >= 0.5, 1.0, 0.0)) 31 | # smoothing = tf.keras.backend.constant(0.000001) # Prevents Division By Zero 32 | # total_positives = tf.keras.backend.sum(y_pred) 33 | #true_positives = tf.keras.backend.sum(y_true * y_pred) 34 | #false_positives = total_positives - true_positives 35 | #false_negatives = tf.keras.backend.sum(y_true * tf.where(y_pred == 0, 1.0, 0.0)) 36 | #return tf_round(true_positives / (true_positives + false_positives + false_negatives + smoothing), decimals=3) 37 | 38 | 39 | def MIoU2(y_true, y_pred): 40 | """Compute Mean Intersection Over Union For A Single Channel Binary Prediction Mask""" 41 | y_true, y_pred = flatten(y_true), flatten(tf.where(y_pred >= 0.5, 1.0, 0.0)) 42 | total_positives = tf.keras.backend.sum(y_pred) 43 | true_positives = tf.math.maximum(tf.keras.backend.sum(y_true * y_pred), tf.keras.backend.constant(0.000001)) 44 | false_positives = tf.math.maximum(total_positives - true_positives, tf.keras.backend.constant(0.0)) 45 | false_negatives = tf.keras.backend.sum(y_true * tf.where(y_pred == 0, 1.0, 0.0)) 46 | return tf_round(true_positives / (true_positives + false_positives + false_negatives), decimals=3) 47 | -------------------------------------------------------------------------------- /backend/callbacks.py: -------------------------------------------------------------------------------- 1 | import math 2 | import os 3 | from typing import Dict, Any, List 4 | from tensorflow.keras.models import Model 5 | from tensorflow.keras.callbacks import TensorBoard, CSVLogger, ModelCheckpoint, Callback, LearningRateScheduler, EarlyStopping 6 | from backend.pipeline import ImgSequence 7 | from backend.config import get_create_logs 8 | 9 | 10 | class PredictionCallback(Callback): 11 | def __init__(self, val_data: ImgSequence, model: Model): 12 | super().__init__() 13 | self.val_data = val_data 14 | self.model = model 15 | 16 | def on_epoch_end(self, epoch, logs=None): 17 | """ 18 | Call after every epoch to predict mask 19 | :param epoch: Current epoch 20 | :returns: Nothing 21 | """ 22 | if epoch % 5 == 0 and epoch != 0: 23 | self.val_data.predict_batch(self.model, "validation") 24 | 25 | 26 | def lr_scheduler(epoch, learning_rate): 27 | """ 28 | learning rate decrease according to the model performance 29 | :param epoch: The current epoch 30 | :returns: The new learning rate 31 | """ 32 | return learning_rate * math.pow(0.5, epoch // 10) 33 | 34 | 35 | def get_callbacks(config: Dict[str, Any], val_data: ImgSequence, model: Model) -> List[Callback]: 36 | """ 37 | Get the callbacks to be used when training the model 38 | :param config: A dictionary storing the script configuration 39 | :returns: A list of Keras callbacks 40 | """ 41 | tensorboard = TensorBoard(log_dir=f"logs/tensorboard/{model.name}") 42 | csv = CSVLogger(filename=f"logs/csv/{model.name}.csv", append=True) 43 | checkpoint = ModelCheckpoint(f"checkpoints/{model.name}/{model.name}", save_best_only=False, monitor='val_loss', mode='min', save_weights_only=True) 44 | prediction_logger = PredictionCallback(val_data, model) 45 | learning_rate_scheduler = LearningRateScheduler(lr_scheduler) 46 | early_stopping = EarlyStopping(monitor="val_loss", min_delta=0.0001, patience=50, verbose=1, mode="min") 47 | return [tensorboard, csv, checkpoint, prediction_logger, learning_rate_scheduler, early_stopping] if get_create_logs(config) else [learning_rate_scheduler, early_stopping] 48 | 49 | 50 | def create_callback_dirs() -> None: 51 | """Create the directories needed by our callbacks if they don't already exist""" 52 | # Create Logs Directory 53 | if "logs" not in os.listdir(): 54 | os.mkdir("logs") 55 | 56 | # Create Tensorboard Directory 57 | if "tensorboard" not in os.listdir("logs"): 58 | os.mkdir("logs/tensorboard") 59 | 60 | # Create CSV Directory 61 | if "csv" not in os.listdir("logs"): 62 | os.mkdir("logs/csv") 63 | 64 | # Create Checkpoint Directory 65 | if "checkpoints" not in os.listdir(): 66 | os.mkdir("checkpoints") 67 | 68 | # Create Validation Directory 69 | if "validation" not in os.listdir(): 70 | os.mkdir("validation") 71 | 72 | # Create Test Directory 73 | if "test" not in os.listdir(): 74 | os.mkdir("test") -------------------------------------------------------------------------------- /models/deeplab.py: -------------------------------------------------------------------------------- 1 | from backend.config import get_input_channels, get_patch_size, get_bands, get_backbone 2 | from models.layers import rgb_nir_swir_input_layer 3 | from models.utils import get_model_name, assemble_model 4 | import tensorflow as tf 5 | from tensorflow import keras 6 | from tensorflow.keras import layers 7 | 8 | 9 | def convolution_block(block_input, num_filters=256, kernel_size=3, dilation_rate=1, use_bias=False,): 10 | x = layers.Conv2D(num_filters, kernel_size=kernel_size, dilation_rate=dilation_rate, padding="same", use_bias=use_bias, kernel_initializer=keras.initializers.HeNormal())(block_input) 11 | x = layers.BatchNormalization()(x) 12 | return tf.nn.relu(x) 13 | 14 | 15 | def DilatedSpatialPyramidPooling(dspp_input): 16 | dims = dspp_input.shape 17 | x = layers.AveragePooling2D(pool_size=(dims[-3], dims[-2]))(dspp_input) 18 | x = convolution_block(x, kernel_size=1, use_bias=True) 19 | out_pool = layers.UpSampling2D(size=(dims[-3] // x.shape[1], dims[-2] // x.shape[2]), interpolation="bilinear")(x) 20 | 21 | out_1 = convolution_block(dspp_input, kernel_size=1, dilation_rate=1) 22 | out_6 = convolution_block(dspp_input, kernel_size=3, dilation_rate=6) 23 | out_12 = convolution_block(dspp_input, kernel_size=3, dilation_rate=12) 24 | out_18 = convolution_block(dspp_input, kernel_size=3, dilation_rate=18) 25 | 26 | x = layers.Concatenate(axis=-1)([out_pool, out_1, out_6, out_12, out_18]) 27 | output = convolution_block(x, kernel_size=1) 28 | return output 29 | 30 | 31 | def deeplab_base(config, weights=None): 32 | # Construct ResNet Encoder 33 | image_size = get_patch_size(config) 34 | inputs = layers.Input(shape=(image_size, image_size, get_input_channels(config))) 35 | resnet50 = keras.applications.ResNet50(weights=weights, include_top=False, input_tensor=inputs) 36 | 37 | # Construct ASPP Module 38 | x = resnet50.get_layer("conv4_block6_2_relu").output 39 | x = DilatedSpatialPyramidPooling(x) 40 | 41 | # Grab Skip Connections 42 | input_a = layers.UpSampling2D( size=(image_size // 4 // x.shape[1], image_size // 4 // x.shape[2]), interpolation="bilinear",)(x) 43 | input_b = resnet50.get_layer("conv2_block3_2_relu").output 44 | input_b = convolution_block(input_b, num_filters=48, kernel_size=1) 45 | 46 | # Implement Decoder And Output 47 | x = layers.Concatenate(axis=-1)([input_a, input_b]) 48 | x = convolution_block(x) 49 | x = convolution_block(x) 50 | x = layers.UpSampling2D( size=(image_size // x.shape[1], image_size // x.shape[2]), interpolation="bilinear",)(x) 51 | model_output = layers.Conv2D(1, kernel_size=(1, 1), name="out", activation='sigmoid', dtype="float32")(x) 52 | 53 | # Construct Base Model 54 | return keras.Model(inputs=inputs, outputs=model_output, name="unet_base") 55 | 56 | 57 | def DeeplabV3Plus(config): 58 | base_model = deeplab_base(config) 59 | base_model.summary() 60 | return assemble_model(base_model, config) 61 | 62 | 63 | def DeeplabV3PlusImageNet(config): 64 | if get_input_channels(config) != 3: 65 | config["hyperparameters"]["fusion_head"] = "prism" 66 | base_model = deeplab_base(config, weights="imagenet") 67 | base_model.summary() 68 | return assemble_model(base_model, config) 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Waterbody Detection Via Deep Learning 2 | 3 | This project explores the application of deep learning to waterbody detection. 4 | 5 | # Dataset 6 | https://drive.google.com/file/d/1faVYayxdNFGx2m0IxswDncoKmIxusdf7/view 7 | 8 | # Running The Script 9 | To run the script, simply execute `main.py` with the index of the GPU you want to train with specified as an optional parameter. If no GPU is specified, the script will default to GPU 0. 10 | ```bash 11 | python3 main.py [GPU] 12 | ``` 13 | 14 | # Configuration 15 | The script expects an external file called `config.json` in which the use should specify the desired configuration. Below is an example of such a file and a table outlining the effects of each setting. 16 | 17 | ### Example Configuration 18 | ```json 19 | { 20 | "timestamp": 1, 21 | "patch_size": 512, 22 | "experiment_tag": "unet_multispectral", 23 | "create_logs": true, 24 | "train": true, 25 | "test": true, 26 | "experiments": 1, 27 | "use_mixed_precision": true, 28 | "hyperparameters": { 29 | "model": "unet", 30 | "bands": ["RGB", "NIR", "SWIR"], 31 | "backbone": null, 32 | "learning_rate": 0.00005, 33 | "fusion_head": "naive", 34 | "loss": "jaccard_bce", 35 | "batch_size": 4, 36 | "epochs": 50, 37 | "apply_transfer": false, 38 | "random_subsample": false, 39 | "water_threshold": 0 40 | } 41 | } 42 | ``` 43 | 44 | ### Available Settings 45 | | Setting | Effects | 46 | |---------------------|----------------------------------------------------------------------| 47 | | timestamp | The timestamp to use (1, 2 or 3) | 48 | | patch_size | The desired size of the generated patches | 49 | | experiment_tag | The human-readable tag with which to lable the experiment | 50 | | create_logs | Indicates whether or not we want to create logs for the experiment | 51 | | train | Whether or not we want to run the training loop | 52 | | test | Whether or not we want to test the trained model on the test set | 53 | | experiments | Indicate the number of identical experiments we want to run | 54 | | use_mixed_precision | Indicate the number of identical experiments we want to run | 55 | 56 | 57 | ### Available Hyperparameters 58 | | Hyperparameter | Effects | 59 | |------------------|-----------------------------------------------------------------------------------| 60 | | model | The model we want to use | 61 | | bands | The bands used as inpiut to the model | 62 | | backbone | The model of the pre-trained backbone we want to use | 63 | | learning_rate | The learning rate used by the optimizer | 64 | | fusion_head | The type of fusion head to use to combine spectral bands | 65 | | loss | The loss to use during training | 66 | | batch_size | The size of batches used in training | 67 | | epochs | The number of epochs to train for | 68 | | apply_transfer | Whether or not to apply the PCT water transfer method | 69 | | random_subsample | Whether or not to randomly sample patches for training | 70 | | water_threshold | The threshold at which to stop transplanting water bodies if apply_transfer=true | 71 | 72 | # Citation 73 | Please cite our work if it is helpful for your research. 74 | ``` 75 | @article{rs15051253, 76 | title={Water Body Extraction from Sentinel-2 Imagery with Deep Convolutional Networks and Pixelwise Category Transplantation}, 77 | author={Billson, Joshua and Islam, MD Samiul and Sun, Xinyao and Cheng, Irene}, 78 | journal={Remote Sensing}, 79 | volume={15}, 80 | year={2023}, 81 | number={5}, 82 | article-number={1253}, 83 | url={https://www.mdpi.com/2072-4292/15/5/1253}, 84 | issn={2072-4292}, 85 | doi={10.3390/rs15051253} 86 | } 87 | ``` 88 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import json 4 | from typing import Dict, Any 5 | from tensorflow.keras.metrics import Recall, Precision 6 | from tensorflow.keras.optimizers import Adam 7 | from tensorflow.keras.losses import binary_crossentropy 8 | from tensorflow.keras import mixed_precision 9 | from backend.metrics import MIOU 10 | from backend.pipeline import load_dataset 11 | from scripts.generate_patches import generate_patches 12 | from models import get_model 13 | from models.utils import evaluate_model 14 | from backend.config import get_epochs, get_model_type, get_timestamp, get_learning_rate, get_timestamp_directory, get_num_experiments, get_mixed_precision 15 | from models.losses import JaccardBCELoss, DiceBCELoss, JaccardLoss, WeightedBCE, Focal_Tversky, Tversky, DiceLoss, FocalLoss, JaccardWeightedBCELoss 16 | from backend.callbacks import get_callbacks, create_callback_dirs 17 | 18 | 19 | def get_loss_function(config: Dict[str, Any]): 20 | """ 21 | Get the loss function from the project config 22 | :param config: A dictionary storing the project configuration; typically loaded from an external file 23 | :returns: The loss function to use during model optimization 24 | """ 25 | losses = { 26 | "bce": binary_crossentropy, 27 | "weighted_bce": WeightedBCE(0.02, 0.98), 28 | "dice": DiceLoss, 29 | "dice_bce": DiceBCELoss, 30 | "jaccard": JaccardLoss, 31 | "jaccard_bce": JaccardBCELoss, 32 | "jaccard_weighted_bce": JaccardWeightedBCELoss(0.02, 0.98, alpha=0.9), 33 | "focal": FocalLoss(), 34 | "focal_tversky": Focal_Tversky(), 35 | "tversky": Tversky(), 36 | } 37 | return losses[config["hyperparameters"]["loss"]] 38 | 39 | 40 | def main(): 41 | # Get Project Configuration 42 | with open('config.json') as f: 43 | config = json.loads(f.read()) 44 | 45 | # Use Mixed Precision 46 | if get_mixed_precision(config): 47 | mixed_precision.set_global_policy('mixed_float16') 48 | 49 | # Generate Patches 50 | if "tiles" not in os.listdir(f"data/{get_timestamp_directory(config)}"): 51 | generate_patches(config=config) 52 | 53 | # Load Dataset 54 | train_data, val_data, test_data = load_dataset(config) 55 | 56 | # Create Callback Directories 57 | create_callback_dirs() 58 | 59 | # Train A Model For Each Experiment Specified In The Project Config 60 | results, num_experiments = [], get_num_experiments(config) 61 | assert num_experiments > 0, "Error: Value for 'experiments' must be greater than 0!" 62 | for _ in range(num_experiments): 63 | 64 | # Create Model 65 | model = get_model(config) 66 | model.summary() 67 | model.compile(loss=get_loss_function(config), optimizer=Adam(learning_rate=get_learning_rate(config)), metrics=[MIOU(), Recall(), Precision()]) 68 | 69 | # Get Callbacks 70 | callbacks = get_callbacks(config, val_data, model) 71 | 72 | # If Model Is Loaded From Checkpoint, Find The Last Epoch 73 | initial_epoch = 0 74 | if get_model_type(config) in os.listdir("checkpoints"): 75 | with open(f"logs/csv/{get_model_type(config)}.csv") as csvfile: 76 | last_line = csvfile.readlines()[-1] 77 | initial_epoch = int(last_line.split(",")[0]) + 1 78 | 79 | # Train Model 80 | if config["train"]: 81 | model.fit(train_data, epochs=get_epochs(config)+initial_epoch, verbose=1, callbacks=callbacks, validation_data=val_data, initial_epoch=initial_epoch) 82 | 83 | # Evaluate Model On Test Set 84 | if config["test"]: 85 | #results.append(evaluate_model(model, test_data)) 86 | results.append(test_data.predict_batch(model, "test")) 87 | 88 | # Save Experiment Configuration For Future Reference 89 | if "experiments" not in os.listdir(): 90 | os.mkdir("experiments") 91 | if get_model_type(config) not in os.listdir("checkpoints"): 92 | with open(f"experiments/{model.name}.json", 'w') as config_file: 93 | config_file.write(json.dumps(config, indent=2)) 94 | 95 | # Evaluate Performance Of All Models 96 | if config["test"]: 97 | print("\nSUMMARY OF MODEL AVERAGES") 98 | for result in zip(model.metrics_names, *results): 99 | metric = result[0] 100 | average_value = sum(result[1:]) / len(result[1:]) 101 | print(f"Model Average For {metric}:", average_value) 102 | 103 | 104 | if __name__ == '__main__': 105 | # Set Visible GPU 106 | args = sys.argv 107 | GPUS = args[1:] if len(args) > 1 else ["0"] 108 | os.environ["CUDA_VISIBLE_DEVICES"]=f"{','.join(GPUS)}" 109 | 110 | # Run Script 111 | main() 112 | -------------------------------------------------------------------------------- /models/unet.py: -------------------------------------------------------------------------------- 1 | from backend.config import get_patch_size, get_model_config 2 | from models.utils import get_model_name, assemble_model 3 | import tensorflow as tf 4 | from tensorflow import keras 5 | from tensorflow.keras import layers 6 | 7 | 8 | def convolution_block(block_input, num_filters=256, kernel_size=3, dilation_rate=1, use_bias=False, use_batch_norm=False): 9 | """A single convolution block""" 10 | x = layers.Conv2D(num_filters, kernel_size=kernel_size, dilation_rate=dilation_rate, padding="same", use_bias=use_bias, kernel_initializer=keras.initializers.HeNormal())(block_input) 11 | x = layers.BatchNormalization()(x) if use_batch_norm else x 12 | return tf.nn.relu(x) 13 | 14 | 15 | def encoder_block(block_input, num_filters=256, num_blocks=2, use_batch_norm=False): 16 | """A block of convolutions used by the encoder""" 17 | x = convolution_block(block_input, num_filters=num_filters, use_batch_norm=use_batch_norm) 18 | for _ in range(num_blocks - 1): 19 | x = convolution_block(x, num_filters=num_filters, use_batch_norm=use_batch_norm) 20 | return x 21 | 22 | 23 | def decoder_block(block_input, skip_input, num_filters=256, num_blocks=2, use_batch_norm=False): 24 | """A block of convolutions used by the decoder""" 25 | x = layers.Concatenate(axis=-1)([block_input, skip_input]) 26 | x = convolution_block(x, num_filters=num_filters, use_batch_norm=use_batch_norm) 27 | for _ in range(num_blocks - 1): 28 | x = convolution_block(x, num_filters=num_filters, use_batch_norm=use_batch_norm) 29 | return x 30 | 31 | 32 | def downsample_block(block_input): 33 | """A downsampling layer""" 34 | return layers.MaxPooling2D(pool_size=(2, 2), padding="same")(block_input) 35 | 36 | 37 | def upsample_block(block_input, num_filters=256): 38 | """An upsampling layer""" 39 | return layers.Conv2DTranspose(num_filters, (2, 2), strides=(2, 2), padding="same")(block_input) 40 | 41 | 42 | def get_skip_layers(model: keras.models.Model): 43 | skip_connections = [] 44 | for layer in ["conv1_relu", "conv2_block3_out", "conv3_block4_out", "conv4_block6_out", "conv5_block3_out"]: 45 | skip_connections.append(model.get_layer(layer).output) 46 | return skip_connections 47 | 48 | 49 | def UnetBase(config, num_filters, num_blocks, use_batch_norm, model_name): 50 | """Base U-Net model""" 51 | # Connect Input 52 | input_channels, _ = get_model_config(config) 53 | patch_size = get_patch_size(config) 54 | inputs = layers.Input((patch_size, patch_size, input_channels)) 55 | x = encoder_block(inputs, num_filters[0], num_blocks=num_blocks, use_batch_norm=use_batch_norm) 56 | skip_layers = [x] 57 | x = downsample_block(x) 58 | 59 | # Build Encoder 60 | for i, num_filter in enumerate(num_filters[1:]): 61 | x = encoder_block(x, num_filter, num_blocks=num_blocks, use_batch_norm=use_batch_norm) 62 | skip_layers.append(x) 63 | x = downsample_block(x) if i != (len(num_filters) - 2) else x 64 | 65 | # Build Decoder 66 | skip_layers.reverse() 67 | num_filters.reverse() 68 | for skip_layer, num_filter in zip(skip_layers[1:], num_filters[1:]): 69 | x = upsample_block(x, num_filters=num_filter) 70 | x = decoder_block(x, skip_layer, num_filters=num_filter, num_blocks=2, use_batch_norm=True) 71 | 72 | # Create Output Layer 73 | model_output = layers.Conv2D(1, kernel_size=(3, 3), name="out", activation='sigmoid', dtype="float32", padding="same")(x) 74 | return keras.Model(inputs=inputs, outputs=model_output, name=model_name) 75 | 76 | 77 | def UnetResNetBase(model_input, num_filters, num_blocks, use_batch_norm, model_name): 78 | """Base U-Net model""" 79 | # Build Encoder 80 | num_filters = [64, 256, 512, 1024] 81 | resnet50 = keras.applications.ResNet50(weights="imagenet", include_top=False, input_tensor=model_input) 82 | skip_layers = get_skip_layers(resnet50) 83 | 84 | # Build Decoder 85 | skip_layers.reverse() 86 | num_filters.reverse() 87 | x = skip_layers[0] 88 | for skip_layer, num_filter in zip(skip_layers[1:], num_filters): 89 | x = upsample_block(x, num_filters=num_filter) 90 | x = decoder_block(x, skip_layer, num_filters=num_filter, num_blocks=num_blocks, use_batch_norm=use_batch_norm) 91 | 92 | # Create Output Layer 93 | model_output = layers.Conv2D(1, kernel_size=(3, 3), name="out", activation='sigmoid', dtype="float32", padding="same")(x) 94 | return keras.Model(inputs=model_input, outputs=model_output, name=model_name) 95 | 96 | 97 | def Unet(config): 98 | # Construct Base Model 99 | model = UnetBase(config, num_filters=[64, 128, 256, 512, 1024, 2048], num_blocks=2, use_batch_norm=True, model_name="unet_base") 100 | model.summary() 101 | 102 | # Replace Input And Output Layers 103 | return assemble_model(model, config) 104 | 105 | 106 | def DeepUnet(config): 107 | # Construct Base Model 108 | model = MyUnet(config, num_filters=[64, 128, 256, 512, 1024], num_blocks=4, use_batch_norm=True) 109 | model.summary() 110 | 111 | # Replace Input And Output Layers 112 | return assemble_model(model, config) 113 | -------------------------------------------------------------------------------- /models/mc_wbdn_resnet50.py: -------------------------------------------------------------------------------- 1 | from math import sqrt 2 | from backend.config import get_input_channels, get_patch_size, get_bands, get_backbone 3 | from models.layers import rgb_nir_swir_input_layer 4 | from models.utils import get_model_name, assemble_model 5 | import tensorflow as tf 6 | from tensorflow import keras 7 | from tensorflow.keras import layers 8 | 9 | def D2S(input_size, output_size): 10 | def d2s(layer_input): 11 | block_size = output_size // input_size 12 | return tf.nn.depth_to_space(layer_input, block_size=block_size) 13 | return d2s 14 | 15 | 16 | def S2D(input_size, input_channels, output_size): 17 | def s2d(layer_input): 18 | output_channels = (input_size * input_size * input_channels) // (output_size * output_size) 19 | block_size = int(sqrt(output_channels // input_channels)) 20 | return tf.nn.space_to_depth(layer_input, block_size=block_size) 21 | return s2d 22 | 23 | 24 | def convolution_block(block_input, num_filters=256, kernel_size=3, dilation_rate=1, use_bias=False, activation=tf.nn.relu): 25 | x = layers.Conv2D(num_filters, kernel_size=kernel_size, dilation_rate=dilation_rate, padding="same", use_bias=use_bias, kernel_initializer=keras.initializers.HeNormal())(block_input) 26 | x = layers.BatchNormalization()(x) 27 | return activation(x) 28 | 29 | 30 | def DilatedSpatialPyramidPooling(dspp_input): 31 | x = convolution_block(dspp_input, kernel_size=1, use_bias=True) 32 | out_pool = layers.MaxPool2D(pool_size=(3, 3), strides=(1, 1), padding="same")(x) 33 | 34 | out_1 = convolution_block(dspp_input, kernel_size=1, dilation_rate=1) 35 | out_6 = convolution_block(dspp_input, kernel_size=3, dilation_rate=6) 36 | out_12 = convolution_block(dspp_input, kernel_size=3, dilation_rate=12) 37 | out_18 = convolution_block(dspp_input, kernel_size=3, dilation_rate=18) 38 | 39 | x = layers.Concatenate(axis=-1)([out_pool, out_1, out_6, out_12, out_18]) 40 | output = convolution_block(x, kernel_size=1, num_filters=1024) 41 | return output 42 | 43 | 44 | def mcwbdn_base_1(config, weights=None): 45 | # Construct ResNet Encoder 46 | image_size = get_patch_size(config) 47 | inputs = layers.Input(shape=(image_size, image_size, get_input_channels(config))) 48 | resnet50 = keras.applications.ResNet50(weights=weights, include_top=False, input_tensor=inputs) 49 | resnet50.summary() 50 | 51 | # Construct ASPP Module 52 | x = resnet50.get_layer("conv4_block6_2_relu").output 53 | x = DilatedSpatialPyramidPooling(x) 54 | 55 | 56 | # Decoder Block 1 57 | input_a = D2S(32, 64)(x) 58 | input_b = resnet50.get_layer("conv3_block4_out").output 59 | x = layers.Concatenate(axis=-1)([input_a, input_b]) 60 | x = convolution_block(x, num_filters=512) 61 | x = convolution_block(x, num_filters=512) 62 | 63 | # Decoder Block 2 64 | input_a = D2S(64, 128)(x) 65 | input_b = resnet50.get_layer("conv2_block3_out").output 66 | x = layers.Concatenate(axis=-1)([input_a, input_b]) 67 | x = convolution_block(x, num_filters=256) 68 | x = convolution_block(x, num_filters=256) 69 | 70 | # Implement Decoder And Output 71 | x = layers.UpSampling2D( size=(image_size // x.shape[1], image_size // x.shape[2]), interpolation="bilinear",)(x) 72 | x = convolution_block(x, num_filters=128) 73 | x = convolution_block(x, num_filters=128) 74 | model_output = layers.Conv2D(1, kernel_size=(1, 1), name="out", activation='sigmoid', dtype="float32")(x) 75 | 76 | # Construct Base Model 77 | return keras.Model(inputs=inputs, outputs=model_output, name="unet_base") 78 | 79 | 80 | def mcwbdn_base(config, weights=None): 81 | # Construct ResNet Encoder 82 | image_size = get_patch_size(config) 83 | inputs = layers.Input(shape=(image_size, image_size, get_input_channels(config))) 84 | resnet50 = keras.applications.ResNet50(weights=weights, include_top=False, input_tensor=inputs) 85 | resnet50.summary() 86 | 87 | # Construct ASPP Module 88 | x = resnet50.get_layer("conv4_block6_2_relu").output 89 | x = DilatedSpatialPyramidPooling(x) 90 | 91 | # Grab Skip Connections 92 | input_a = D2S(32, 128)(x) 93 | input_b = resnet50.get_layer("conv2_block3_2_relu").output 94 | input_b = convolution_block(input_b, num_filters=48, kernel_size=1) 95 | 96 | # Implement Decoder And Output 97 | x = layers.Concatenate(axis=-1)([input_a, input_b]) 98 | x = convolution_block(x) 99 | x = convolution_block(x) 100 | x = D2S(128, 512)(x) 101 | model_output = layers.Conv2D(1, kernel_size=(1, 1), name="out", activation='sigmoid', dtype="float32")(x) 102 | 103 | # Construct Base Model 104 | return keras.Model(inputs=inputs, outputs=model_output, name="unet_base") 105 | 106 | 107 | def MC_WBDN_ResNet50(config): 108 | base_model = mcwbdn_base(config) 109 | base_model.summary() 110 | return assemble_model(base_model, config) 111 | 112 | 113 | def MC_WBDN_ResNet50_ImageNet(config): 114 | if get_input_channels(config) != 3: 115 | config["hyperparameters"]["fusion_head"] = "prism" 116 | base_model = mcwbdn_base(config, weights="imagenet") 117 | base_model.summary() 118 | return assemble_model(base_model, config) 119 | -------------------------------------------------------------------------------- /batches/tiles.json: -------------------------------------------------------------------------------- 1 | { 2 | "train": [ 3 | 347, 4 | 279, 5 | 137, 6 | 382, 7 | 154, 8 | 96, 9 | 45, 10 | 39, 11 | 285, 12 | 43, 13 | 59, 14 | 21, 15 | 160, 16 | 340, 17 | 150, 18 | 183, 19 | 190, 20 | 237, 21 | 142, 22 | 176, 23 | 228, 24 | 105, 25 | 74, 26 | 54, 27 | 125, 28 | 99, 29 | 80, 30 | 283, 31 | 212, 32 | 112, 33 | 389, 34 | 120, 35 | 252, 36 | 333, 37 | 57, 38 | 115, 39 | 381, 40 | 298, 41 | 50, 42 | 324, 43 | 338, 44 | 122, 45 | 55, 46 | 290, 47 | 202, 48 | 12, 49 | 9, 50 | 101, 51 | 365, 52 | 322, 53 | 313, 54 | 264, 55 | 93, 56 | 299, 57 | 336, 58 | 398, 59 | 395, 60 | 146, 61 | 149, 62 | 303, 63 | 49, 64 | 148, 65 | 300, 66 | 236, 67 | 27, 68 | 97, 69 | 214, 70 | 6, 71 | 1, 72 | 369, 73 | 276, 74 | 79, 75 | 63, 76 | 222, 77 | 116, 78 | 263, 79 | 378, 80 | 231, 81 | 277, 82 | 226, 83 | 22, 84 | 281, 85 | 315, 86 | 201, 87 | 262, 88 | 86, 89 | 84, 90 | 326, 91 | 227, 92 | 312, 93 | 103, 94 | 286, 95 | 95, 96 | 145, 97 | 25, 98 | 243, 99 | 193, 100 | 64, 101 | 330, 102 | 15, 103 | 168, 104 | 245, 105 | 294, 106 | 161, 107 | 305, 108 | 48, 109 | 374, 110 | 253, 111 | 121, 112 | 138, 113 | 319, 114 | 361, 115 | 162, 116 | 321, 117 | 182, 118 | 35, 119 | 266, 120 | 221, 121 | 132, 122 | 256, 123 | 211, 124 | 18, 125 | 41, 126 | 198, 127 | 213, 128 | 141, 129 | 66, 130 | 257, 131 | 219, 132 | 152, 133 | 356, 134 | 34, 135 | 357, 136 | 129, 137 | 349, 138 | 104, 139 | 31, 140 | 3, 141 | 56, 142 | 172, 143 | 7, 144 | 345, 145 | 58, 146 | 20, 147 | 174, 148 | 136, 149 | 306, 150 | 296, 151 | 29, 152 | 348, 153 | 392, 154 | 186, 155 | 367, 156 | 360, 157 | 184, 158 | 159, 159 | 297, 160 | 87, 161 | 208, 162 | 24, 163 | 396, 164 | 188, 165 | 130, 166 | 314, 167 | 169, 168 | 329, 169 | 124, 170 | 342, 171 | 69, 172 | 127, 173 | 272, 174 | 42, 175 | 377, 176 | 71, 177 | 52, 178 | 399, 179 | 368, 180 | 123, 181 | 175, 182 | 26, 183 | 62, 184 | 131, 185 | 380, 186 | 210, 187 | 94, 188 | 359, 189 | 91, 190 | 191, 191 | 388, 192 | 82, 193 | 386, 194 | 11, 195 | 109, 196 | 17, 197 | 5, 198 | 167, 199 | 224, 200 | 144, 201 | 327, 202 | 195, 203 | 10, 204 | 185, 205 | 223, 206 | 77, 207 | 341, 208 | 323, 209 | 114, 210 | 318, 211 | 173, 212 | 400, 213 | 234, 214 | 244, 215 | 248, 216 | 293, 217 | 200, 218 | 372, 219 | 30, 220 | 320, 221 | 65, 222 | 171, 223 | 110, 224 | 100, 225 | 376, 226 | 72, 227 | 385, 228 | 134, 229 | 331, 230 | 273, 231 | 371, 232 | 117, 233 | 258, 234 | 233, 235 | 339, 236 | 337, 237 | 302, 238 | 384, 239 | 267, 240 | 119, 241 | 271, 242 | 217, 243 | 23, 244 | 51, 245 | 355, 246 | 235, 247 | 291, 248 | 346, 249 | 363, 250 | 310, 251 | 207, 252 | 139, 253 | 259, 254 | 225, 255 | 83, 256 | 155, 257 | 250, 258 | 301, 259 | 89, 260 | 192, 261 | 98, 262 | 204, 263 | 364, 264 | 118, 265 | 14, 266 | 4, 267 | 215, 268 | 53, 269 | 44, 270 | 255, 271 | 151, 272 | 199, 273 | 232, 274 | 220, 275 | 391, 276 | 107, 277 | 73, 278 | 316, 279 | 269, 280 | 352, 281 | 328, 282 | 284, 283 | 70, 284 | 8, 285 | 238, 286 | 309, 287 | 268, 288 | 397, 289 | 153, 290 | 343, 291 | 335, 292 | 85, 293 | 126, 294 | 311, 295 | 81, 296 | 241, 297 | 239, 298 | 383, 299 | 60, 300 | 387, 301 | 353, 302 | 38 303 | ], 304 | "validation": [ 305 | 140, 306 | 308, 307 | 147, 308 | 242, 309 | 304, 310 | 270, 311 | 33, 312 | 189, 313 | 179, 314 | 67, 315 | 19, 316 | 230, 317 | 37, 318 | 282, 319 | 180, 320 | 344, 321 | 351, 322 | 197, 323 | 46, 324 | 181, 325 | 373, 326 | 196, 327 | 229, 328 | 358, 329 | 334, 330 | 40, 331 | 32, 332 | 379, 333 | 75, 334 | 292, 335 | 128, 336 | 247, 337 | 246, 338 | 251, 339 | 143 340 | ], 341 | "test": [ 342 | 102, 343 | 90, 344 | 275, 345 | 111, 346 | 166, 347 | 216, 348 | 68, 349 | 158, 350 | 209, 351 | 260, 352 | 366, 353 | 240, 354 | 325, 355 | 254, 356 | 295, 357 | 362, 358 | 135, 359 | 2, 360 | 88, 361 | 274, 362 | 393, 363 | 28, 364 | 280, 365 | 261, 366 | 354, 367 | 218, 368 | 203, 369 | 106, 370 | 170, 371 | 108, 372 | 36, 373 | 205, 374 | 157, 375 | 288, 376 | 76, 377 | 278, 378 | 177, 379 | 375, 380 | 178, 381 | 206, 382 | 156, 383 | 317, 384 | 163, 385 | 16, 386 | 133, 387 | 287, 388 | 61, 389 | 370, 390 | 194, 391 | 165, 392 | 390, 393 | 92, 394 | 332, 395 | 307, 396 | 394, 397 | 164, 398 | 13, 399 | 47, 400 | 249, 401 | 78, 402 | 265, 403 | 289, 404 | 187, 405 | 113, 406 | 350 407 | ] 408 | } -------------------------------------------------------------------------------- /models/layers.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any, Sequence 2 | import tensorflow as tf 3 | from tensorflow.keras.activations import swish 4 | from tensorflow.keras.layers import Conv2D, Conv3D, DepthwiseConv2D, Layer, concatenate, Reshape, Lambda, BatchNormalization 5 | from backend.config import get_fusion_head 6 | 7 | 8 | def rgb_nir_swir_input_layer(rgb_inputs: Layer, nir_inputs: Layer, swir_inputs: Layer, config: Dict[str, Any]) -> Layer: 9 | """ 10 | Construct An Input Layer For RGB + NIR + SWIR Bands 11 | :param rgb_inputs: The input layer for RGB features 12 | :param nir_inputs: The input layer for NIR features 13 | :param swir_inputs: The input layer for SWIR features 14 | :param config: A dictionary storing the script configuration 15 | :returns: The fusion head specified by config as a Keras layer 16 | """ 17 | fusion_heads = { 18 | "naive": fusion_head_naive, 19 | "prism": fusion_head_prism, 20 | "depthwise": fusion_head_depthwise, 21 | "3D": fusion_head_3d, 22 | "paper": fusion_head_paper, 23 | "grayscale": fusion_head_grayscale, 24 | } 25 | constructor = fusion_heads[get_fusion_head(config)] 26 | return constructor(rgb_inputs, nir_inputs, swir_inputs) if get_fusion_head(config) != "prism" else constructor([rgb_inputs, nir_inputs, swir_inputs]) 27 | 28 | 29 | def fusion_head_naive(rgb_inputs: Layer, nir_inputs: Layer, swir_inputs: Layer) -> Layer: 30 | """ 31 | A layer for combining RGB, NIR, and SWIR inputs by concatenating the features along the channel axis 32 | :param rgb_inputs: The input layer for RGB features 33 | :param nir_inputs: The input layer for NIR features 34 | :param swir_inputs: The input layer for SWIR features 35 | :returns: The fusion head as a Keras layer 36 | """ 37 | return concatenate([rgb_inputs, nir_inputs, swir_inputs], axis=3) 38 | 39 | 40 | def fusion_head_depthwise(rgb_inputs: Layer, nir_inputs: Layer, swir_inputs: Layer) -> Layer: 41 | """ 42 | A layer for combining RGB, NIR, and SWIR inputs by applying a depthwise separable convolution followed by a 1x1 convolution 43 | :param rgb_inputs: The input layer for RGB features 44 | :param nir_inputs: The input layer for NIR features 45 | :param swir_inputs: The input layer for SWIR features 46 | :returns: The fusion head as a Keras layer 47 | """ 48 | concat = concatenate([rgb_inputs, nir_inputs, swir_inputs], axis=3) 49 | depthwise_conv = DepthwiseConv2D((3, 3), strides=(1, 1), activation=None, kernel_initializer='he_uniform', padding="same")(concat) 50 | return Conv2D(128, (1, 1), activation=swish, kernel_initializer='he_uniform', padding="same")(depthwise_conv) 51 | 52 | 53 | def fusion_head_3d(rgb_inputs: Layer, nir_inputs: Layer, swir_inputs: Layer) -> Layer: 54 | """ 55 | A layer for combining RGB, NIR, and SWIR inputs by applying a 3D convolution 56 | :param rgb_inputs: The input layer for RGB features 57 | :param nir_inputs: The input layer for NIR features 58 | :param swir_inputs: The input layer for SWIR features 59 | :returns: The fusion head as a Keras layer 60 | """ 61 | concat = concatenate([rgb_inputs, nir_inputs, swir_inputs], axis=3) 62 | reshaped = Reshape((512, 512, 5, 1))(concat) 63 | conv3d = Conv3D(25, (7, 7, 5), padding="same", activation=swish, kernel_initializer='he_uniform')(reshaped) 64 | return Reshape((512, 512, 125))(conv3d) 65 | 66 | 67 | def fusion_head_paper(rgb_inputs: Layer, nir_inputs: Layer, swir_inputs: Layer) -> Layer: 68 | """ 69 | A layer for combining RGB, NIR, and SWIR inputs as outlined in 'Deep-Learning-Based Multispectral Satellite ImageSegmentation for Water Body Detection' 70 | :param rgb_inputs: The input layer for RGB features 71 | :param nir_inputs: The input layer for NIR features 72 | :param swir_inputs: The input layer for SWIR features 73 | :returns: The fusion head as a Keras layer 74 | """ 75 | rgb_conv = Conv2D(64, (7, 7), strides=(2, 2), activation=swish, kernel_initializer='he_uniform', padding="same")(rgb_inputs) 76 | 77 | nir_conv = Conv2D(32, (7, 7), strides=(2, 2), activation=swish, kernel_initializer='he_uniform', padding="same")(nir_inputs) 78 | 79 | swir_conv = Conv2D(32, (1, 1), strides=(1, 1), activation=swish, kernel_initializer='he_uniform', padding="same")(swir_inputs) 80 | 81 | concat = concatenate([rgb_conv, nir_conv, swir_conv], axis=3) 82 | 83 | conv = Conv2D(64, (1, 1), strides=(1, 1), activation=None, kernel_initializer='he_uniform', padding="same")(concat) 84 | bn = BatchNormalization()(conv) 85 | return tf.nn.swish(bn) 86 | 87 | 88 | def fusion_head_grayscale(rgb_inputs: Layer, nir_inputs: Layer, swir_inputs: Layer) -> Layer: 89 | """ 90 | A layer which combines RGB, NIR, and SWIR inputs by transforming the RGB bands to grayscale 91 | :param rgb_inputs: The input layer for RGB features 92 | :param nir_inputs: The input layer for NIR features 93 | :param swir_inputs: The input layer for SWIR features 94 | :returns: The fusion head as a Keras layer 95 | """ 96 | # Turn RGB Band To Grayscale 97 | grayscale = Lambda(tf.image.rgb_to_grayscale)(rgb_inputs) 98 | 99 | # Concat Inputs 100 | concat = concatenate([grayscale, nir_inputs, swir_inputs], axis=3) 101 | 102 | # Return Final Layer 103 | return concat 104 | 105 | 106 | def fusion_head_prism(inputs: Sequence[Layer]) -> Layer: 107 | """ 108 | A layer which combines the given input bands and uses a convolution to produce a 3 band output 109 | :param inputs: The list of inputs we want to fuse together 110 | :returns: The fusion head as a Keras layer 111 | """ 112 | x = concatenate(inputs, axis=3) if len(inputs) > 1 else inputs[0] 113 | return Conv2D(3, 1, 1, padding="same")(x) -------------------------------------------------------------------------------- /models/losses.py: -------------------------------------------------------------------------------- 1 | from math import ceil 2 | from typing import Tuple 3 | import numpy as np 4 | import tensorflow as tf 5 | from tensorflow.keras.backend import flatten, sum, dot, pow, mean, ones_like, log 6 | from tensorflow.keras.losses import binary_crossentropy 7 | from tensorflow.keras import backend as K 8 | from backend.config import get_epochs, get_batch_size 9 | from scipy.ndimage import distance_transform_edt as distance 10 | 11 | 12 | def DiceLoss(targets, inputs, smooth=1e-6): 13 | """ 14 | Adapted From The Following: 15 | Source: https://www.kaggle.com/code/bigironsphere/loss-function-library-keras-pytorch/notebook 16 | Author: https://www.kaggle.com/bigironsphere 17 | 18 | :param targets: The ground-truth 19 | :param inputs: The predictions made by our model 20 | :param smooth: A constant to prevent division by zero 21 | :return:The loss on the given sample. 22 | """ 23 | inputs, targets = flatten(inputs), flatten(targets) 24 | intersection = sum(targets * inputs) 25 | total = sum(targets) + sum(inputs) 26 | IoU = (2 * intersection + smooth) / (total + smooth) 27 | return 1 - IoU 28 | 29 | 30 | def JaccardLoss(targets, inputs, smooth=1e-6): 31 | """ 32 | Adapted From The Following: 33 | Source: https://www.kaggle.com/code/bigironsphere/loss-function-library-keras-pytorch/notebook 34 | Author: https://www.kaggle.com/bigironsphere 35 | 36 | :param targets: The ground-truth 37 | :param inputs: The predictions made by our model 38 | :param smooth: A constant to prevent division by zero 39 | :return:The loss on the given sample 40 | """ 41 | inputs = flatten(inputs) 42 | targets = flatten(targets) 43 | intersection = sum(targets * inputs) 44 | total = sum(targets) + sum(inputs) 45 | union = total - intersection 46 | IoU = (intersection + smooth) / (union + smooth) 47 | return 1 - IoU 48 | 49 | 50 | def WeightedBCE(w0, w1): 51 | def loss(truth, prediction): 52 | truth, prediction = K.clip(flatten(truth), 1e-6, 1 - 1e-6), K.clip(flatten(prediction), K.epsilon(), 1 - K.epsilon()) 53 | truth_complement, prediction_complement = tf.ones_like(truth) - truth, tf.ones_like(prediction) - prediction 54 | entropies = (w1 * K.log(prediction) * truth) + (w0 * K.log(prediction_complement) * (truth_complement)) 55 | return K.mean(-1.0 * entropies) 56 | return loss 57 | 58 | 59 | def JaccardBCELoss(targets, inputs, smooth=1e-6, alpha=0.5): 60 | """ 61 | Adapted From The Following: 62 | Source: https://www.kaggle.com/code/bigironsphere/loss-function-library-keras-pytorch/notebook 63 | Author: https://www.kaggle.com/bigironsphere 64 | 65 | :param targets: The ground-truth 66 | :param inputs: The predictions made by our model 67 | :param smooth: A constant to prevent division by zero 68 | :param alpha: A float in the range (0, 1) which denotes the relative weight of the BCE loss with respect to the Jaccard loss. 69 | :return:The loss on the given sample 70 | """ 71 | BCE = binary_crossentropy(flatten(targets), flatten(inputs)) 72 | jaccard = JaccardLoss(targets, inputs, smooth=smooth) 73 | return (alpha * BCE) + ((1 - alpha) * jaccard) 74 | 75 | 76 | def DiceBCELoss(targets, inputs, smooth=1e-6, alpha=0.5): 77 | """ 78 | Adapted From The Following: 79 | Source: https://www.kaggle.com/code/bigironsphere/loss-function-library-keras-pytorch/notebook 80 | Author: https://www.kaggle.com/bigironsphere 81 | 82 | :param targets: The ground-truth 83 | :param inputs: The predictions made by our model 84 | :param smooth: A constant to prevent division by zero 85 | :param alpha: A float in the range (0, 1) which denotes the relative weight of the BCE loss with respect to the Dice loss. 86 | :return:The loss on the given sample. 87 | """ 88 | BCE = binary_crossentropy(flatten(targets), flatten(inputs)) 89 | dice = DiceLoss(targets, inputs, smooth=smooth) 90 | return (alpha * BCE) + ((1 - alpha) * dice) 91 | 92 | 93 | def JaccardWeightedBCELoss(w0, w1, smooth=1e-6, alpha=0.5): 94 | BCE = WeightedBCE(w0, w1) 95 | def jaccard_weighted_bce_loss(targets, inputs): 96 | bce = BCE(flatten(targets), flatten(inputs)) 97 | jaccard = JaccardLoss(targets, inputs, smooth=smooth) 98 | return (alpha * bce) + ((1 - alpha) * jaccard) 99 | return jaccard_weighted_bce_loss 100 | 101 | 102 | def Tversky(smooth=1e-6, alpha=0.7): 103 | def tversky(y_true, y_pred): 104 | y_true_pos = flatten(y_true) 105 | y_pred_pos = flatten(y_pred) 106 | y_true_neg = ones_like(y_true_pos) - y_true_pos 107 | y_pred_neg = ones_like(y_pred_pos) - y_pred_pos 108 | true_pos = sum(y_true_pos * y_pred_pos) 109 | false_neg = sum(y_true_pos * y_pred_neg) 110 | false_pos = sum(y_true_neg * y_pred_pos) 111 | tversky_index = (true_pos + smooth) / (true_pos + alpha*false_neg + (1-alpha)*false_pos + smooth) 112 | return 1 - tversky_index 113 | return tversky 114 | 115 | 116 | def Focal_Tversky(smooth=1e-6, alpha=0.7, gamma=1.33): 117 | tversky = Tversky(smooth=smooth, alpha=alpha) 118 | def focal_tversky(y_true, y_pred): 119 | tversky_loss = tversky(y_true, y_pred) 120 | return pow(tversky_loss, (1.0 / gamma)) 121 | return focal_tversky 122 | 123 | 124 | def FocalLoss(alpha=0.25, gamma=2.0): 125 | def focal_loss(y_true, y_pred): 126 | y_true, y_pred = flatten(y_true), K.clip(flatten(y_pred), K.epsilon(), 1 - K.epsilon()) 127 | y_true_complement, y_pred_complement = ones_like(y_true) - y_true, ones_like(y_pred) - y_pred 128 | p = (y_true * y_pred) + (y_true_complement * y_pred_complement) 129 | focal_loss_total = -alpha * (pow(ones_like(p) - p, gamma) * K.log(p)) 130 | return K.mean(focal_loss_total) 131 | return focal_loss -------------------------------------------------------------------------------- /models/utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | from typing import Dict, Any 3 | import tensorflow as tf 4 | from tensorflow.keras.layers import Conv2D, Input, concatenate, Lambda 5 | from tensorflow.keras.models import Model 6 | from models.layers import rgb_nir_swir_input_layer, fusion_head_prism 7 | from backend.config import get_model_type, get_bands, get_patch_size, get_experiment_tag, get_fusion_head, get_backbone 8 | 9 | 10 | def assemble_model(base_model: Model, config: Dict[str, Any]) -> Model: 11 | """ 12 | Takes a base model and modifies its input and output layers as appropriate for the specified input bands 13 | :param base_model: The base model (U-Net, U2-Net, U-Net++, etc.) that we want to extend 14 | :param config: The model configuration 15 | :return: The final model. 16 | """ 17 | model_constructors = { 18 | "RGB+NIR+SWIR": rgb_nir_swir_model, 19 | "RGB+NIR": rgb_nir_model, 20 | "RGB": rgb_model, 21 | "NIR": nir_model, 22 | "SWIR": swir_model, 23 | } 24 | return model_constructors["+".join(get_bands(config))](base_model, config) 25 | 26 | 27 | def rgb_model(base_model: Model, config: Dict[str, Any]) -> Model: 28 | """ 29 | Create An RGB Model From A Given Base Model And Configuration 30 | :param base_model: The base model (U-Net, U2-Net, U-Net++, etc.) that we want to extend 31 | :param config: The model configuration 32 | :return: The final RGB model. 33 | """ 34 | # Replace Output Layer 35 | model = replace_output(base_model, config) 36 | 37 | # Replace Model Input 38 | rgb_input = Input(shape=(get_patch_size(config), get_patch_size(config), 3)) 39 | outputs = model(rgb_input) 40 | return Model(inputs=rgb_input, outputs=outputs, name=get_model_name(config)) 41 | 42 | 43 | def nir_model(base_model: Model, config: Dict[str, Any]) -> Model: 44 | """ 45 | Create A NIR Model From A Given Base Model And Configuration 46 | :param base_model: The base model (U-Net, U2-Net, U-Net++, etc.) that we want to extend 47 | :param config: The model configuration 48 | :return: The final NIR model. 49 | """ 50 | # Replace Output Layer 51 | model = replace_output(base_model, config) 52 | 53 | # Replace Model Input 54 | nir_input = Input(shape=(get_patch_size(config), get_patch_size(config), 1)) 55 | model_input = Lambda(tf.image.grayscale_to_rgb)(nir_input) if get_backbone(config) is not None else nir_input 56 | outputs = model(model_input) 57 | return Model(inputs=nir_input, outputs=outputs, name=get_model_name(config)) 58 | 59 | 60 | def swir_model(base_model: Model, config: Dict[str, Any]) -> Model: 61 | """ 62 | Create A SWIR Model From A Given Base Model And Configuration 63 | :param base_model: The base model (U-Net, U2-Net, U-Net++, etc.) that we want to extend 64 | :param config: The model configuration 65 | :return: The final SWIR model. 66 | """ 67 | # Replace Output Layer 68 | model = replace_output(base_model, config) 69 | 70 | # Replace Model Input 71 | swir_input = Input(shape=(get_patch_size(config), get_patch_size(config), 1)) 72 | outputs = model(swir_input) 73 | return Model(inputs=swir_input, outputs=outputs, name=get_model_name(config)) 74 | 75 | 76 | def rgb_nir_model(base_model: Model, config: Dict[str, Any]) -> Model: 77 | """ 78 | Create An RGB + NIR Model From A Given Base Model And Configuration 79 | :param base_model: The base model (U-Net, U2-Net, U-Net++, etc.) that we want to extend 80 | :param config: The model configuration 81 | :return: The final RGB + NIR model. 82 | """ 83 | # Replace Output Layer 84 | model = replace_output(base_model, config) 85 | 86 | # Replace Model Input 87 | patch_size = get_patch_size(config) 88 | rgb_inputs = Input(shape=(patch_size, patch_size, 3)) 89 | nir_inputs = Input(shape=(patch_size, patch_size, 1)) 90 | concat = concatenate([rgb_inputs, nir_inputs], axis=3) 91 | outputs = model(concat) 92 | return Model(inputs=[rgb_inputs, nir_inputs], outputs=outputs, name=get_model_name(config)) 93 | 94 | 95 | def rgb_nir_swir_model(base_model: Model, config: Dict[str, Any]) -> Model: 96 | """ 97 | Create An RGB + NIR Model From A Given Base Model And Configuration 98 | :param base_model: The base model (U-Net, U2-Net, U-Net++, etc.) that we want to extend 99 | :param config: The model configuration 100 | :return: The final RGB + NIR model. 101 | """ 102 | # Replace Output Layer 103 | model = replace_output(base_model, config) 104 | 105 | # Replace Model Input 106 | patch_size = get_patch_size(config) 107 | rgb_inputs = Input(shape=(patch_size, patch_size, 3)) 108 | nir_inputs = Input(shape=(patch_size, patch_size, 1)) 109 | swir_inputs = Input(shape=(patch_size // 2 if get_fusion_head(config) == "paper" else patch_size, patch_size // 2 if get_fusion_head(config) == "paper" else patch_size, 1)) 110 | fusion_head = rgb_nir_swir_input_layer(rgb_inputs, nir_inputs, swir_inputs, config) 111 | outputs = model(fusion_head) 112 | model = Model(inputs=[rgb_inputs, nir_inputs, swir_inputs], outputs=outputs, name=get_model_name(config)) 113 | model.summary() 114 | return model 115 | 116 | 117 | def replace_output(base_model: Model, config: Dict[str, Any]) -> Model: 118 | """ 119 | Replace the output layer of the given base model. 120 | :param base_model: The base model (U-Net, U2-Net, U-Net++, etc.) whose output layer we want to replace 121 | :param config: The model configuration 122 | :return: The final model. 123 | """ 124 | x = base_model.layers[-2].output 125 | outputs = Conv2D(1, kernel_size=(1, 1), name="out", activation='sigmoid', dtype="float32")(x) 126 | return Model(inputs=base_model.input, outputs=outputs, name=f"{get_model_type(config)}_base") 127 | 128 | 129 | def get_model_name(config: Dict[str, Any]) -> str: 130 | """ 131 | Construct a name for the configured model of the format {model_type}.{bands}.{experiment_tag}.{model_id} 132 | :param config: The model configuration 133 | :return: The formatted name of the configured model 134 | """ 135 | # If model_type Is A Checkpointed Model, We Return Its Name As-Is 136 | model_type = get_model_type(config) 137 | saved_models = os.listdir("checkpoints") 138 | if model_type in saved_models: 139 | return model_type 140 | 141 | # Otherwise, We Create A New Unique Name 142 | partial_name = f"{model_type}.{'_'.join(get_bands(config))}.{get_experiment_tag(config)}".lower() 143 | existing_ids = [int(model.split(".")[-1]) for model in saved_models if partial_name in model] 144 | possible_ids = [possible_id for possible_id in range(0, max(existing_ids) + 2) if possible_id not in existing_ids] if existing_ids else [0] 145 | model_id = possible_ids[0] 146 | return f"{partial_name}.{model_id}" 147 | 148 | 149 | def evaluate_model(model: Model, test_data): 150 | """ 151 | Evaluate the given model on the provided test data 152 | :param model: The Keras model we want to evaluate 153 | :param test_data: The data on which to evaluate the model 154 | """ 155 | results = model.evaluate(test_data) 156 | print(f"\nEVALUATION SUMMARY FOR {model.name.upper()}") 157 | for metric, value in zip(model.metrics_names, results): 158 | print(metric, value) 159 | return results 160 | -------------------------------------------------------------------------------- /models/mc_wbdn.py: -------------------------------------------------------------------------------- 1 | import random 2 | from math import sqrt 3 | from backend.config import get_patch_size, get_bands, get_backbone, get_input_channels, get_fusion_head 4 | from models.utils import get_model_name, assemble_model 5 | from models.layers import rgb_nir_swir_input_layer 6 | from tensorflow.keras.activations import swish 7 | import tensorflow as tf 8 | from tensorflow import keras 9 | from tensorflow.keras import layers 10 | 11 | 12 | def D2S(input_size, output_size): 13 | def d2s(layer_input): 14 | block_size = output_size // input_size 15 | return tf.nn.depth_to_space(layer_input, block_size=block_size) 16 | return d2s 17 | 18 | 19 | def S2D(input_size, input_channels, output_size): 20 | def s2d(layer_input): 21 | output_channels = (input_size * input_size * input_channels) // (output_size * output_size) 22 | block_size = int(sqrt(output_channels // input_channels)) 23 | return tf.nn.space_to_depth(layer_input, block_size=block_size) 24 | return s2d 25 | 26 | 27 | def convolution_block(block_input, num_filters=256, kernel_size=3, dilation_rate=1, use_bias=False, activation=tf.nn.relu): 28 | x = layers.Conv2D(num_filters, kernel_size=kernel_size, dilation_rate=dilation_rate, padding="same", use_bias=use_bias, kernel_initializer=keras.initializers.HeNormal())(block_input) 29 | x = layers.BatchNormalization()(x) 30 | return activation(x) 31 | 32 | 33 | def DilatedSpatialPyramidPooling(dspp_input): 34 | x = convolution_block(dspp_input, kernel_size=1, use_bias=True) 35 | out_pool = layers.MaxPool2D(pool_size=(3, 3), strides=(1, 1), padding="same")(x) 36 | 37 | out_1 = convolution_block(dspp_input, kernel_size=1, dilation_rate=1) 38 | out_6 = convolution_block(dspp_input, kernel_size=3, dilation_rate=6) 39 | out_12 = convolution_block(dspp_input, kernel_size=3, dilation_rate=12) 40 | out_18 = convolution_block(dspp_input, kernel_size=3, dilation_rate=18) 41 | 42 | x = layers.Concatenate(axis=-1)([out_pool, out_1, out_6, out_12, out_18]) 43 | output = convolution_block(x, kernel_size=1, num_filters=1024) 44 | return output 45 | 46 | def identity_block(x, filter, name=None): 47 | # copy tensor to variable called x_skip 48 | x_skip = x 49 | # Layer 1 50 | x = layers.Conv2D(filter, (3,3), padding = 'same')(x) 51 | x = layers.BatchNormalization(axis=3)(x) 52 | x = layers.Activation('relu')(x) 53 | # Layer 2 54 | x = layers.Conv2D(filter, (3,3), padding = 'same')(x) 55 | x = layers.BatchNormalization(axis=3)(x) 56 | # Add Residue 57 | x = layers.Add()([x, x_skip]) 58 | x = layers.Activation('relu', name=name)(x) if name is not None else layers.Activation('relu')(x) 59 | return x 60 | 61 | 62 | def convolutional_block(x, filter): 63 | # copy tensor to variable called x_skip 64 | x_skip = x 65 | # Layer 1 66 | x = layers.Conv2D(filter, (3,3), padding = 'same', strides = (2,2))(x) 67 | x = layers.BatchNormalization(axis=3)(x) 68 | x = layers.Activation('relu')(x) 69 | # Layer 2 70 | x = layers.Conv2D(filter, (3,3), padding = 'same')(x) 71 | x = layers.BatchNormalization(axis=3)(x) 72 | # Processing Residue with conv(1,1) 73 | x_skip = layers.Conv2D(filter, (1,1), strides = (2,2))(x_skip) 74 | # Add Residue 75 | x = layers.Add()([x, x_skip]) 76 | x = layers.Activation('relu')(x) 77 | return x 78 | 79 | 80 | def ResNet34(config, classes=10): 81 | # Construct Input 82 | patch_size = get_patch_size(config) 83 | inputs = layers.Input(shape=(patch_size // 2, patch_size // 2, 64)) 84 | x = inputs 85 | 86 | # Add the Resnet Blocks 87 | block_layers = [3, 4, 6, 3] 88 | filter_size = 64 89 | for block in range(4): 90 | 91 | # For sub-block 1 Residual/Convolutional block not needed 92 | if block == 0: 93 | for j in range(block_layers[block]): 94 | x = identity_block(x, filter_size, name=f"out_{block+1}" if j == (block_layers[block] - 1) else None) 95 | 96 | # One Residual/Convolutional Block followed by Identity blocks 97 | else: 98 | filter_size *= 2 99 | x = convolutional_block(x, filter_size) 100 | for j in range(block_layers[block] - 1): 101 | x = identity_block(x, filter_size, name=f"out_{block+1}" if j == (block_layers[block] - 2) else None) 102 | 103 | # Step 4 End Dense Network 104 | x = tf.keras.layers.AveragePooling2D((2,2), padding = 'same')(x) 105 | x = tf.keras.layers.Flatten()(x) 106 | x = tf.keras.layers.Dense(512, activation = 'relu')(x) 107 | x = tf.keras.layers.Dense(classes, activation = 'softmax')(x) 108 | model = tf.keras.models.Model(inputs = inputs, outputs = x, name = "ResNet34") 109 | return model 110 | 111 | 112 | def build_encoder(config): 113 | # Construct Encoder 114 | encoder = ResNet34(config) 115 | encoder.summary() 116 | 117 | # Return Skip Layers 118 | out_1 = encoder.get_layer("out_1").output 119 | out_2 = encoder.get_layer("out_2").output 120 | out_3 = encoder.get_layer("out_3").output 121 | out_4 = encoder.get_layer("out_4").output 122 | return encoder, out_1, out_2, out_3, out_4 123 | 124 | 125 | def mc_wbdn_base(config): 126 | # Create Encoder 127 | encoder, out_1, out_2, out_3, out_4 = build_encoder(config) 128 | 129 | # Connect EASPP 130 | x = DilatedSpatialPyramidPooling(out_4) 131 | 132 | # Concat Feature Maps From Lower Levels With Output Of DSPP Module 133 | input_a = D2S(input_size=32, output_size=128)(x) 134 | input_b = out_2 135 | input_c = S2D(input_size = 256, input_channels=64, output_size=128)(out_1) 136 | input_d = D2S(input_size=64, output_size=128)(out_3) 137 | 138 | """ 139 | # Create Decoder & Output Layer 140 | x = layers.Concatenate(axis=-1)([input_a, input_b, input_c, input_d]) 141 | x = convolution_block(x) 142 | x = D2S(input_size=128, output_size=512)(x) 143 | x = convolution_block(x) 144 | model_output = layers.Conv2D(1, kernel_size=(1, 1), name="out", activation='sigmoid', dtype="float32")(x) 145 | return keras.Model(inputs=inputs, outputs=model_output, name=get_model_name(config)) 146 | 147 | # Create Decoder & Output Layer 148 | x = layers.Concatenate(axis=-1)([input_a, input_b, input_c, input_d]) 149 | x = convolution_block(x) 150 | x = layers.UpSampling2D( size=(get_patch_size(config) // x.shape[1], get_patch_size(config) // x.shape[2]), interpolation="bilinear",)(x) 151 | x = convolution_block(x) 152 | model_output = layers.Conv2D(1, kernel_size=(1, 1), name="out", activation='sigmoid', dtype="float32")(x) 153 | return keras.Model(inputs=inputs, outputs=model_output, name=get_model_name(config)) 154 | 155 | # Create Decoder & Output Layer 156 | x = layers.Concatenate(axis=-1)([input_a, input_b, input_c, input_d]) 157 | x = convolution_block(x, num_filters=128) 158 | x = D2S(input_size=128, output_size=512)(x) 159 | model_output = layers.Conv2D(1, kernel_size=(1, 1), name="out", activation='sigmoid', dtype="float32")(x) 160 | return keras.Model(inputs=inputs, outputs=model_output, name=get_model_name(config)) 161 | """ 162 | 163 | # Create Decoder & Output Layer 164 | x = layers.Concatenate(axis=-1)([input_a, input_b, input_c, input_d]) 165 | x = convolution_block(x) 166 | x = layers.UpSampling2D( size=(4, 4), interpolation="bilinear")(x) 167 | x = convolution_block(x, num_filters=128) 168 | model_output = layers.Conv2D(1, kernel_size=(1, 1), name="out", activation='sigmoid', dtype="float32")(x) 169 | return keras.Model(inputs=encoder.inputs, outputs=model_output, name=get_model_name(config)) 170 | 171 | 172 | 173 | def mc_wbdn(config): 174 | base_model = mc_wbdn_base(config) 175 | base_model.summary() 176 | model = assemble_model(base_model, config) 177 | return model 178 | -------------------------------------------------------------------------------- /backend/config.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, Any, List, Tuple 2 | 3 | 4 | def get_timestamp_directory(config: Dict[str, Any]) -> str: 5 | """ 6 | Get the input bands from the project config 7 | :param config: A dictionary storing the project configuration; typically loaded from an external file 8 | :returns: The list of bands we want to use 9 | """ 10 | folders = {1: "2018.04", 2: "2018.12", 3: "2019.02"} 11 | return folders[get_timestamp(config)] 12 | 13 | 14 | def get_bands(config: Dict[str, Any]) -> List[str]: 15 | """ 16 | Get the input bands from the project config 17 | :param config: A dictionary storing the project configuration; typically loaded from an external file 18 | :returns: The list of bands we want to use 19 | """ 20 | return [band for band in ("RGB", "NIR", "SWIR") if band in config["hyperparameters"]["bands"]] 21 | 22 | 23 | def get_batch_size(config: Dict[str, Any]) -> int: 24 | """ 25 | Get the batch size from the project config 26 | :param config: A dictionary storing the project configuration; typically loaded from an external file 27 | :returns: Batch size to be used by the training loop 28 | """ 29 | return config["hyperparameters"]["batch_size"] 30 | 31 | 32 | def get_patch_size(config: Dict[str, Any]) -> int: 33 | """ 34 | Get the patch size from the project config 35 | :param config: A dictionary storing the project configuration; typically loaded from an external file 36 | :returns: Patch size to be generated by the script 37 | """ 38 | return config["patch_size"] 39 | 40 | 41 | def get_input_channels(config: Dict[str, Any]) -> int: 42 | """ 43 | Get the number of input channels based on the inputs bands from the project config 44 | :param config: A dictionary storing the project configuration; typically loaded from an external file 45 | :returns: The number of input channels that will be fed into a model 46 | """ 47 | channels = { 48 | "RGB": 3, 49 | "NIR": 1, 50 | "SWIR": 1, 51 | "RGB+NIR": 4, 52 | "RGB+SWIR": 4, 53 | "RGB+NIR+SWIR": {"naive": 5, "depthwise": 128, "3D": 125, "paper": 128, "prism": 3}[get_fusion_head(config)], 54 | } 55 | return channels["+".join(get_bands(config))] 56 | 57 | 58 | def get_waterbody_transfer(config: Dict[str, Any]) -> bool: 59 | """ 60 | Get the configuration for applying waterbody transfer 61 | :param config: A dictionary storing the project configuration; typically loaded from an external file 62 | :returns: Boolean indicating whether or not we want to apply waterbody transfer 63 | """ 64 | return config["hyperparameters"]["apply_transfer"] 65 | 66 | 67 | def get_experiment_tag(config: Dict[str, Any]) -> str: 68 | """ 69 | Get the experiment tag 70 | :param config: A dictionary storing the project configuration; typically loaded from an external file 71 | :returns: Experiment tag we can use to associate models with experiments 72 | """ 73 | return config["experiment_tag"] 74 | 75 | 76 | def get_model_type(config: Dict[str, Any]) -> int: 77 | """ 78 | Get the model type from the project config 79 | :param config: A dictionary storing the project configuration; typically loaded from an external file 80 | :returns: The type of model we want to train (U-Net, V-Net, etc.) 81 | """ 82 | return config["hyperparameters"]["model"] 83 | 84 | 85 | def get_epochs(config: Dict[str, Any]) -> int: 86 | """ 87 | Get the number of epochs from the project config 88 | :param config: A dictionary storing the project configuration; typically loaded from an external file 89 | :returns: The number of epochs to be used by the training loop 90 | """ 91 | return config["hyperparameters"]["epochs"] 92 | 93 | 94 | def get_timestamp(config: Dict[str, Any]) -> int: 95 | """ 96 | Get the timestamp from the project config 97 | :param config: A dictionary storing the project configuration; typically loaded from an external file 98 | :returns: The timestamp for which we want to fetch data 99 | """ 100 | return config["timestamp"] 101 | 102 | 103 | def get_backbone(config: Dict[str, Any]) -> str: 104 | """ 105 | Get the backbone for the model we want to build from the project config 106 | :param config: A dictionary storing the project configuration; typically loaded from an external file 107 | :returns: The backbone (ResNet151, VGG16, etc.) to be used by the training loop 108 | """ 109 | return config["hyperparameters"]["backbone"] 110 | 111 | 112 | def get_learning_rate(config: Dict[str, Any]) -> float: 113 | """ 114 | Get the learning rate from the project config 115 | :param config: A dictionary storing the project configuration; typically loaded from an external file 116 | :returns: The learning rate to be used by the training loop 117 | """ 118 | return config["hyperparameters"]["learning_rate"] 119 | 120 | 121 | def get_create_logs(config: Dict[str, Any]) -> bool: 122 | """ 123 | Determines if our training loop should generate logs based on the project config 124 | :param config: A dictionary storing the project configuration; typically loaded from an external file 125 | :returns: True if we want to create logs, false otherwise 126 | """ 127 | return config["create_logs"] 128 | 129 | 130 | def get_model_config(config: Dict[str, Any]) -> Tuple[int, str]: 131 | """ 132 | Get the number of input channels and backbone from the project config 133 | :param config: A dictionary storing the project configuration; typically loaded from an external file 134 | :returns: The number of input channels our base model will receive and the backbone returned as (input_channels, backbone) 135 | """ 136 | return get_input_channels(config), get_backbone(config) 137 | 138 | 139 | def get_fusion_head(config: Dict[str, Any]) -> str: 140 | """ 141 | Get the type of fusion head for combining multi-spectral features from the project config 142 | :param config: A dictionary storing the project configuration; typically loaded from an external file 143 | :returns: The name of the type of fusion head we want our model to use 144 | """ 145 | return config["hyperparameters"]["fusion_head"] 146 | 147 | 148 | def get_num_experiments(config: Dict[str, Any]) -> int: 149 | """ 150 | Get the number of experiments to run from the project config 151 | :param config: A dictionary storing the project configuration; typically loaded from an external file 152 | :returns: The number of experiments to run 153 | """ 154 | return config["experiments"] 155 | 156 | 157 | def get_random_subsample(config: Dict[str, Any]) -> bool: 158 | """ 159 | Get the setting for whether or not the data pipeline should sub-sample 512x512 patches 160 | :param config: A dictionary storing the project configuration; typically loaded from an external file 161 | :returns: Whether or not to randomly sub-sample patches 162 | """ 163 | return config["hyperparameters"]["random_subsample"] 164 | 165 | 166 | def get_water_threshold(config: Dict[str, Any]) -> int: 167 | """ 168 | Get the water threshold for waterbody transfer 169 | :param config: A dictionary storing the project configuration; typically loaded from an external file 170 | :returns: The content threshold (percent) to be applied to waterbody transfer 171 | """ 172 | return config["hyperparameters"]["water_threshold"] 173 | 174 | 175 | def get_mixed_precision(config: Dict[str, Any]) -> bool: 176 | """ 177 | Return True if we want to use mixed precision to speed up trainig/inference at the cost of accuracy 178 | :param config: A dictionary storing the project configuration; typically loaded from an external file 179 | :returns: A boolean indicating whether or not we want to use mixed precision 180 | """ 181 | return config["use_mixed_precision"] -------------------------------------------------------------------------------- /backend/data_loader.py: -------------------------------------------------------------------------------- 1 | import random 2 | from typing import Tuple, List, Dict 3 | import cv2 4 | import rasterio 5 | import numpy as np 6 | 7 | 8 | class DataLoader: 9 | """A class to save and load images from disk""" 10 | def __init__(self, timestamp: int = 1, overlapping_patches: bool = False, random_subsample: bool = False, upscale_swir: bool = True): 11 | self.timestamp = timestamp 12 | self.folders = {1: "2018.04", 2: "2018.12", 3: "2019.02"} 13 | self.overlapping_patches = overlapping_patches 14 | self.random_subsample = random_subsample 15 | self.upscale_swir = upscale_swir 16 | 17 | def get_rgb_features(self, tile_number: int, coords: Tuple[int, int] = (0, 0), preprocess_img: bool = True, tile_dir: str = "tiles") -> np.ndarray: 18 | """ 19 | Get RGB Features Matching The Given Patch Number 20 | :param patch_number: The number of the patch we want to retrieve which must be in the range [min_patch, max_patch] 21 | :return: The RGB features of the matching patch, 22 | """ 23 | tile = self.read_image(f"data/{self.folders.get(self.timestamp, 1)}/{tile_dir}/rgb/rgb.{tile_number}.tif", preprocess_img=preprocess_img) 24 | return self.subsample_tile(tile, coords=coords) if coords is not None else tile 25 | 26 | def get_nir_features(self, tile_number: int, coords: Tuple[int, int] = None, preprocess_img: bool = True, tile_dir: str = "tiles") -> np.ndarray: 27 | """ 28 | Get NIR Features Matching The Given Patch Number 29 | :param patch_number: The number of the patch we want to retrieve which must be in the range [min_patch, max_patch] 30 | :return: The NIR features of the matching patch, 31 | """ 32 | tile = self.read_image(f"data/{self.folders.get(self.timestamp, 1)}/{tile_dir}/nir/nir.{tile_number}.tif", preprocess_img=preprocess_img) 33 | return self.subsample_tile(tile, coords=coords) if coords is not None else tile 34 | 35 | def get_swir_features(self, tile_number: int, coords: Tuple[int, int] = None, preprocess_img: bool = True, tile_dir: str = "tiles") -> np.ndarray: 36 | """ 37 | Get SWIR Features Matching The Given Patch Number 38 | :param patch_number: The number of the patch we want to retrieve which must be in the range [min_patch, max_patch] 39 | :return: The SWIR features of the matching patch, 40 | """ 41 | tile = self.read_image(f"data/{self.folders.get(self.timestamp, 1)}/{tile_dir}/swir/swir.{tile_number}.tif", preprocess_img=preprocess_img) 42 | tile = np.resize(cv2.resize(tile, (1024, 1024), interpolation = cv2.INTER_AREA), (1024, 1024, 1)) if self.upscale_swir else tile 43 | if coords is not None: 44 | return self.subsample_tile(tile, coords=coords) if self.upscale_swir else self.subsample_swir_tile(tile, coords=coords) 45 | return tile 46 | 47 | def get_mask(self, tile_number: int, coords: Tuple[int, int] = None, preprocess_img: bool = True, tile_dir: str = "tiles") -> np.ndarray: 48 | """ 49 | Get The Mask For The Given Patch Number 50 | :param patch_number: The number of the patch we want to retrieve which must be in the range [min_patch, max_patch] 51 | :return: The mark of the matching patch. 52 | """ 53 | tile = self.read_image(f"data/{self.folders.get(self.timestamp, 1)}/{tile_dir}/mask/mask.{tile_number}.tif") 54 | return self.subsample_tile(tile, coords=coords) if coords is not None else tile 55 | 56 | def get_features(self, patch: int, bands: List[str], subsample: bool = True, tile_dir: str = "tiles") -> Dict[str, np.ndarray]: 57 | # Get Coords Of Patch Inside Tile 58 | coords, tile_index = None, patch 59 | if subsample: 60 | tile_index = patch // 100 61 | patch_index = patch - (tile_index * 100) 62 | coords = self.get_patch_coords(patch_index) 63 | 64 | # Get Mask 65 | features = {"mask": self.get_mask(tile_index, coords=coords, preprocess_img=False, tile_dir=tile_dir)} 66 | 67 | # Get RGB Features 68 | if "RGB" in bands: 69 | features["RGB"] = self.get_rgb_features(tile_index, preprocess_img=False, coords=coords, tile_dir=tile_dir) 70 | 71 | # Get NIR Features 72 | if "NIR" in bands: 73 | features["NIR"] = self.get_nir_features(tile_index, preprocess_img=False, coords=coords, tile_dir=tile_dir) 74 | 75 | # Get SWIR Features 76 | if "SWIR" in bands: 77 | features["SWIR"] = self.get_swir_features(tile_index, preprocess_img=False, coords=coords, tile_dir=tile_dir) 78 | 79 | return features 80 | 81 | def subsample_tile(self, tile: np.ndarray, coords: Tuple[int, int] = (0, 0)) -> np.ndarray: 82 | """ 83 | Take a 512X512 sub-patch from a 1024X12024 tile. 84 | """ 85 | return tile[coords[1]:coords[1]+512, coords[0]:coords[0]+512, :] 86 | 87 | def subsample_swir_tile(self, tile: np.ndarray, coords: Tuple[int, int] = (0, 0)) -> np.ndarray: 88 | """ 89 | Take a 512X512 sub-patch from a 1024X12024 tile. 90 | """ 91 | y_coord = coords[1] // 2 92 | x_coord = coords[0] // 2 93 | return tile[y_coord:y_coord+256, x_coord:x_coord+256, :] 94 | 95 | def get_patch_coords(self, patch_index: int = 0) -> Tuple[int, int]: 96 | """Get the coordinates for a patch inside a tile from a given patch_index. If random_subsample is True, the coords will be selected randomly.""" 97 | assert (self.overlapping_patches and (1 <= patch_index <= 9)) or (not self.overlapping_patches and (1 <= patch_index <= 4)) or (self.random_subsample) 98 | overlapping_coords = {1: (0, 0), 2: (256, 0), 3: (512, 0), 4: (0, 256), 5: (256, 256), 6: (512, 256), 7: (0, 512), 8: (256, 512), 9: (512, 512)} 99 | non_overlapping_coords = {1: (0, 0), 2: (512, 0), 3: (0, 512), 4: (512, 512)} 100 | if self.random_subsample: 101 | return (random.randint(0, 512), random.randint(0, 512)) 102 | elif self.overlapping_patches: 103 | return overlapping_coords[patch_index] 104 | return non_overlapping_coords[patch_index] 105 | 106 | @staticmethod 107 | def read_image(filename: str, preprocess_img: bool = False) -> np.ndarray: 108 | """ 109 | Reads a raster image from disk and returns it 110 | :param filename: The name of the file on disk that we want to read 111 | :param preprocess_img: If True, the image is normalized before being returned to the caller 112 | :returns: The read image as a Numpy array 113 | """ 114 | with rasterio.open(filename) as dataset: 115 | # Read Channels 116 | num_channels = dataset.count 117 | channels = [dataset.read(i) for i in range(1, num_channels+1)] 118 | 119 | # Reshape Channels 120 | shape = (channels[0].shape[0], channels[0].shape[1], 1) 121 | channels = [np.reshape(channel, shape) for channel in channels] 122 | 123 | # Concat Channels If More Than One 124 | img = np.concatenate(channels, axis=2) if len(channels) > 1 else channels[0] 125 | return DataLoader.normalize_channels(img.astype("float32")) if preprocess_img else img 126 | 127 | @staticmethod 128 | def save_image(img: np.ndarray, filename: str) -> None: 129 | """ 130 | Save a raster image to disk 131 | :param img: The image we want to save encoded as a numpy array 132 | :param filename: The name of the destination file at which we want to save the image 133 | :returns: Nothing 134 | """ 135 | height, width, count, dtype = img.shape[0], img.shape[1], img.shape[2], img.dtype 136 | with rasterio.open(filename, 'w', driver='GTiff', height=height, width=width, count=count, dtype=dtype) as dst: 137 | dst.write(np.moveaxis(img, -1, 0)) 138 | 139 | @staticmethod 140 | def normalize_channels(img: np.ndarray) -> np.ndarray: 141 | # First We Threshold SWIR and NIR Patches 142 | if img.shape[-1] == 1: 143 | img = np.clip(img, a_min=0.0, a_max=3000.0) 144 | 145 | # Next We Normalize Each Channel By Subtracting The Mean And Scaling By The Inverse Of The Standard Deviation 146 | for channel_index in range(img.shape[-1]): 147 | channel = img[:, :, channel_index] 148 | channel_mean = np.mean(channel) 149 | channel_stdev = np.std(channel) 150 | channel -= channel_mean 151 | channel *= (1.0 / channel_stdev) 152 | return img 153 | -------------------------------------------------------------------------------- /batches/transplanted_tiles_5_timestamp_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "train": [ 3 | 336, 4 | 651, 5 | 85, 6 | 522, 7 | 57, 8 | 30, 9 | 653, 10 | 501, 11 | 120, 12 | 363, 13 | 213, 14 | 442, 15 | 267, 16 | 676, 17 | 427, 18 | 202, 19 | 514, 20 | 244, 21 | 574, 22 | 657, 23 | 119, 24 | 122, 25 | 562, 26 | 345, 27 | 31, 28 | 662, 29 | 403, 30 | 215, 31 | 211, 32 | 424, 33 | 634, 34 | 648, 35 | 367, 36 | 169, 37 | 312, 38 | 545, 39 | 637, 40 | 56, 41 | 388, 42 | 667, 43 | 566, 44 | 318, 45 | 138, 46 | 650, 47 | 172, 48 | 151, 49 | 449, 50 | 507, 51 | 231, 52 | 297, 53 | 474, 54 | 645, 55 | 493, 56 | 552, 57 | 628, 58 | 396, 59 | 477, 60 | 73, 61 | 647, 62 | 9, 63 | 559, 64 | 596, 65 | 359, 66 | 409, 67 | 60, 68 | 544, 69 | 629, 70 | 303, 71 | 6, 72 | 433, 73 | 535, 74 | 519, 75 | 670, 76 | 550, 77 | 526, 78 | 609, 79 | 34, 80 | 259, 81 | 182, 82 | 116, 83 | 627, 84 | 107, 85 | 489, 86 | 81, 87 | 144, 88 | 406, 89 | 494, 90 | 646, 91 | 412, 92 | 464, 93 | 511, 94 | 281, 95 | 661, 96 | 161, 97 | 624, 98 | 561, 99 | 563, 100 | 588, 101 | 652, 102 | 191, 103 | 129, 104 | 155, 105 | 398, 106 | 656, 107 | 171, 108 | 372, 109 | 434, 110 | 499, 111 | 35, 112 | 405, 113 | 468, 114 | 52, 115 | 548, 116 | 640, 117 | 532, 118 | 365, 119 | 272, 120 | 298, 121 | 11, 122 | 214, 123 | 294, 124 | 268, 125 | 533, 126 | 491, 127 | 407, 128 | 644, 129 | 527, 130 | 579, 131 | 534, 132 | 377, 133 | 95, 134 | 452, 135 | 432, 136 | 521, 137 | 134, 138 | 417, 139 | 386, 140 | 505, 141 | 642, 142 | 352, 143 | 542, 144 | 621, 145 | 118, 146 | 529, 147 | 391, 148 | 631, 149 | 105, 150 | 101, 151 | 616, 152 | 445, 153 | 186, 154 | 103, 155 | 487, 156 | 255, 157 | 677, 158 | 428, 159 | 389, 160 | 633, 161 | 59, 162 | 139, 163 | 654, 164 | 82, 165 | 437, 166 | 74, 167 | 612, 168 | 486, 169 | 93, 170 | 347, 171 | 590, 172 | 62, 173 | 483, 174 | 125, 175 | 453, 176 | 425, 177 | 65, 178 | 502, 179 | 248, 180 | 603, 181 | 554, 182 | 429, 183 | 146, 184 | 217, 185 | 632, 186 | 201, 187 | 322, 188 | 20, 189 | 271, 190 | 212, 191 | 374, 192 | 543, 193 | 441, 194 | 97, 195 | 524, 196 | 110, 197 | 290, 198 | 15, 199 | 413, 200 | 27, 201 | 55, 202 | 618, 203 | 591, 204 | 594, 205 | 342, 206 | 66, 207 | 150, 208 | 430, 209 | 174, 210 | 467, 211 | 508, 212 | 293, 213 | 263, 214 | 605, 215 | 44, 216 | 256, 217 | 530, 218 | 617, 219 | 18, 220 | 210, 221 | 184, 222 | 63, 223 | 611, 224 | 601, 225 | 320, 226 | 460, 227 | 220, 228 | 384, 229 | 669, 230 | 598, 231 | 204, 232 | 83, 233 | 558, 234 | 418, 235 | 381, 236 | 121, 237 | 383, 238 | 506, 239 | 658, 240 | 188, 241 | 382, 242 | 549, 243 | 568, 244 | 556, 245 | 589, 246 | 58, 247 | 324, 248 | 414, 249 | 415, 250 | 115, 251 | 583, 252 | 112, 253 | 408, 254 | 330, 255 | 649, 256 | 610, 257 | 480, 258 | 314, 259 | 137, 260 | 630, 261 | 671, 262 | 525, 263 | 664, 264 | 423, 265 | 454, 266 | 49, 267 | 7, 268 | 659, 269 | 64, 270 | 512, 271 | 444, 272 | 239, 273 | 160, 274 | 465, 275 | 587, 276 | 339, 277 | 515, 278 | 660, 279 | 490, 280 | 451, 281 | 226, 282 | 665, 283 | 540, 284 | 299, 285 | 193, 286 | 241, 287 | 45, 288 | 353, 289 | 200, 290 | 360, 291 | 435, 292 | 622, 293 | 504, 294 | 39, 295 | 17, 296 | 401, 297 | 349, 298 | 237, 299 | 198, 300 | 185, 301 | 176, 302 | 148, 303 | 236, 304 | 369, 305 | 25, 306 | 190, 307 | 520, 308 | 547, 309 | 356, 310 | 450, 311 | 531, 312 | 523, 313 | 476, 314 | 94, 315 | 3, 316 | 168, 317 | 315, 318 | 569, 319 | 675, 320 | 262, 321 | 77, 322 | 392, 323 | 48, 324 | 284, 325 | 43, 326 | 513, 327 | 463, 328 | 470, 329 | 323, 330 | 580, 331 | 235, 332 | 606, 333 | 233, 334 | 357, 335 | 222, 336 | 100, 337 | 276, 338 | 577, 339 | 26, 340 | 368, 341 | 84, 342 | 258, 343 | 98, 344 | 14, 345 | 431, 346 | 195, 347 | 149, 348 | 479, 349 | 655, 350 | 123, 351 | 96, 352 | 641, 353 | 536, 354 | 614, 355 | 24, 356 | 264, 357 | 371, 358 | 104, 359 | 570, 360 | 87, 361 | 296, 362 | 378, 363 | 269, 364 | 224, 365 | 145, 366 | 364, 367 | 503, 368 | 159, 369 | 473, 370 | 327, 371 | 638, 372 | 528, 373 | 54, 374 | 516, 375 | 51, 376 | 635, 377 | 376, 378 | 482, 379 | 109, 380 | 346, 381 | 484, 382 | 567, 383 | 69, 384 | 620, 385 | 478, 386 | 12, 387 | 456, 388 | 639, 389 | 608, 390 | 29, 391 | 234, 392 | 162, 393 | 571, 394 | 131, 395 | 397, 396 | 497, 397 | 279, 398 | 599, 399 | 439, 400 | 421, 401 | 321, 402 | 585, 403 | 199, 404 | 673, 405 | 219, 406 | 597, 407 | 498, 408 | 326, 409 | 459, 410 | 53, 411 | 440, 412 | 141, 413 | 126, 414 | 623, 415 | 305, 416 | 114, 417 | 481, 418 | 91, 419 | 227, 420 | 626, 421 | 663, 422 | 167, 423 | 328, 424 | 674, 425 | 301, 426 | 560, 427 | 517, 428 | 469, 429 | 578, 430 | 395, 431 | 475, 432 | 485, 433 | 419, 434 | 510, 435 | 537, 436 | 277, 437 | 21, 438 | 341, 439 | 223, 440 | 329, 441 | 604, 442 | 38, 443 | 404, 444 | 208, 445 | 613, 446 | 72, 447 | 472, 448 | 539, 449 | 557, 450 | 319, 451 | 553, 452 | 643, 453 | 5, 454 | 1, 455 | 23, 456 | 232, 457 | 338, 458 | 283, 459 | 42, 460 | 132, 461 | 335, 462 | 124, 463 | 411, 464 | 518, 465 | 619, 466 | 581, 467 | 461, 468 | 387, 469 | 50, 470 | 555, 471 | 615, 472 | 438, 473 | 79, 474 | 541, 475 | 361, 476 | 154, 477 | 488, 478 | 500, 479 | 153, 480 | 127, 481 | 402, 482 | 466, 483 | 285, 484 | 448, 485 | 625, 486 | 306, 487 | 565, 488 | 238, 489 | 41, 490 | 309, 491 | 471, 492 | 221, 493 | 636, 494 | 291, 495 | 410, 496 | 457, 497 | 422, 498 | 286, 499 | 22, 500 | 89, 501 | 666, 502 | 668, 503 | 333, 504 | 399, 505 | 355, 506 | 443, 507 | 447, 508 | 446, 509 | 316, 510 | 573, 511 | 152, 512 | 136, 513 | 4, 514 | 575, 515 | 385, 516 | 492, 517 | 207, 518 | 175, 519 | 380, 520 | 70, 521 | 458, 522 | 592, 523 | 495, 524 | 538, 525 | 551, 526 | 600, 527 | 99, 528 | 602, 529 | 300, 530 | 130, 531 | 340, 532 | 576, 533 | 496, 534 | 266, 535 | 572, 536 | 343, 537 | 331, 538 | 302, 539 | 173, 540 | 595, 541 | 672, 542 | 183, 543 | 225, 544 | 462, 545 | 546, 546 | 584, 547 | 400, 548 | 593, 549 | 257, 550 | 310, 551 | 10, 552 | 509, 553 | 348, 554 | 245, 555 | 420, 556 | 192, 557 | 564, 558 | 313, 559 | 80, 560 | 117, 561 | 252, 562 | 228, 563 | 455, 564 | 253, 565 | 71, 566 | 250, 567 | 86, 568 | 426, 569 | 142, 570 | 273, 571 | 436, 572 | 607, 573 | 416, 574 | 582, 575 | 243, 576 | 337, 577 | 8, 578 | 586, 579 | 311 580 | ], 581 | "validation": [ 582 | 140, 583 | 308, 584 | 147, 585 | 242, 586 | 304, 587 | 270, 588 | 33, 589 | 189, 590 | 179, 591 | 67, 592 | 19, 593 | 230, 594 | 37, 595 | 282, 596 | 180, 597 | 344, 598 | 351, 599 | 197, 600 | 46, 601 | 181, 602 | 373, 603 | 196, 604 | 229, 605 | 358, 606 | 334, 607 | 40, 608 | 32, 609 | 379, 610 | 75, 611 | 292, 612 | 128, 613 | 247, 614 | 246, 615 | 251, 616 | 143 617 | ], 618 | "test": [ 619 | 102, 620 | 90, 621 | 275, 622 | 111, 623 | 166, 624 | 216, 625 | 68, 626 | 158, 627 | 209, 628 | 260, 629 | 366, 630 | 240, 631 | 325, 632 | 254, 633 | 295, 634 | 362, 635 | 135, 636 | 2, 637 | 88, 638 | 274, 639 | 393, 640 | 28, 641 | 280, 642 | 261, 643 | 354, 644 | 218, 645 | 203, 646 | 106, 647 | 170, 648 | 108, 649 | 36, 650 | 205, 651 | 157, 652 | 288, 653 | 76, 654 | 278, 655 | 177, 656 | 375, 657 | 178, 658 | 206, 659 | 156, 660 | 317, 661 | 163, 662 | 16, 663 | 133, 664 | 287, 665 | 61, 666 | 370, 667 | 194, 668 | 165, 669 | 390, 670 | 92, 671 | 332, 672 | 307, 673 | 394, 674 | 164, 675 | 13, 676 | 47, 677 | 249, 678 | 78, 679 | 265, 680 | 289, 681 | 187, 682 | 113, 683 | 350 684 | ] 685 | } -------------------------------------------------------------------------------- /batches/transplanted_tiles_5_timestamp_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "train": [ 3 | 563, 4 | 413, 5 | 674, 6 | 303, 7 | 144, 8 | 616, 9 | 542, 10 | 107, 11 | 665, 12 | 167, 13 | 172, 14 | 71, 15 | 41, 16 | 18, 17 | 297, 18 | 565, 19 | 639, 20 | 505, 21 | 368, 22 | 59, 23 | 296, 24 | 115, 25 | 508, 26 | 139, 27 | 591, 28 | 628, 29 | 609, 30 | 45, 31 | 149, 32 | 447, 33 | 543, 34 | 627, 35 | 386, 36 | 77, 37 | 175, 38 | 347, 39 | 294, 40 | 581, 41 | 22, 42 | 621, 43 | 625, 44 | 424, 45 | 31, 46 | 316, 47 | 232, 48 | 342, 49 | 258, 50 | 578, 51 | 406, 52 | 490, 53 | 623, 54 | 523, 55 | 448, 56 | 79, 57 | 141, 58 | 253, 59 | 676, 60 | 558, 61 | 426, 62 | 185, 63 | 607, 64 | 440, 65 | 511, 66 | 101, 67 | 453, 68 | 330, 69 | 335, 70 | 548, 71 | 5, 72 | 119, 73 | 64, 74 | 566, 75 | 91, 76 | 14, 77 | 54, 78 | 279, 79 | 454, 80 | 574, 81 | 81, 82 | 517, 83 | 345, 84 | 432, 85 | 476, 86 | 57, 87 | 56, 88 | 496, 89 | 322, 90 | 161, 91 | 487, 92 | 283, 93 | 667, 94 | 567, 95 | 655, 96 | 312, 97 | 396, 98 | 381, 99 | 572, 100 | 512, 101 | 329, 102 | 257, 103 | 382, 104 | 152, 105 | 337, 106 | 562, 107 | 369, 108 | 502, 109 | 245, 110 | 306, 111 | 433, 112 | 573, 113 | 597, 114 | 323, 115 | 475, 116 | 380, 117 | 451, 118 | 533, 119 | 483, 120 | 116, 121 | 506, 122 | 473, 123 | 290, 124 | 94, 125 | 336, 126 | 136, 127 | 259, 128 | 518, 129 | 100, 130 | 586, 131 | 398, 132 | 529, 133 | 663, 134 | 480, 135 | 541, 136 | 613, 137 | 150, 138 | 66, 139 | 431, 140 | 26, 141 | 339, 142 | 138, 143 | 29, 144 | 340, 145 | 250, 146 | 125, 147 | 364, 148 | 60, 149 | 417, 150 | 221, 151 | 348, 152 | 151, 153 | 7, 154 | 420, 155 | 464, 156 | 399, 157 | 367, 158 | 577, 159 | 595, 160 | 559, 161 | 582, 162 | 127, 163 | 653, 164 | 268, 165 | 293, 166 | 83, 167 | 446, 168 | 248, 169 | 525, 170 | 422, 171 | 472, 172 | 331, 173 | 660, 174 | 630, 175 | 629, 176 | 237, 177 | 353, 178 | 474, 179 | 587, 180 | 43, 181 | 522, 182 | 605, 183 | 137, 184 | 482, 185 | 675, 186 | 519, 187 | 145, 188 | 410, 189 | 233, 190 | 555, 191 | 226, 192 | 441, 193 | 192, 194 | 596, 195 | 620, 196 | 662, 197 | 207, 198 | 271, 199 | 286, 200 | 50, 201 | 391, 202 | 485, 203 | 494, 204 | 626, 205 | 503, 206 | 49, 207 | 600, 208 | 408, 209 | 99, 210 | 4, 211 | 17, 212 | 415, 213 | 499, 214 | 614, 215 | 608, 216 | 580, 217 | 513, 218 | 603, 219 | 104, 220 | 204, 221 | 39, 222 | 131, 223 | 521, 224 | 266, 225 | 640, 226 | 184, 227 | 244, 228 | 423, 229 | 544, 230 | 670, 231 | 10, 232 | 458, 233 | 658, 234 | 412, 235 | 619, 236 | 255, 237 | 388, 238 | 239, 239 | 439, 240 | 142, 241 | 193, 242 | 120, 243 | 70, 244 | 437, 245 | 302, 246 | 507, 247 | 594, 248 | 272, 249 | 405, 250 | 252, 251 | 222, 252 | 199, 253 | 436, 254 | 72, 255 | 584, 256 | 134, 257 | 635, 258 | 402, 259 | 361, 260 | 173, 261 | 349, 262 | 63, 263 | 509, 264 | 651, 265 | 516, 266 | 315, 267 | 546, 268 | 659, 269 | 105, 270 | 333, 271 | 461, 272 | 122, 273 | 9, 274 | 531, 275 | 55, 276 | 328, 277 | 650, 278 | 217, 279 | 438, 280 | 414, 281 | 397, 282 | 227, 283 | 48, 284 | 211, 285 | 114, 286 | 210, 287 | 649, 288 | 560, 289 | 219, 290 | 82, 291 | 400, 292 | 530, 293 | 450, 294 | 429, 295 | 276, 296 | 672, 297 | 527, 298 | 486, 299 | 200, 300 | 392, 301 | 593, 302 | 552, 303 | 443, 304 | 668, 305 | 11, 306 | 677, 307 | 256, 308 | 469, 309 | 12, 310 | 359, 311 | 182, 312 | 21, 313 | 74, 314 | 637, 315 | 631, 316 | 281, 317 | 23, 318 | 365, 319 | 585, 320 | 445, 321 | 532, 322 | 208, 323 | 320, 324 | 352, 325 | 132, 326 | 528, 327 | 34, 328 | 65, 329 | 215, 330 | 457, 331 | 25, 332 | 52, 333 | 428, 334 | 20, 335 | 121, 336 | 262, 337 | 24, 338 | 442, 339 | 456, 340 | 514, 341 | 498, 342 | 535, 343 | 343, 344 | 549, 345 | 27, 346 | 363, 347 | 42, 348 | 341, 349 | 553, 350 | 153, 351 | 537, 352 | 588, 353 | 492, 354 | 118, 355 | 191, 356 | 500, 357 | 202, 358 | 51, 359 | 617, 360 | 515, 361 | 624, 362 | 575, 363 | 98, 364 | 491, 365 | 427, 366 | 481, 367 | 112, 368 | 556, 369 | 449, 370 | 570, 371 | 589, 372 | 648, 373 | 477, 374 | 403, 375 | 452, 376 | 86, 377 | 387, 378 | 195, 379 | 168, 380 | 463, 381 | 124, 382 | 154, 383 | 171, 384 | 176, 385 | 238, 386 | 536, 387 | 220, 388 | 299, 389 | 416, 390 | 284, 391 | 401, 392 | 374, 393 | 285, 394 | 419, 395 | 384, 396 | 148, 397 | 666, 398 | 583, 399 | 435, 400 | 371, 401 | 534, 402 | 669, 403 | 526, 404 | 62, 405 | 633, 406 | 378, 407 | 355, 408 | 488, 409 | 109, 410 | 425, 411 | 234, 412 | 38, 413 | 661, 414 | 550, 415 | 6, 416 | 459, 417 | 110, 418 | 430, 419 | 126, 420 | 130, 421 | 162, 422 | 84, 423 | 634, 424 | 15, 425 | 212, 426 | 641, 427 | 444, 428 | 300, 429 | 310, 430 | 313, 431 | 664, 432 | 277, 433 | 87, 434 | 96, 435 | 80, 436 | 174, 437 | 638, 438 | 611, 439 | 467, 440 | 604, 441 | 117, 442 | 434, 443 | 671, 444 | 376, 445 | 383, 446 | 319, 447 | 69, 448 | 504, 449 | 418, 450 | 497, 451 | 318, 452 | 146, 453 | 58, 454 | 404, 455 | 539, 456 | 610, 457 | 264, 458 | 547, 459 | 311, 460 | 214, 461 | 30, 462 | 561, 463 | 53, 464 | 377, 465 | 395, 466 | 356, 467 | 3, 468 | 407, 469 | 123, 470 | 224, 471 | 657, 472 | 673, 473 | 501, 474 | 489, 475 | 654, 476 | 298, 477 | 592, 478 | 346, 479 | 97, 480 | 44, 481 | 557, 482 | 421, 483 | 470, 484 | 493, 485 | 314, 486 | 236, 487 | 615, 488 | 231, 489 | 510, 490 | 590, 491 | 460, 492 | 545, 493 | 169, 494 | 327, 495 | 571, 496 | 465, 497 | 305, 498 | 235, 499 | 357, 500 | 466, 501 | 269, 502 | 103, 503 | 223, 504 | 73, 505 | 551, 506 | 159, 507 | 455, 508 | 243, 509 | 462, 510 | 468, 511 | 190, 512 | 188, 513 | 579, 514 | 273, 515 | 129, 516 | 564, 517 | 647, 518 | 228, 519 | 95, 520 | 267, 521 | 338, 522 | 568, 523 | 309, 524 | 372, 525 | 606, 526 | 321, 527 | 576, 528 | 520, 529 | 642, 530 | 636, 531 | 652, 532 | 645, 533 | 601, 534 | 360, 535 | 602, 536 | 301, 537 | 385, 538 | 35, 539 | 198, 540 | 186, 541 | 554, 542 | 540, 543 | 155, 544 | 183, 545 | 612, 546 | 326, 547 | 478, 548 | 598, 549 | 1, 550 | 484, 551 | 656, 552 | 622, 553 | 93, 554 | 409, 555 | 389, 556 | 618, 557 | 495, 558 | 599, 559 | 201, 560 | 479, 561 | 471, 562 | 213, 563 | 263, 564 | 644, 565 | 160, 566 | 291, 567 | 538, 568 | 89, 569 | 643, 570 | 632, 571 | 524, 572 | 324, 573 | 569, 574 | 85, 575 | 241, 576 | 225, 577 | 646, 578 | 8, 579 | 411 580 | ], 581 | "validation": [ 582 | 140, 583 | 308, 584 | 147, 585 | 242, 586 | 304, 587 | 270, 588 | 33, 589 | 189, 590 | 179, 591 | 67, 592 | 19, 593 | 230, 594 | 37, 595 | 282, 596 | 180, 597 | 344, 598 | 351, 599 | 197, 600 | 46, 601 | 181, 602 | 373, 603 | 196, 604 | 229, 605 | 358, 606 | 334, 607 | 40, 608 | 32, 609 | 379, 610 | 75, 611 | 292, 612 | 128, 613 | 247, 614 | 246, 615 | 251, 616 | 143 617 | ], 618 | "test": [ 619 | 102, 620 | 90, 621 | 275, 622 | 111, 623 | 166, 624 | 216, 625 | 68, 626 | 158, 627 | 209, 628 | 260, 629 | 366, 630 | 240, 631 | 325, 632 | 254, 633 | 295, 634 | 362, 635 | 135, 636 | 2, 637 | 88, 638 | 274, 639 | 393, 640 | 28, 641 | 280, 642 | 261, 643 | 354, 644 | 218, 645 | 203, 646 | 106, 647 | 170, 648 | 108, 649 | 36, 650 | 205, 651 | 157, 652 | 288, 653 | 76, 654 | 278, 655 | 177, 656 | 375, 657 | 178, 658 | 206, 659 | 156, 660 | 317, 661 | 163, 662 | 16, 663 | 133, 664 | 287, 665 | 61, 666 | 370, 667 | 194, 668 | 165, 669 | 390, 670 | 92, 671 | 332, 672 | 307, 673 | 394, 674 | 164, 675 | 13, 676 | 47, 677 | 249, 678 | 78, 679 | 265, 680 | 289, 681 | 187, 682 | 113, 683 | 350 684 | ] 685 | } -------------------------------------------------------------------------------- /batches/transplanted_tiles_5_timestamp_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "train": [ 3 | 377, 4 | 623, 5 | 584, 6 | 522, 7 | 485, 8 | 207, 9 | 85, 10 | 447, 11 | 62, 12 | 550, 13 | 9, 14 | 534, 15 | 49, 16 | 5, 17 | 368, 18 | 268, 19 | 401, 20 | 169, 21 | 509, 22 | 315, 23 | 592, 24 | 608, 25 | 473, 26 | 224, 27 | 200, 28 | 634, 29 | 162, 30 | 574, 31 | 72, 32 | 593, 33 | 190, 34 | 516, 35 | 478, 36 | 475, 37 | 160, 38 | 677, 39 | 487, 40 | 643, 41 | 27, 42 | 73, 43 | 22, 44 | 411, 45 | 364, 46 | 436, 47 | 474, 48 | 116, 49 | 55, 50 | 494, 51 | 284, 52 | 127, 53 | 283, 54 | 82, 55 | 668, 56 | 490, 57 | 531, 58 | 306, 59 | 159, 60 | 137, 61 | 607, 62 | 569, 63 | 337, 64 | 613, 65 | 616, 66 | 452, 67 | 663, 68 | 6, 69 | 146, 70 | 376, 71 | 42, 72 | 629, 73 | 565, 74 | 551, 75 | 665, 76 | 110, 77 | 336, 78 | 93, 79 | 529, 80 | 231, 81 | 521, 82 | 311, 83 | 458, 84 | 614, 85 | 340, 86 | 416, 87 | 59, 88 | 142, 89 | 496, 90 | 549, 91 | 161, 92 | 392, 93 | 591, 94 | 132, 95 | 94, 96 | 245, 97 | 259, 98 | 460, 99 | 145, 100 | 117, 101 | 445, 102 | 611, 103 | 14, 104 | 612, 105 | 95, 106 | 244, 107 | 505, 108 | 502, 109 | 579, 110 | 444, 111 | 442, 112 | 326, 113 | 357, 114 | 427, 115 | 35, 116 | 513, 117 | 568, 118 | 222, 119 | 233, 120 | 461, 121 | 555, 122 | 248, 123 | 434, 124 | 24, 125 | 618, 126 | 192, 127 | 656, 128 | 234, 129 | 226, 130 | 186, 131 | 653, 132 | 213, 133 | 448, 134 | 212, 135 | 356, 136 | 610, 137 | 594, 138 | 277, 139 | 537, 140 | 150, 141 | 576, 142 | 25, 143 | 637, 144 | 3, 145 | 658, 146 | 628, 147 | 441, 148 | 440, 149 | 276, 150 | 535, 151 | 327, 152 | 553, 153 | 12, 154 | 482, 155 | 281, 156 | 23, 157 | 100, 158 | 578, 159 | 432, 160 | 514, 161 | 418, 162 | 184, 163 | 438, 164 | 590, 165 | 429, 166 | 435, 167 | 472, 168 | 322, 169 | 109, 170 | 573, 171 | 66, 172 | 167, 173 | 657, 174 | 425, 175 | 329, 176 | 459, 177 | 547, 178 | 114, 179 | 476, 180 | 446, 181 | 399, 182 | 316, 183 | 286, 184 | 449, 185 | 581, 186 | 431, 187 | 210, 188 | 595, 189 | 355, 190 | 562, 191 | 408, 192 | 99, 193 | 348, 194 | 412, 195 | 501, 196 | 641, 197 | 630, 198 | 524, 199 | 512, 200 | 363, 201 | 352, 202 | 443, 203 | 223, 204 | 120, 205 | 367, 206 | 602, 207 | 599, 208 | 31, 209 | 214, 210 | 662, 211 | 204, 212 | 83, 213 | 320, 214 | 220, 215 | 538, 216 | 498, 217 | 221, 218 | 228, 219 | 298, 220 | 517, 221 | 645, 222 | 4, 223 | 387, 224 | 20, 225 | 430, 226 | 269, 227 | 676, 228 | 588, 229 | 655, 230 | 309, 231 | 533, 232 | 672, 233 | 80, 234 | 154, 235 | 199, 236 | 660, 237 | 596, 238 | 462, 239 | 520, 240 | 297, 241 | 253, 242 | 421, 243 | 217, 244 | 519, 245 | 69, 246 | 201, 247 | 622, 248 | 168, 249 | 294, 250 | 52, 251 | 575, 252 | 674, 253 | 342, 254 | 48, 255 | 566, 256 | 371, 257 | 646, 258 | 671, 259 | 615, 260 | 495, 261 | 403, 262 | 81, 263 | 34, 264 | 422, 265 | 7, 266 | 138, 267 | 383, 268 | 17, 269 | 405, 270 | 54, 271 | 391, 272 | 544, 273 | 338, 274 | 152, 275 | 632, 276 | 8, 277 | 504, 278 | 153, 279 | 125, 280 | 124, 281 | 466, 282 | 211, 283 | 139, 284 | 386, 285 | 546, 286 | 406, 287 | 273, 288 | 18, 289 | 236, 290 | 372, 291 | 477, 292 | 433, 293 | 313, 294 | 183, 295 | 413, 296 | 349, 297 | 235, 298 | 409, 299 | 141, 300 | 84, 301 | 577, 302 | 51, 303 | 227, 304 | 374, 305 | 450, 306 | 540, 307 | 587, 308 | 148, 309 | 335, 310 | 60, 311 | 470, 312 | 636, 313 | 523, 314 | 101, 315 | 97, 316 | 134, 317 | 318, 318 | 582, 319 | 56, 320 | 43, 321 | 129, 322 | 239, 323 | 456, 324 | 664, 325 | 250, 326 | 174, 327 | 262, 328 | 640, 329 | 606, 330 | 296, 331 | 121, 332 | 484, 333 | 526, 334 | 647, 335 | 339, 336 | 328, 337 | 30, 338 | 188, 339 | 560, 340 | 559, 341 | 144, 342 | 380, 343 | 620, 344 | 499, 345 | 385, 346 | 417, 347 | 324, 348 | 105, 349 | 384, 350 | 510, 351 | 410, 352 | 360, 353 | 543, 354 | 654, 355 | 272, 356 | 558, 357 | 378, 358 | 303, 359 | 493, 360 | 644, 361 | 15, 362 | 104, 363 | 601, 364 | 621, 365 | 39, 366 | 215, 367 | 424, 368 | 625, 369 | 669, 370 | 118, 371 | 176, 372 | 561, 373 | 130, 374 | 638, 375 | 469, 376 | 38, 377 | 45, 378 | 290, 379 | 626, 380 | 343, 381 | 71, 382 | 395, 383 | 400, 384 | 53, 385 | 382, 386 | 532, 387 | 271, 388 | 79, 389 | 87, 390 | 642, 391 | 597, 392 | 570, 393 | 556, 394 | 572, 395 | 300, 396 | 310, 397 | 627, 398 | 136, 399 | 527, 400 | 299, 401 | 415, 402 | 89, 403 | 471, 404 | 420, 405 | 70, 406 | 266, 407 | 50, 408 | 98, 409 | 1, 410 | 397, 411 | 491, 412 | 423, 413 | 319, 414 | 651, 415 | 96, 416 | 258, 417 | 173, 418 | 257, 419 | 541, 420 | 331, 421 | 264, 422 | 381, 423 | 486, 424 | 479, 425 | 219, 426 | 175, 427 | 65, 428 | 463, 429 | 369, 430 | 457, 431 | 237, 432 | 545, 433 | 609, 434 | 518, 435 | 554, 436 | 480, 437 | 279, 438 | 464, 439 | 454, 440 | 126, 441 | 155, 442 | 301, 443 | 198, 444 | 453, 445 | 648, 446 | 564, 447 | 617, 448 | 511, 449 | 131, 450 | 506, 451 | 185, 452 | 232, 453 | 396, 454 | 525, 455 | 675, 456 | 414, 457 | 530, 458 | 119, 459 | 252, 460 | 439, 461 | 539, 462 | 583, 463 | 26, 464 | 312, 465 | 21, 466 | 64, 467 | 598, 468 | 267, 469 | 365, 470 | 333, 471 | 149, 472 | 151, 473 | 500, 474 | 208, 475 | 263, 476 | 557, 477 | 123, 478 | 489, 479 | 542, 480 | 112, 481 | 650, 482 | 604, 483 | 402, 484 | 483, 485 | 659, 486 | 86, 487 | 361, 488 | 91, 489 | 633, 490 | 285, 491 | 652, 492 | 419, 493 | 567, 494 | 302, 495 | 321, 496 | 359, 497 | 437, 498 | 171, 499 | 528, 500 | 103, 501 | 57, 502 | 667, 503 | 256, 504 | 670, 505 | 243, 506 | 323, 507 | 74, 508 | 407, 509 | 639, 510 | 195, 511 | 241, 512 | 468, 513 | 673, 514 | 548, 515 | 11, 516 | 661, 517 | 191, 518 | 305, 519 | 488, 520 | 10, 521 | 193, 522 | 666, 523 | 586, 524 | 122, 525 | 536, 526 | 552, 527 | 563, 528 | 389, 529 | 451, 530 | 649, 531 | 507, 532 | 63, 533 | 600, 534 | 398, 535 | 107, 536 | 293, 537 | 291, 538 | 58, 539 | 428, 540 | 580, 541 | 571, 542 | 481, 543 | 515, 544 | 353, 545 | 29, 546 | 115, 547 | 346, 548 | 503, 549 | 225, 550 | 492, 551 | 345, 552 | 347, 553 | 238, 554 | 589, 555 | 182, 556 | 467, 557 | 172, 558 | 497, 559 | 314, 560 | 635, 561 | 605, 562 | 41, 563 | 388, 564 | 202, 565 | 631, 566 | 255, 567 | 508, 568 | 404, 569 | 619, 570 | 77, 571 | 455, 572 | 624, 573 | 341, 574 | 330, 575 | 426, 576 | 603, 577 | 585, 578 | 44, 579 | 465 580 | ], 581 | "validation": [ 582 | 140, 583 | 308, 584 | 147, 585 | 242, 586 | 304, 587 | 270, 588 | 33, 589 | 189, 590 | 179, 591 | 67, 592 | 19, 593 | 230, 594 | 37, 595 | 282, 596 | 180, 597 | 344, 598 | 351, 599 | 197, 600 | 46, 601 | 181, 602 | 373, 603 | 196, 604 | 229, 605 | 358, 606 | 334, 607 | 40, 608 | 32, 609 | 379, 610 | 75, 611 | 292, 612 | 128, 613 | 247, 614 | 246, 615 | 251, 616 | 143 617 | ], 618 | "test": [ 619 | 102, 620 | 90, 621 | 275, 622 | 111, 623 | 166, 624 | 216, 625 | 68, 626 | 158, 627 | 209, 628 | 260, 629 | 366, 630 | 240, 631 | 325, 632 | 254, 633 | 295, 634 | 362, 635 | 135, 636 | 2, 637 | 88, 638 | 274, 639 | 393, 640 | 28, 641 | 280, 642 | 261, 643 | 354, 644 | 218, 645 | 203, 646 | 106, 647 | 170, 648 | 108, 649 | 36, 650 | 205, 651 | 157, 652 | 288, 653 | 76, 654 | 278, 655 | 177, 656 | 375, 657 | 178, 658 | 206, 659 | 156, 660 | 317, 661 | 163, 662 | 16, 663 | 133, 664 | 287, 665 | 61, 666 | 370, 667 | 194, 668 | 165, 669 | 390, 670 | 92, 671 | 332, 672 | 307, 673 | 394, 674 | 164, 675 | 13, 676 | 47, 677 | 249, 678 | 78, 679 | 265, 680 | 289, 681 | 187, 682 | 113, 683 | 350 684 | ] 685 | } -------------------------------------------------------------------------------- /batches/transplanted_tiles_10_timestamp_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "train": [ 3 | 15, 4 | 461, 5 | 385, 6 | 692, 7 | 532, 8 | 87, 9 | 495, 10 | 579, 11 | 70, 12 | 329, 13 | 603, 14 | 168, 15 | 339, 16 | 243, 17 | 175, 18 | 312, 19 | 484, 20 | 48, 21 | 662, 22 | 525, 23 | 257, 24 | 303, 25 | 442, 26 | 600, 27 | 226, 28 | 410, 29 | 296, 30 | 161, 31 | 172, 32 | 346, 33 | 506, 34 | 286, 35 | 399, 36 | 574, 37 | 290, 38 | 409, 39 | 122, 40 | 364, 41 | 159, 42 | 523, 43 | 542, 44 | 348, 45 | 669, 46 | 421, 47 | 426, 48 | 89, 49 | 498, 50 | 217, 51 | 352, 52 | 543, 53 | 103, 54 | 391, 55 | 283, 56 | 371, 57 | 244, 58 | 482, 59 | 272, 60 | 336, 61 | 6, 62 | 625, 63 | 602, 64 | 589, 65 | 429, 66 | 615, 67 | 469, 68 | 193, 69 | 141, 70 | 456, 71 | 659, 72 | 408, 73 | 566, 74 | 73, 75 | 617, 76 | 526, 77 | 686, 78 | 621, 79 | 440, 80 | 27, 81 | 12, 82 | 9, 83 | 599, 84 | 430, 85 | 129, 86 | 11, 87 | 149, 88 | 326, 89 | 568, 90 | 491, 91 | 510, 92 | 64, 93 | 651, 94 | 396, 95 | 110, 96 | 605, 97 | 501, 98 | 583, 99 | 80, 100 | 324, 101 | 330, 102 | 658, 103 | 489, 104 | 404, 105 | 685, 106 | 8, 107 | 528, 108 | 49, 109 | 620, 110 | 639, 111 | 457, 112 | 376, 113 | 294, 114 | 118, 115 | 472, 116 | 220, 117 | 148, 118 | 69, 119 | 145, 120 | 337, 121 | 281, 122 | 473, 123 | 597, 124 | 59, 125 | 427, 126 | 656, 127 | 225, 128 | 268, 129 | 425, 130 | 428, 131 | 565, 132 | 119, 133 | 697, 134 | 171, 135 | 418, 136 | 124, 137 | 559, 138 | 14, 139 | 632, 140 | 305, 141 | 407, 142 | 563, 143 | 387, 144 | 419, 145 | 592, 146 | 66, 147 | 453, 148 | 284, 149 | 306, 150 | 571, 151 | 416, 152 | 553, 153 | 241, 154 | 174, 155 | 433, 156 | 694, 157 | 585, 158 | 436, 159 | 154, 160 | 185, 161 | 184, 162 | 262, 163 | 44, 164 | 121, 165 | 467, 166 | 116, 167 | 188, 168 | 60, 169 | 554, 170 | 235, 171 | 114, 172 | 512, 173 | 105, 174 | 454, 175 | 609, 176 | 150, 177 | 96, 178 | 660, 179 | 688, 180 | 657, 181 | 499, 182 | 452, 183 | 259, 184 | 91, 185 | 65, 186 | 619, 187 | 363, 188 | 558, 189 | 687, 190 | 679, 191 | 97, 192 | 343, 193 | 258, 194 | 388, 195 | 383, 196 | 263, 197 | 202, 198 | 544, 199 | 447, 200 | 490, 201 | 463, 202 | 413, 203 | 546, 204 | 573, 205 | 320, 206 | 318, 207 | 233, 208 | 666, 209 | 22, 210 | 664, 211 | 570, 212 | 630, 213 | 315, 214 | 411, 215 | 81, 216 | 509, 217 | 356, 218 | 417, 219 | 112, 220 | 533, 221 | 598, 222 | 645, 223 | 560, 224 | 169, 225 | 86, 226 | 548, 227 | 201, 228 | 672, 229 | 52, 230 | 497, 231 | 63, 232 | 545, 233 | 665, 234 | 518, 235 | 682, 236 | 519, 237 | 539, 238 | 448, 239 | 29, 240 | 406, 241 | 618, 242 | 369, 243 | 466, 244 | 678, 245 | 537, 246 | 547, 247 | 94, 248 | 610, 249 | 53, 250 | 127, 251 | 195, 252 | 424, 253 | 204, 254 | 160, 255 | 439, 256 | 513, 257 | 626, 258 | 313, 259 | 446, 260 | 374, 261 | 561, 262 | 606, 263 | 613, 264 | 444, 265 | 655, 266 | 297, 267 | 250, 268 | 601, 269 | 474, 270 | 384, 271 | 322, 272 | 633, 273 | 607, 274 | 93, 275 | 648, 276 | 353, 277 | 552, 278 | 291, 279 | 26, 280 | 441, 281 | 459, 282 | 10, 283 | 311, 284 | 382, 285 | 213, 286 | 182, 287 | 627, 288 | 668, 289 | 475, 290 | 485, 291 | 264, 292 | 340, 293 | 492, 294 | 471, 295 | 634, 296 | 239, 297 | 327, 298 | 95, 299 | 345, 300 | 221, 301 | 653, 302 | 50, 303 | 266, 304 | 237, 305 | 540, 306 | 232, 307 | 248, 308 | 493, 309 | 476, 310 | 663, 311 | 276, 312 | 104, 313 | 480, 314 | 520, 315 | 183, 316 | 255, 317 | 622, 318 | 586, 319 | 693, 320 | 644, 321 | 82, 322 | 646, 323 | 208, 324 | 556, 325 | 695, 326 | 500, 327 | 132, 328 | 136, 329 | 596, 330 | 541, 331 | 56, 332 | 590, 333 | 415, 334 | 567, 335 | 85, 336 | 153, 337 | 591, 338 | 420, 339 | 323, 340 | 588, 341 | 35, 342 | 631, 343 | 45, 344 | 576, 345 | 675, 346 | 236, 347 | 41, 348 | 403, 349 | 654, 350 | 381, 351 | 611, 352 | 71, 353 | 321, 354 | 365, 355 | 443, 356 | 650, 357 | 604, 358 | 357, 359 | 299, 360 | 431, 361 | 389, 362 | 215, 363 | 310, 364 | 673, 365 | 31, 366 | 338, 367 | 529, 368 | 222, 369 | 486, 370 | 77, 371 | 614, 372 | 616, 373 | 683, 374 | 674, 375 | 152, 376 | 593, 377 | 578, 378 | 378, 379 | 377, 380 | 628, 381 | 584, 382 | 138, 383 | 359, 384 | 643, 385 | 51, 386 | 267, 387 | 301, 388 | 207, 389 | 34, 390 | 190, 391 | 641, 392 | 335, 393 | 680, 394 | 564, 395 | 211, 396 | 273, 397 | 483, 398 | 451, 399 | 637, 400 | 582, 401 | 670, 402 | 689, 403 | 30, 404 | 328, 405 | 252, 406 | 361, 407 | 117, 408 | 151, 409 | 223, 410 | 173, 411 | 107, 412 | 134, 413 | 200, 414 | 146, 415 | 516, 416 | 580, 417 | 455, 418 | 661, 419 | 43, 420 | 608, 421 | 677, 422 | 224, 423 | 109, 424 | 125, 425 | 402, 426 | 214, 427 | 400, 428 | 458, 429 | 24, 430 | 549, 431 | 279, 432 | 83, 433 | 527, 434 | 594, 435 | 623, 436 | 293, 437 | 487, 438 | 256, 439 | 638, 440 | 58, 441 | 333, 442 | 470, 443 | 130, 444 | 342, 445 | 115, 446 | 505, 447 | 192, 448 | 478, 449 | 401, 450 | 572, 451 | 186, 452 | 530, 453 | 212, 454 | 120, 455 | 422, 456 | 57, 457 | 191, 458 | 435, 459 | 612, 460 | 405, 461 | 238, 462 | 640, 463 | 4, 464 | 271, 465 | 131, 466 | 5, 467 | 691, 468 | 319, 469 | 368, 470 | 210, 471 | 137, 472 | 227, 473 | 234, 474 | 17, 475 | 676, 476 | 144, 477 | 72, 478 | 449, 479 | 511, 480 | 536, 481 | 302, 482 | 647, 483 | 517, 484 | 228, 485 | 42, 486 | 392, 487 | 432, 488 | 79, 489 | 372, 490 | 521, 491 | 636, 492 | 624, 493 | 412, 494 | 298, 495 | 23, 496 | 123, 497 | 575, 498 | 642, 499 | 508, 500 | 464, 501 | 535, 502 | 652, 503 | 629, 504 | 355, 505 | 231, 506 | 341, 507 | 74, 508 | 524, 509 | 684, 510 | 395, 511 | 285, 512 | 55, 513 | 142, 514 | 434, 515 | 84, 516 | 98, 517 | 380, 518 | 198, 519 | 595, 520 | 54, 521 | 437, 522 | 667, 523 | 162, 524 | 438, 525 | 25, 526 | 551, 527 | 531, 528 | 176, 529 | 550, 530 | 38, 531 | 155, 532 | 99, 533 | 386, 534 | 167, 535 | 468, 536 | 462, 537 | 349, 538 | 100, 539 | 126, 540 | 62, 541 | 219, 542 | 18, 543 | 507, 544 | 477, 545 | 496, 546 | 555, 547 | 398, 548 | 253, 549 | 481, 550 | 460, 551 | 139, 552 | 39, 553 | 649, 554 | 503, 555 | 101, 556 | 479, 557 | 367, 558 | 445, 559 | 562, 560 | 7, 561 | 504, 562 | 331, 563 | 423, 564 | 494, 565 | 277, 566 | 635, 567 | 269, 568 | 300, 569 | 309, 570 | 681, 571 | 316, 572 | 577, 573 | 20, 574 | 502, 575 | 199, 576 | 360, 577 | 488, 578 | 21, 579 | 465, 580 | 522, 581 | 534, 582 | 538, 583 | 515, 584 | 450, 585 | 245, 586 | 1, 587 | 314, 588 | 587, 589 | 671, 590 | 569, 591 | 514, 592 | 397, 593 | 414, 594 | 690, 595 | 581, 596 | 347, 597 | 3, 598 | 696, 599 | 557 600 | ], 601 | "validation": [ 602 | 140, 603 | 308, 604 | 147, 605 | 242, 606 | 304, 607 | 270, 608 | 33, 609 | 189, 610 | 179, 611 | 67, 612 | 19, 613 | 230, 614 | 37, 615 | 282, 616 | 180, 617 | 344, 618 | 351, 619 | 197, 620 | 46, 621 | 181, 622 | 373, 623 | 196, 624 | 229, 625 | 358, 626 | 334, 627 | 40, 628 | 32, 629 | 379, 630 | 75, 631 | 292, 632 | 128, 633 | 247, 634 | 246, 635 | 251, 636 | 143 637 | ], 638 | "test": [ 639 | 102, 640 | 90, 641 | 275, 642 | 111, 643 | 166, 644 | 216, 645 | 68, 646 | 158, 647 | 209, 648 | 260, 649 | 366, 650 | 240, 651 | 325, 652 | 254, 653 | 295, 654 | 362, 655 | 135, 656 | 2, 657 | 88, 658 | 274, 659 | 393, 660 | 28, 661 | 280, 662 | 261, 663 | 354, 664 | 218, 665 | 203, 666 | 106, 667 | 170, 668 | 108, 669 | 36, 670 | 205, 671 | 157, 672 | 288, 673 | 76, 674 | 278, 675 | 177, 676 | 375, 677 | 178, 678 | 206, 679 | 156, 680 | 317, 681 | 163, 682 | 16, 683 | 133, 684 | 287, 685 | 61, 686 | 370, 687 | 194, 688 | 165, 689 | 390, 690 | 92, 691 | 332, 692 | 307, 693 | 394, 694 | 164, 695 | 13, 696 | 47, 697 | 249, 698 | 78, 699 | 265, 700 | 289, 701 | 187, 702 | 113, 703 | 350 704 | ] 705 | } -------------------------------------------------------------------------------- /batches/transplanted_tiles_10_timestamp_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "train": [ 3 | 3, 4 | 499, 5 | 277, 6 | 693, 7 | 172, 8 | 668, 9 | 168, 10 | 294, 11 | 580, 12 | 502, 13 | 678, 14 | 527, 15 | 124, 16 | 273, 17 | 481, 18 | 506, 19 | 400, 20 | 556, 21 | 478, 22 | 284, 23 | 183, 24 | 319, 25 | 25, 26 | 569, 27 | 651, 28 | 42, 29 | 432, 30 | 243, 31 | 567, 32 | 142, 33 | 624, 34 | 132, 35 | 335, 36 | 193, 37 | 643, 38 | 581, 39 | 528, 40 | 586, 41 | 79, 42 | 4, 43 | 160, 44 | 397, 45 | 244, 46 | 72, 47 | 64, 48 | 627, 49 | 155, 50 | 444, 51 | 215, 52 | 464, 53 | 477, 54 | 617, 55 | 468, 56 | 457, 57 | 83, 58 | 516, 59 | 146, 60 | 312, 61 | 495, 62 | 357, 63 | 371, 64 | 603, 65 | 80, 66 | 438, 67 | 129, 68 | 529, 69 | 213, 70 | 662, 71 | 353, 72 | 15, 73 | 305, 74 | 686, 75 | 110, 76 | 311, 77 | 56, 78 | 469, 79 | 565, 80 | 346, 81 | 245, 82 | 127, 83 | 318, 84 | 355, 85 | 595, 86 | 475, 87 | 445, 88 | 367, 89 | 384, 90 | 544, 91 | 173, 92 | 7, 93 | 99, 94 | 35, 95 | 255, 96 | 590, 97 | 631, 98 | 237, 99 | 219, 100 | 39, 101 | 11, 102 | 192, 103 | 149, 104 | 276, 105 | 570, 106 | 526, 107 | 320, 108 | 314, 109 | 459, 110 | 558, 111 | 232, 112 | 5, 113 | 191, 114 | 587, 115 | 673, 116 | 652, 117 | 433, 118 | 145, 119 | 684, 120 | 159, 121 | 380, 122 | 347, 123 | 348, 124 | 596, 125 | 363, 126 | 641, 127 | 568, 128 | 658, 129 | 496, 130 | 204, 131 | 664, 132 | 492, 133 | 654, 134 | 638, 135 | 574, 136 | 626, 137 | 369, 138 | 139, 139 | 579, 140 | 448, 141 | 329, 142 | 691, 143 | 490, 144 | 521, 145 | 463, 146 | 661, 147 | 235, 148 | 456, 149 | 583, 150 | 612, 151 | 666, 152 | 644, 153 | 34, 154 | 592, 155 | 441, 156 | 660, 157 | 48, 158 | 406, 159 | 55, 160 | 233, 161 | 449, 162 | 450, 163 | 650, 164 | 87, 165 | 1, 166 | 559, 167 | 364, 168 | 200, 169 | 605, 170 | 286, 171 | 279, 172 | 657, 173 | 694, 174 | 512, 175 | 476, 176 | 470, 177 | 423, 178 | 217, 179 | 613, 180 | 315, 181 | 138, 182 | 659, 183 | 440, 184 | 60, 185 | 665, 186 | 268, 187 | 333, 188 | 531, 189 | 548, 190 | 525, 191 | 425, 192 | 575, 193 | 151, 194 | 566, 195 | 77, 196 | 633, 197 | 391, 198 | 378, 199 | 685, 200 | 211, 201 | 117, 202 | 259, 203 | 281, 204 | 137, 205 | 208, 206 | 112, 207 | 220, 208 | 473, 209 | 536, 210 | 409, 211 | 398, 212 | 62, 213 | 419, 214 | 501, 215 | 195, 216 | 290, 217 | 96, 218 | 564, 219 | 126, 220 | 533, 221 | 683, 222 | 462, 223 | 392, 224 | 500, 225 | 185, 226 | 606, 227 | 479, 228 | 621, 229 | 105, 230 | 405, 231 | 629, 232 | 266, 233 | 93, 234 | 578, 235 | 635, 236 | 439, 237 | 171, 238 | 59, 239 | 671, 240 | 169, 241 | 690, 242 | 184, 243 | 316, 244 | 227, 245 | 467, 246 | 114, 247 | 337, 248 | 313, 249 | 681, 250 | 630, 251 | 474, 252 | 622, 253 | 538, 254 | 573, 255 | 414, 256 | 297, 257 | 120, 258 | 451, 259 | 437, 260 | 125, 261 | 296, 262 | 385, 263 | 519, 264 | 431, 265 | 248, 266 | 472, 267 | 551, 268 | 424, 269 | 452, 270 | 410, 271 | 517, 272 | 404, 273 | 408, 274 | 54, 275 | 22, 276 | 52, 277 | 309, 278 | 591, 279 | 416, 280 | 540, 281 | 263, 282 | 648, 283 | 361, 284 | 345, 285 | 356, 286 | 14, 287 | 446, 288 | 503, 289 | 561, 290 | 365, 291 | 383, 292 | 680, 293 | 303, 294 | 611, 295 | 352, 296 | 489, 297 | 228, 298 | 543, 299 | 29, 300 | 43, 301 | 74, 302 | 458, 303 | 399, 304 | 214, 305 | 647, 306 | 368, 307 | 210, 308 | 430, 309 | 669, 310 | 482, 311 | 670, 312 | 522, 313 | 153, 314 | 376, 315 | 130, 316 | 572, 317 | 628, 318 | 518, 319 | 271, 320 | 97, 321 | 616, 322 | 283, 323 | 625, 324 | 554, 325 | 598, 326 | 679, 327 | 387, 328 | 555, 329 | 104, 330 | 21, 331 | 17, 332 | 599, 333 | 198, 334 | 576, 335 | 593, 336 | 396, 337 | 562, 338 | 63, 339 | 9, 340 | 58, 341 | 343, 342 | 607, 343 | 687, 344 | 614, 345 | 81, 346 | 202, 347 | 530, 348 | 186, 349 | 442, 350 | 18, 351 | 395, 352 | 466, 353 | 41, 354 | 515, 355 | 639, 356 | 222, 357 | 594, 358 | 24, 359 | 50, 360 | 331, 361 | 443, 362 | 359, 363 | 497, 364 | 293, 365 | 510, 366 | 632, 367 | 640, 368 | 402, 369 | 116, 370 | 542, 371 | 91, 372 | 360, 373 | 539, 374 | 70, 375 | 532, 376 | 428, 377 | 546, 378 | 696, 379 | 152, 380 | 45, 381 | 677, 382 | 524, 383 | 190, 384 | 323, 385 | 688, 386 | 483, 387 | 460, 388 | 619, 389 | 328, 390 | 403, 391 | 302, 392 | 454, 393 | 577, 394 | 571, 395 | 494, 396 | 182, 397 | 239, 398 | 339, 399 | 269, 400 | 488, 401 | 663, 402 | 656, 403 | 623, 404 | 487, 405 | 300, 406 | 485, 407 | 547, 408 | 324, 409 | 676, 410 | 291, 411 | 447, 412 | 122, 413 | 51, 414 | 667, 415 | 634, 416 | 602, 417 | 541, 418 | 582, 419 | 609, 420 | 6, 421 | 697, 422 | 26, 423 | 372, 424 | 338, 425 | 505, 426 | 550, 427 | 100, 428 | 188, 429 | 486, 430 | 86, 431 | 310, 432 | 258, 433 | 491, 434 | 563, 435 | 20, 436 | 655, 437 | 674, 438 | 552, 439 | 103, 440 | 101, 441 | 557, 442 | 511, 443 | 31, 444 | 109, 445 | 427, 446 | 257, 447 | 144, 448 | 98, 449 | 176, 450 | 301, 451 | 252, 452 | 10, 453 | 653, 454 | 306, 455 | 377, 456 | 508, 457 | 123, 458 | 115, 459 | 420, 460 | 82, 461 | 585, 462 | 349, 463 | 238, 464 | 262, 465 | 520, 466 | 69, 467 | 645, 468 | 618, 469 | 600, 470 | 8, 471 | 509, 472 | 71, 473 | 267, 474 | 85, 475 | 480, 476 | 649, 477 | 381, 478 | 141, 479 | 264, 480 | 588, 481 | 646, 482 | 340, 483 | 212, 484 | 537, 485 | 226, 486 | 493, 487 | 620, 488 | 223, 489 | 434, 490 | 161, 491 | 57, 492 | 327, 493 | 201, 494 | 199, 495 | 461, 496 | 326, 497 | 453, 498 | 66, 499 | 154, 500 | 615, 501 | 231, 502 | 610, 503 | 23, 504 | 272, 505 | 426, 506 | 30, 507 | 241, 508 | 689, 509 | 436, 510 | 507, 511 | 65, 512 | 94, 513 | 256, 514 | 471, 515 | 401, 516 | 418, 517 | 162, 518 | 150, 519 | 642, 520 | 73, 521 | 413, 522 | 225, 523 | 118, 524 | 417, 525 | 484, 526 | 174, 527 | 523, 528 | 89, 529 | 553, 530 | 455, 531 | 253, 532 | 534, 533 | 429, 534 | 389, 535 | 285, 536 | 636, 537 | 136, 538 | 637, 539 | 411, 540 | 407, 541 | 121, 542 | 584, 543 | 322, 544 | 412, 545 | 131, 546 | 597, 547 | 250, 548 | 421, 549 | 175, 550 | 513, 551 | 535, 552 | 504, 553 | 682, 554 | 549, 555 | 601, 556 | 422, 557 | 465, 558 | 560, 559 | 148, 560 | 342, 561 | 675, 562 | 604, 563 | 167, 564 | 336, 565 | 44, 566 | 207, 567 | 498, 568 | 695, 569 | 382, 570 | 107, 571 | 95, 572 | 374, 573 | 415, 574 | 692, 575 | 388, 576 | 234, 577 | 27, 578 | 221, 579 | 53, 580 | 134, 581 | 386, 582 | 298, 583 | 12, 584 | 84, 585 | 514, 586 | 119, 587 | 435, 588 | 299, 589 | 608, 590 | 589, 591 | 330, 592 | 672, 593 | 341, 594 | 236, 595 | 49, 596 | 38, 597 | 321, 598 | 224, 599 | 545 600 | ], 601 | "validation": [ 602 | 140, 603 | 308, 604 | 147, 605 | 242, 606 | 304, 607 | 270, 608 | 33, 609 | 189, 610 | 179, 611 | 67, 612 | 19, 613 | 230, 614 | 37, 615 | 282, 616 | 180, 617 | 344, 618 | 351, 619 | 197, 620 | 46, 621 | 181, 622 | 373, 623 | 196, 624 | 229, 625 | 358, 626 | 334, 627 | 40, 628 | 32, 629 | 379, 630 | 75, 631 | 292, 632 | 128, 633 | 247, 634 | 246, 635 | 251, 636 | 143 637 | ], 638 | "test": [ 639 | 102, 640 | 90, 641 | 275, 642 | 111, 643 | 166, 644 | 216, 645 | 68, 646 | 158, 647 | 209, 648 | 260, 649 | 366, 650 | 240, 651 | 325, 652 | 254, 653 | 295, 654 | 362, 655 | 135, 656 | 2, 657 | 88, 658 | 274, 659 | 393, 660 | 28, 661 | 280, 662 | 261, 663 | 354, 664 | 218, 665 | 203, 666 | 106, 667 | 170, 668 | 108, 669 | 36, 670 | 205, 671 | 157, 672 | 288, 673 | 76, 674 | 278, 675 | 177, 676 | 375, 677 | 178, 678 | 206, 679 | 156, 680 | 317, 681 | 163, 682 | 16, 683 | 133, 684 | 287, 685 | 61, 686 | 370, 687 | 194, 688 | 165, 689 | 390, 690 | 92, 691 | 332, 692 | 307, 693 | 394, 694 | 164, 695 | 13, 696 | 47, 697 | 249, 698 | 78, 699 | 265, 700 | 289, 701 | 187, 702 | 113, 703 | 350 704 | ] 705 | } -------------------------------------------------------------------------------- /batches/transplanted_tiles_10_timestamp_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "train": [ 3 | 353, 4 | 604, 5 | 406, 6 | 54, 7 | 635, 8 | 642, 9 | 697, 10 | 657, 11 | 548, 12 | 550, 13 | 91, 14 | 42, 15 | 501, 16 | 405, 17 | 505, 18 | 696, 19 | 503, 20 | 190, 21 | 293, 22 | 272, 23 | 314, 24 | 315, 25 | 623, 26 | 97, 27 | 192, 28 | 630, 29 | 504, 30 | 51, 31 | 537, 32 | 457, 33 | 532, 34 | 560, 35 | 302, 36 | 159, 37 | 424, 38 | 121, 39 | 461, 40 | 496, 41 | 323, 42 | 562, 43 | 463, 44 | 290, 45 | 477, 46 | 349, 47 | 404, 48 | 188, 49 | 89, 50 | 564, 51 | 357, 52 | 438, 53 | 469, 54 | 48, 55 | 285, 56 | 400, 57 | 322, 58 | 222, 59 | 410, 60 | 409, 61 | 93, 62 | 444, 63 | 649, 64 | 22, 65 | 253, 66 | 619, 67 | 105, 68 | 257, 69 | 671, 70 | 52, 71 | 638, 72 | 279, 73 | 652, 74 | 101, 75 | 571, 76 | 627, 77 | 343, 78 | 517, 79 | 397, 80 | 297, 81 | 38, 82 | 327, 83 | 581, 84 | 81, 85 | 191, 86 | 489, 87 | 65, 88 | 487, 89 | 651, 90 | 687, 91 | 245, 92 | 185, 93 | 460, 94 | 9, 95 | 518, 96 | 574, 97 | 423, 98 | 421, 99 | 283, 100 | 55, 101 | 598, 102 | 497, 103 | 668, 104 | 403, 105 | 582, 106 | 448, 107 | 694, 108 | 682, 109 | 172, 110 | 464, 111 | 479, 112 | 71, 113 | 629, 114 | 310, 115 | 369, 116 | 79, 117 | 484, 118 | 645, 119 | 80, 120 | 328, 121 | 515, 122 | 458, 123 | 211, 124 | 125, 125 | 262, 126 | 161, 127 | 399, 128 | 678, 129 | 330, 130 | 151, 131 | 60, 132 | 87, 133 | 146, 134 | 225, 135 | 118, 136 | 483, 137 | 31, 138 | 595, 139 | 391, 140 | 24, 141 | 408, 142 | 360, 143 | 162, 144 | 347, 145 | 136, 146 | 263, 147 | 643, 148 | 259, 149 | 426, 150 | 558, 151 | 625, 152 | 114, 153 | 528, 154 | 542, 155 | 18, 156 | 453, 157 | 291, 158 | 300, 159 | 628, 160 | 512, 161 | 139, 162 | 372, 163 | 25, 164 | 552, 165 | 433, 166 | 535, 167 | 152, 168 | 130, 169 | 30, 170 | 202, 171 | 514, 172 | 228, 173 | 83, 174 | 531, 175 | 85, 176 | 160, 177 | 468, 178 | 49, 179 | 646, 180 | 175, 181 | 171, 182 | 345, 183 | 519, 184 | 132, 185 | 474, 186 | 600, 187 | 258, 188 | 431, 189 | 385, 190 | 154, 191 | 320, 192 | 119, 193 | 401, 194 | 348, 195 | 540, 196 | 658, 197 | 115, 198 | 555, 199 | 673, 200 | 621, 201 | 436, 202 | 235, 203 | 429, 204 | 234, 205 | 669, 206 | 447, 207 | 661, 208 | 471, 209 | 637, 210 | 20, 211 | 241, 212 | 686, 213 | 264, 214 | 56, 215 | 23, 216 | 137, 217 | 17, 218 | 428, 219 | 255, 220 | 523, 221 | 511, 222 | 624, 223 | 420, 224 | 425, 225 | 129, 226 | 110, 227 | 538, 228 | 215, 229 | 676, 230 | 653, 231 | 303, 232 | 616, 233 | 150, 234 | 602, 235 | 77, 236 | 494, 237 | 208, 238 | 591, 239 | 39, 240 | 3, 241 | 298, 242 | 587, 243 | 305, 244 | 338, 245 | 392, 246 | 689, 247 | 446, 248 | 492, 249 | 252, 250 | 309, 251 | 271, 252 | 648, 253 | 62, 254 | 377, 255 | 547, 256 | 427, 257 | 233, 258 | 195, 259 | 452, 260 | 622, 261 | 525, 262 | 342, 263 | 554, 264 | 148, 265 | 384, 266 | 104, 267 | 568, 268 | 507, 269 | 107, 270 | 6, 271 | 626, 272 | 224, 273 | 690, 274 | 318, 275 | 685, 276 | 59, 277 | 138, 278 | 557, 279 | 500, 280 | 579, 281 | 522, 282 | 570, 283 | 321, 284 | 299, 285 | 145, 286 | 596, 287 | 8, 288 | 412, 289 | 200, 290 | 413, 291 | 681, 292 | 640, 293 | 601, 294 | 238, 295 | 513, 296 | 256, 297 | 248, 298 | 117, 299 | 226, 300 | 109, 301 | 43, 302 | 437, 303 | 27, 304 | 577, 305 | 144, 306 | 569, 307 | 45, 308 | 544, 309 | 417, 310 | 66, 311 | 72, 312 | 35, 313 | 313, 314 | 536, 315 | 605, 316 | 96, 317 | 141, 318 | 112, 319 | 213, 320 | 586, 321 | 465, 322 | 337, 323 | 551, 324 | 618, 325 | 656, 326 | 311, 327 | 53, 328 | 633, 329 | 368, 330 | 219, 331 | 432, 332 | 411, 333 | 416, 334 | 506, 335 | 498, 336 | 559, 337 | 480, 338 | 634, 339 | 466, 340 | 378, 341 | 217, 342 | 339, 343 | 693, 344 | 510, 345 | 64, 346 | 692, 347 | 11, 348 | 5, 349 | 99, 350 | 450, 351 | 617, 352 | 41, 353 | 276, 354 | 168, 355 | 499, 356 | 94, 357 | 584, 358 | 430, 359 | 695, 360 | 4, 361 | 319, 362 | 603, 363 | 606, 364 | 58, 365 | 176, 366 | 7, 367 | 541, 368 | 449, 369 | 597, 370 | 529, 371 | 236, 372 | 609, 373 | 563, 374 | 21, 375 | 509, 376 | 284, 377 | 363, 378 | 546, 379 | 44, 380 | 592, 381 | 573, 382 | 660, 383 | 383, 384 | 267, 385 | 442, 386 | 488, 387 | 301, 388 | 326, 389 | 641, 390 | 223, 391 | 74, 392 | 122, 393 | 612, 394 | 567, 395 | 1, 396 | 576, 397 | 659, 398 | 204, 399 | 184, 400 | 10, 401 | 566, 402 | 294, 403 | 583, 404 | 543, 405 | 524, 406 | 183, 407 | 346, 408 | 220, 409 | 212, 410 | 340, 411 | 419, 412 | 502, 413 | 588, 414 | 201, 415 | 98, 416 | 580, 417 | 127, 418 | 593, 419 | 667, 420 | 589, 421 | 611, 422 | 250, 423 | 69, 424 | 407, 425 | 356, 426 | 389, 427 | 475, 428 | 478, 429 | 29, 430 | 396, 431 | 565, 432 | 316, 433 | 227, 434 | 306, 435 | 376, 436 | 198, 437 | 521, 438 | 221, 439 | 243, 440 | 387, 441 | 182, 442 | 650, 443 | 493, 444 | 341, 445 | 473, 446 | 556, 447 | 126, 448 | 367, 449 | 594, 450 | 683, 451 | 336, 452 | 73, 453 | 599, 454 | 149, 455 | 443, 456 | 269, 457 | 486, 458 | 672, 459 | 352, 460 | 359, 461 | 244, 462 | 608, 463 | 134, 464 | 57, 465 | 402, 466 | 333, 467 | 15, 468 | 167, 469 | 131, 470 | 273, 471 | 123, 472 | 435, 473 | 103, 474 | 374, 475 | 545, 476 | 663, 477 | 371, 478 | 610, 479 | 95, 480 | 620, 481 | 677, 482 | 632, 483 | 508, 484 | 207, 485 | 422, 486 | 199, 487 | 142, 488 | 361, 489 | 476, 490 | 533, 491 | 495, 492 | 232, 493 | 268, 494 | 365, 495 | 613, 496 | 666, 497 | 636, 498 | 381, 499 | 664, 500 | 516, 501 | 520, 502 | 572, 503 | 329, 504 | 153, 505 | 462, 506 | 434, 507 | 388, 508 | 335, 509 | 490, 510 | 440, 511 | 331, 512 | 470, 513 | 455, 514 | 654, 515 | 665, 516 | 472, 517 | 561, 518 | 684, 519 | 467, 520 | 482, 521 | 324, 522 | 63, 523 | 530, 524 | 155, 525 | 418, 526 | 296, 527 | 553, 528 | 615, 529 | 186, 530 | 441, 531 | 675, 532 | 639, 533 | 14, 534 | 286, 535 | 214, 536 | 549, 537 | 414, 538 | 382, 539 | 526, 540 | 82, 541 | 173, 542 | 688, 543 | 398, 544 | 380, 545 | 679, 546 | 239, 547 | 386, 548 | 266, 549 | 193, 550 | 86, 551 | 655, 552 | 12, 553 | 614, 554 | 575, 555 | 578, 556 | 210, 557 | 644, 558 | 534, 559 | 674, 560 | 539, 561 | 454, 562 | 631, 563 | 355, 564 | 491, 565 | 84, 566 | 445, 567 | 439, 568 | 395, 569 | 451, 570 | 590, 571 | 34, 572 | 662, 573 | 26, 574 | 415, 575 | 124, 576 | 647, 577 | 120, 578 | 169, 579 | 231, 580 | 481, 581 | 277, 582 | 70, 583 | 237, 584 | 456, 585 | 116, 586 | 281, 587 | 527, 588 | 174, 589 | 50, 590 | 312, 591 | 680, 592 | 585, 593 | 459, 594 | 607, 595 | 691, 596 | 364, 597 | 100, 598 | 485, 599 | 670 600 | ], 601 | "validation": [ 602 | 140, 603 | 308, 604 | 147, 605 | 242, 606 | 304, 607 | 270, 608 | 33, 609 | 189, 610 | 179, 611 | 67, 612 | 19, 613 | 230, 614 | 37, 615 | 282, 616 | 180, 617 | 344, 618 | 351, 619 | 197, 620 | 46, 621 | 181, 622 | 373, 623 | 196, 624 | 229, 625 | 358, 626 | 334, 627 | 40, 628 | 32, 629 | 379, 630 | 75, 631 | 292, 632 | 128, 633 | 247, 634 | 246, 635 | 251, 636 | 143 637 | ], 638 | "test": [ 639 | 102, 640 | 90, 641 | 275, 642 | 111, 643 | 166, 644 | 216, 645 | 68, 646 | 158, 647 | 209, 648 | 260, 649 | 366, 650 | 240, 651 | 325, 652 | 254, 653 | 295, 654 | 362, 655 | 135, 656 | 2, 657 | 88, 658 | 274, 659 | 393, 660 | 28, 661 | 280, 662 | 261, 663 | 354, 664 | 218, 665 | 203, 666 | 106, 667 | 170, 668 | 108, 669 | 36, 670 | 205, 671 | 157, 672 | 288, 673 | 76, 674 | 278, 675 | 177, 676 | 375, 677 | 178, 678 | 206, 679 | 156, 680 | 317, 681 | 163, 682 | 16, 683 | 133, 684 | 287, 685 | 61, 686 | 370, 687 | 194, 688 | 165, 689 | 390, 690 | 92, 691 | 332, 692 | 307, 693 | 394, 694 | 164, 695 | 13, 696 | 47, 697 | 249, 698 | 78, 699 | 265, 700 | 289, 701 | 187, 702 | 113, 703 | 350 704 | ] 705 | } -------------------------------------------------------------------------------- /batches/transplanted_tiles_15_timestamp_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "train": [ 3 | 367, 4 | 365, 5 | 237, 6 | 313, 7 | 284, 8 | 634, 9 | 23, 10 | 448, 11 | 537, 12 | 45, 13 | 388, 14 | 124, 15 | 688, 16 | 531, 17 | 83, 18 | 259, 19 | 665, 20 | 353, 21 | 648, 22 | 623, 23 | 542, 24 | 460, 25 | 696, 26 | 44, 27 | 399, 28 | 609, 29 | 34, 30 | 628, 31 | 570, 32 | 150, 33 | 600, 34 | 565, 35 | 426, 36 | 617, 37 | 312, 38 | 511, 39 | 543, 40 | 396, 41 | 521, 42 | 622, 43 | 481, 44 | 238, 45 | 494, 46 | 560, 47 | 192, 48 | 214, 49 | 549, 50 | 507, 51 | 592, 52 | 89, 53 | 60, 54 | 530, 55 | 483, 56 | 478, 57 | 35, 58 | 397, 59 | 86, 60 | 503, 61 | 204, 62 | 376, 63 | 690, 64 | 57, 65 | 616, 66 | 149, 67 | 11, 68 | 190, 69 | 208, 70 | 309, 71 | 612, 72 | 105, 73 | 487, 74 | 131, 75 | 632, 76 | 219, 77 | 678, 78 | 649, 79 | 227, 80 | 184, 81 | 372, 82 | 329, 83 | 123, 84 | 122, 85 | 629, 86 | 429, 87 | 70, 88 | 127, 89 | 615, 90 | 159, 91 | 9, 92 | 430, 93 | 276, 94 | 303, 95 | 386, 96 | 655, 97 | 406, 98 | 212, 99 | 371, 100 | 467, 101 | 381, 102 | 424, 103 | 433, 104 | 436, 105 | 109, 106 | 567, 107 | 310, 108 | 480, 109 | 144, 110 | 658, 111 | 556, 112 | 279, 113 | 98, 114 | 250, 115 | 107, 116 | 337, 117 | 643, 118 | 364, 119 | 377, 120 | 490, 121 | 522, 122 | 571, 123 | 267, 124 | 199, 125 | 311, 126 | 625, 127 | 442, 128 | 5, 129 | 466, 130 | 586, 131 | 646, 132 | 65, 133 | 169, 134 | 694, 135 | 562, 136 | 82, 137 | 489, 138 | 652, 139 | 581, 140 | 498, 141 | 598, 142 | 579, 143 | 660, 144 | 610, 145 | 269, 146 | 222, 147 | 451, 148 | 653, 149 | 330, 150 | 299, 151 | 112, 152 | 564, 153 | 671, 154 | 500, 155 | 677, 156 | 322, 157 | 151, 158 | 538, 159 | 101, 160 | 79, 161 | 539, 162 | 569, 163 | 234, 164 | 355, 165 | 17, 166 | 636, 167 | 224, 168 | 263, 169 | 300, 170 | 321, 171 | 504, 172 | 594, 173 | 506, 174 | 585, 175 | 360, 176 | 449, 177 | 438, 178 | 453, 179 | 679, 180 | 431, 181 | 461, 182 | 52, 183 | 84, 184 | 95, 185 | 440, 186 | 125, 187 | 638, 188 | 31, 189 | 509, 190 | 126, 191 | 134, 192 | 119, 193 | 239, 194 | 457, 195 | 18, 196 | 437, 197 | 220, 198 | 523, 199 | 470, 200 | 306, 201 | 191, 202 | 662, 203 | 293, 204 | 596, 205 | 77, 206 | 319, 207 | 357, 208 | 421, 209 | 39, 210 | 670, 211 | 613, 212 | 42, 213 | 252, 214 | 472, 215 | 327, 216 | 419, 217 | 519, 218 | 200, 219 | 380, 220 | 340, 221 | 686, 222 | 656, 223 | 468, 224 | 545, 225 | 188, 226 | 281, 227 | 672, 228 | 391, 229 | 515, 230 | 385, 231 | 501, 232 | 583, 233 | 631, 234 | 599, 235 | 621, 236 | 676, 237 | 244, 238 | 668, 239 | 445, 240 | 268, 241 | 64, 242 | 29, 243 | 3, 244 | 195, 245 | 651, 246 | 477, 247 | 455, 248 | 256, 249 | 405, 250 | 608, 251 | 415, 252 | 356, 253 | 452, 254 | 580, 255 | 66, 256 | 619, 257 | 657, 258 | 555, 259 | 463, 260 | 6, 261 | 154, 262 | 512, 263 | 215, 264 | 146, 265 | 324, 266 | 26, 267 | 145, 268 | 602, 269 | 587, 270 | 491, 271 | 414, 272 | 138, 273 | 345, 274 | 695, 275 | 383, 276 | 624, 277 | 296, 278 | 518, 279 | 541, 280 | 41, 281 | 546, 282 | 8, 283 | 693, 284 | 497, 285 | 193, 286 | 591, 287 | 605, 288 | 516, 289 | 387, 290 | 176, 291 | 620, 292 | 666, 293 | 532, 294 | 681, 295 | 642, 296 | 392, 297 | 217, 298 | 174, 299 | 277, 300 | 699, 301 | 331, 302 | 476, 303 | 462, 304 | 409, 305 | 347, 306 | 640, 307 | 475, 308 | 235, 309 | 91, 310 | 444, 311 | 553, 312 | 99, 313 | 630, 314 | 441, 315 | 547, 316 | 315, 317 | 186, 318 | 153, 319 | 336, 320 | 110, 321 | 301, 322 | 257, 323 | 73, 324 | 298, 325 | 536, 326 | 172, 327 | 682, 328 | 297, 329 | 118, 330 | 584, 331 | 493, 332 | 55, 333 | 382, 334 | 20, 335 | 439, 336 | 198, 337 | 663, 338 | 544, 339 | 30, 340 | 492, 341 | 211, 342 | 593, 343 | 27, 344 | 243, 345 | 93, 346 | 664, 347 | 348, 348 | 499, 349 | 213, 350 | 207, 351 | 272, 352 | 635, 353 | 428, 354 | 524, 355 | 683, 356 | 225, 357 | 316, 358 | 85, 359 | 418, 360 | 412, 361 | 422, 362 | 152, 363 | 71, 364 | 577, 365 | 411, 366 | 588, 367 | 517, 368 | 346, 369 | 557, 370 | 96, 371 | 485, 372 | 369, 373 | 185, 374 | 675, 375 | 606, 376 | 117, 377 | 576, 378 | 611, 379 | 228, 380 | 48, 381 | 389, 382 | 264, 383 | 221, 384 | 266, 385 | 528, 386 | 114, 387 | 338, 388 | 171, 389 | 401, 390 | 685, 391 | 294, 392 | 232, 393 | 427, 394 | 566, 395 | 137, 396 | 548, 397 | 398, 398 | 575, 399 | 456, 400 | 236, 401 | 633, 402 | 471, 403 | 689, 404 | 115, 405 | 130, 406 | 233, 407 | 410, 408 | 100, 409 | 349, 410 | 435, 411 | 43, 412 | 104, 413 | 432, 414 | 568, 415 | 302, 416 | 12, 417 | 558, 418 | 479, 419 | 508, 420 | 407, 421 | 447, 422 | 413, 423 | 661, 424 | 248, 425 | 395, 426 | 116, 427 | 7, 428 | 168, 429 | 94, 430 | 290, 431 | 420, 432 | 502, 433 | 403, 434 | 650, 435 | 141, 436 | 551, 437 | 273, 438 | 262, 439 | 245, 440 | 684, 441 | 459, 442 | 637, 443 | 241, 444 | 271, 445 | 167, 446 | 343, 447 | 54, 448 | 323, 449 | 423, 450 | 24, 451 | 291, 452 | 201, 453 | 488, 454 | 559, 455 | 561, 456 | 495, 457 | 446, 458 | 333, 459 | 674, 460 | 627, 461 | 458, 462 | 318, 463 | 550, 464 | 505, 465 | 121, 466 | 554, 467 | 74, 468 | 659, 469 | 572, 470 | 255, 471 | 604, 472 | 80, 473 | 535, 474 | 647, 475 | 142, 476 | 510, 477 | 434, 478 | 21, 479 | 582, 480 | 603, 481 | 374, 482 | 639, 483 | 81, 484 | 51, 485 | 400, 486 | 326, 487 | 1, 488 | 450, 489 | 59, 490 | 529, 491 | 210, 492 | 352, 493 | 136, 494 | 525, 495 | 38, 496 | 148, 497 | 87, 498 | 25, 499 | 162, 500 | 533, 501 | 363, 502 | 645, 503 | 314, 504 | 540, 505 | 155, 506 | 49, 507 | 614, 508 | 552, 509 | 175, 510 | 692, 511 | 253, 512 | 644, 513 | 469, 514 | 486, 515 | 607, 516 | 563, 517 | 226, 518 | 286, 519 | 341, 520 | 417, 521 | 202, 522 | 58, 523 | 474, 524 | 103, 525 | 339, 526 | 641, 527 | 56, 528 | 69, 529 | 698, 530 | 335, 531 | 404, 532 | 10, 533 | 601, 534 | 14, 535 | 50, 536 | 183, 537 | 129, 538 | 595, 539 | 62, 540 | 464, 541 | 72, 542 | 590, 543 | 15, 544 | 97, 545 | 283, 546 | 443, 547 | 320, 548 | 482, 549 | 574, 550 | 132, 551 | 120, 552 | 527, 553 | 687, 554 | 654, 555 | 408, 556 | 258, 557 | 534, 558 | 416, 559 | 342, 560 | 514, 561 | 173, 562 | 618, 563 | 161, 564 | 680, 565 | 496, 566 | 402, 567 | 182, 568 | 328, 569 | 667, 570 | 526, 571 | 53, 572 | 223, 573 | 513, 574 | 589, 575 | 573, 576 | 285, 577 | 4, 578 | 465, 579 | 63, 580 | 669, 581 | 231, 582 | 305, 583 | 473, 584 | 425, 585 | 359, 586 | 691, 587 | 361, 588 | 626, 589 | 597, 590 | 697, 591 | 578, 592 | 454, 593 | 160, 594 | 378, 595 | 520, 596 | 22, 597 | 484, 598 | 673, 599 | 384, 600 | 139, 601 | 368 602 | ], 603 | "validation": [ 604 | 140, 605 | 308, 606 | 147, 607 | 242, 608 | 304, 609 | 270, 610 | 33, 611 | 189, 612 | 179, 613 | 67, 614 | 19, 615 | 230, 616 | 37, 617 | 282, 618 | 180, 619 | 344, 620 | 351, 621 | 197, 622 | 46, 623 | 181, 624 | 373, 625 | 196, 626 | 229, 627 | 358, 628 | 334, 629 | 40, 630 | 32, 631 | 379, 632 | 75, 633 | 292, 634 | 128, 635 | 247, 636 | 246, 637 | 251, 638 | 143 639 | ], 640 | "test": [ 641 | 102, 642 | 90, 643 | 275, 644 | 111, 645 | 166, 646 | 216, 647 | 68, 648 | 158, 649 | 209, 650 | 260, 651 | 366, 652 | 240, 653 | 325, 654 | 254, 655 | 295, 656 | 362, 657 | 135, 658 | 2, 659 | 88, 660 | 274, 661 | 393, 662 | 28, 663 | 280, 664 | 261, 665 | 354, 666 | 218, 667 | 203, 668 | 106, 669 | 170, 670 | 108, 671 | 36, 672 | 205, 673 | 157, 674 | 288, 675 | 76, 676 | 278, 677 | 177, 678 | 375, 679 | 178, 680 | 206, 681 | 156, 682 | 317, 683 | 163, 684 | 16, 685 | 133, 686 | 287, 687 | 61, 688 | 370, 689 | 194, 690 | 165, 691 | 390, 692 | 92, 693 | 332, 694 | 307, 695 | 394, 696 | 164, 697 | 13, 698 | 47, 699 | 249, 700 | 78, 701 | 265, 702 | 289, 703 | 187, 704 | 113, 705 | 350 706 | ] 707 | } -------------------------------------------------------------------------------- /batches/transplanted_tiles_15_timestamp_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "train": [ 3 | 696, 4 | 296, 5 | 415, 6 | 523, 7 | 508, 8 | 112, 9 | 543, 10 | 357, 11 | 207, 12 | 691, 13 | 529, 14 | 171, 15 | 623, 16 | 611, 17 | 566, 18 | 77, 19 | 389, 20 | 10, 21 | 429, 22 | 402, 23 | 11, 24 | 441, 25 | 587, 26 | 153, 27 | 310, 28 | 443, 29 | 174, 30 | 301, 31 | 423, 32 | 162, 33 | 600, 34 | 225, 35 | 126, 36 | 463, 37 | 231, 38 | 248, 39 | 676, 40 | 655, 41 | 619, 42 | 634, 43 | 593, 44 | 688, 45 | 431, 46 | 478, 47 | 515, 48 | 569, 49 | 483, 50 | 573, 51 | 120, 52 | 314, 53 | 395, 54 | 364, 55 | 578, 56 | 536, 57 | 491, 58 | 60, 59 | 380, 60 | 614, 61 | 422, 62 | 356, 63 | 644, 64 | 576, 65 | 239, 66 | 311, 67 | 382, 68 | 80, 69 | 671, 70 | 190, 71 | 183, 72 | 426, 73 | 531, 74 | 677, 75 | 668, 76 | 74, 77 | 149, 78 | 553, 79 | 122, 80 | 168, 81 | 297, 82 | 38, 83 | 506, 84 | 517, 85 | 125, 86 | 191, 87 | 95, 88 | 434, 89 | 612, 90 | 525, 91 | 381, 92 | 512, 93 | 602, 94 | 460, 95 | 550, 96 | 412, 97 | 222, 98 | 87, 99 | 73, 100 | 562, 101 | 670, 102 | 42, 103 | 477, 104 | 212, 105 | 315, 106 | 333, 107 | 461, 108 | 57, 109 | 115, 110 | 606, 111 | 641, 112 | 257, 113 | 22, 114 | 657, 115 | 59, 116 | 417, 117 | 413, 118 | 568, 119 | 425, 120 | 406, 121 | 684, 122 | 652, 123 | 581, 124 | 618, 125 | 635, 126 | 530, 127 | 551, 128 | 338, 129 | 632, 130 | 467, 131 | 470, 132 | 94, 133 | 458, 134 | 498, 135 | 643, 136 | 195, 137 | 219, 138 | 215, 139 | 43, 140 | 345, 141 | 110, 142 | 524, 143 | 99, 144 | 331, 145 | 253, 146 | 448, 147 | 616, 148 | 471, 149 | 653, 150 | 293, 151 | 588, 152 | 482, 153 | 416, 154 | 679, 155 | 391, 156 | 440, 157 | 52, 158 | 510, 159 | 14, 160 | 628, 161 | 659, 162 | 535, 163 | 152, 164 | 625, 165 | 360, 166 | 480, 167 | 340, 168 | 237, 169 | 245, 170 | 139, 171 | 155, 172 | 519, 173 | 565, 174 | 238, 175 | 651, 176 | 438, 177 | 252, 178 | 546, 179 | 217, 180 | 159, 181 | 234, 182 | 398, 183 | 405, 184 | 65, 185 | 436, 186 | 136, 187 | 597, 188 | 369, 189 | 580, 190 | 70, 191 | 411, 192 | 220, 193 | 433, 194 | 27, 195 | 466, 196 | 25, 197 | 552, 198 | 457, 199 | 365, 200 | 427, 201 | 85, 202 | 145, 203 | 276, 204 | 72, 205 | 29, 206 | 341, 207 | 649, 208 | 620, 209 | 598, 210 | 674, 211 | 324, 212 | 421, 213 | 12, 214 | 500, 215 | 227, 216 | 176, 217 | 328, 218 | 316, 219 | 53, 220 | 129, 221 | 89, 222 | 342, 223 | 683, 224 | 100, 225 | 673, 226 | 384, 227 | 131, 228 | 675, 229 | 534, 230 | 418, 231 | 516, 232 | 599, 233 | 541, 234 | 414, 235 | 226, 236 | 476, 237 | 51, 238 | 685, 239 | 223, 240 | 521, 241 | 473, 242 | 118, 243 | 397, 244 | 484, 245 | 23, 246 | 121, 247 | 182, 248 | 267, 249 | 501, 250 | 202, 251 | 4, 252 | 504, 253 | 211, 254 | 96, 255 | 450, 256 | 474, 257 | 497, 258 | 9, 259 | 1, 260 | 561, 261 | 286, 262 | 695, 263 | 636, 264 | 41, 265 | 689, 266 | 469, 267 | 699, 268 | 555, 269 | 184, 270 | 283, 271 | 439, 272 | 694, 273 | 321, 274 | 490, 275 | 559, 276 | 268, 277 | 514, 278 | 322, 279 | 266, 280 | 258, 281 | 198, 282 | 169, 283 | 319, 284 | 472, 285 | 528, 286 | 58, 287 | 627, 288 | 604, 289 | 6, 290 | 188, 291 | 486, 292 | 127, 293 | 686, 294 | 586, 295 | 137, 296 | 682, 297 | 479, 298 | 109, 299 | 273, 300 | 50, 301 | 420, 302 | 646, 303 | 256, 304 | 150, 305 | 610, 306 | 45, 307 | 385, 308 | 312, 309 | 35, 310 | 446, 311 | 144, 312 | 667, 313 | 626, 314 | 584, 315 | 148, 316 | 442, 317 | 290, 318 | 563, 319 | 313, 320 | 570, 321 | 18, 322 | 509, 323 | 353, 324 | 624, 325 | 69, 326 | 26, 327 | 647, 328 | 428, 329 | 399, 330 | 603, 331 | 232, 332 | 547, 333 | 595, 334 | 337, 335 | 481, 336 | 608, 337 | 142, 338 | 594, 339 | 30, 340 | 306, 341 | 660, 342 | 233, 343 | 669, 344 | 34, 345 | 400, 346 | 507, 347 | 224, 348 | 17, 349 | 540, 350 | 672, 351 | 589, 352 | 452, 353 | 681, 354 | 513, 355 | 459, 356 | 665, 357 | 590, 358 | 407, 359 | 117, 360 | 154, 361 | 97, 362 | 485, 363 | 637, 364 | 495, 365 | 3, 366 | 173, 367 | 39, 368 | 692, 369 | 532, 370 | 86, 371 | 396, 372 | 567, 373 | 449, 374 | 622, 375 | 533, 376 | 91, 377 | 374, 378 | 419, 379 | 298, 380 | 582, 381 | 538, 382 | 494, 383 | 658, 384 | 5, 385 | 654, 386 | 83, 387 | 678, 388 | 607, 389 | 243, 390 | 24, 391 | 236, 392 | 192, 393 | 492, 394 | 629, 395 | 645, 396 | 386, 397 | 455, 398 | 361, 399 | 130, 400 | 542, 401 | 388, 402 | 272, 403 | 326, 404 | 488, 405 | 579, 406 | 79, 407 | 454, 408 | 114, 409 | 54, 410 | 20, 411 | 666, 412 | 107, 413 | 493, 414 | 264, 415 | 577, 416 | 526, 417 | 572, 418 | 377, 419 | 571, 420 | 172, 421 | 7, 422 | 662, 423 | 437, 424 | 630, 425 | 335, 426 | 451, 427 | 259, 428 | 82, 429 | 263, 430 | 84, 431 | 693, 432 | 408, 433 | 124, 434 | 160, 435 | 650, 436 | 583, 437 | 93, 438 | 642, 439 | 355, 440 | 564, 441 | 487, 442 | 44, 443 | 291, 444 | 496, 445 | 320, 446 | 601, 447 | 475, 448 | 453, 449 | 615, 450 | 648, 451 | 101, 452 | 48, 453 | 123, 454 | 640, 455 | 664, 456 | 371, 457 | 401, 458 | 592, 459 | 468, 460 | 537, 461 | 544, 462 | 585, 463 | 309, 464 | 503, 465 | 410, 466 | 343, 467 | 277, 468 | 518, 469 | 8, 470 | 349, 471 | 167, 472 | 63, 473 | 392, 474 | 281, 475 | 146, 476 | 690, 477 | 213, 478 | 347, 479 | 549, 480 | 435, 481 | 609, 482 | 378, 483 | 241, 484 | 262, 485 | 15, 486 | 210, 487 | 62, 488 | 103, 489 | 613, 490 | 302, 491 | 132, 492 | 359, 493 | 596, 494 | 352, 495 | 558, 496 | 303, 497 | 285, 498 | 56, 499 | 161, 500 | 465, 501 | 31, 502 | 527, 503 | 151, 504 | 186, 505 | 444, 506 | 98, 507 | 336, 508 | 66, 509 | 221, 510 | 134, 511 | 574, 512 | 489, 513 | 201, 514 | 387, 515 | 318, 516 | 522, 517 | 539, 518 | 663, 519 | 105, 520 | 284, 521 | 104, 522 | 141, 523 | 363, 524 | 235, 525 | 548, 526 | 633, 527 | 208, 528 | 556, 529 | 631, 530 | 271, 531 | 409, 532 | 55, 533 | 116, 534 | 81, 535 | 49, 536 | 214, 537 | 367, 538 | 661, 539 | 505, 540 | 305, 541 | 269, 542 | 456, 543 | 502, 544 | 329, 545 | 228, 546 | 432, 547 | 557, 548 | 383, 549 | 348, 550 | 445, 551 | 575, 552 | 687, 553 | 294, 554 | 554, 555 | 617, 556 | 656, 557 | 255, 558 | 511, 559 | 300, 560 | 64, 561 | 327, 562 | 376, 563 | 330, 564 | 339, 565 | 323, 566 | 560, 567 | 621, 568 | 499, 569 | 21, 570 | 372, 571 | 299, 572 | 430, 573 | 680, 574 | 200, 575 | 244, 576 | 591, 577 | 605, 578 | 193, 579 | 199, 580 | 424, 581 | 279, 582 | 346, 583 | 698, 584 | 447, 585 | 638, 586 | 404, 587 | 119, 588 | 138, 589 | 462, 590 | 545, 591 | 639, 592 | 464, 593 | 175, 594 | 71, 595 | 185, 596 | 250, 597 | 403, 598 | 368, 599 | 520, 600 | 697, 601 | 204 602 | ], 603 | "validation": [ 604 | 140, 605 | 308, 606 | 147, 607 | 242, 608 | 304, 609 | 270, 610 | 33, 611 | 189, 612 | 179, 613 | 67, 614 | 19, 615 | 230, 616 | 37, 617 | 282, 618 | 180, 619 | 344, 620 | 351, 621 | 197, 622 | 46, 623 | 181, 624 | 373, 625 | 196, 626 | 229, 627 | 358, 628 | 334, 629 | 40, 630 | 32, 631 | 379, 632 | 75, 633 | 292, 634 | 128, 635 | 247, 636 | 246, 637 | 251, 638 | 143 639 | ], 640 | "test": [ 641 | 102, 642 | 90, 643 | 275, 644 | 111, 645 | 166, 646 | 216, 647 | 68, 648 | 158, 649 | 209, 650 | 260, 651 | 366, 652 | 240, 653 | 325, 654 | 254, 655 | 295, 656 | 362, 657 | 135, 658 | 2, 659 | 88, 660 | 274, 661 | 393, 662 | 28, 663 | 280, 664 | 261, 665 | 354, 666 | 218, 667 | 203, 668 | 106, 669 | 170, 670 | 108, 671 | 36, 672 | 205, 673 | 157, 674 | 288, 675 | 76, 676 | 278, 677 | 177, 678 | 375, 679 | 178, 680 | 206, 681 | 156, 682 | 317, 683 | 163, 684 | 16, 685 | 133, 686 | 287, 687 | 61, 688 | 370, 689 | 194, 690 | 165, 691 | 390, 692 | 92, 693 | 332, 694 | 307, 695 | 394, 696 | 164, 697 | 13, 698 | 47, 699 | 249, 700 | 78, 701 | 265, 702 | 289, 703 | 187, 704 | 113, 705 | 350 706 | ] 707 | } -------------------------------------------------------------------------------- /batches/transplanted_tiles_15_timestamp_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "train": [ 3 | 66, 4 | 642, 5 | 473, 6 | 220, 7 | 608, 8 | 626, 9 | 39, 10 | 513, 11 | 413, 12 | 43, 13 | 463, 14 | 619, 15 | 616, 16 | 96, 17 | 341, 18 | 279, 19 | 562, 20 | 269, 21 | 534, 22 | 24, 23 | 504, 24 | 97, 25 | 199, 26 | 548, 27 | 604, 28 | 401, 29 | 460, 30 | 572, 31 | 285, 32 | 11, 33 | 109, 34 | 70, 35 | 259, 36 | 99, 37 | 464, 38 | 438, 39 | 663, 40 | 1, 41 | 480, 42 | 651, 43 | 383, 44 | 523, 45 | 469, 46 | 429, 47 | 617, 48 | 693, 49 | 555, 50 | 449, 51 | 439, 52 | 680, 53 | 669, 54 | 116, 55 | 318, 56 | 14, 57 | 124, 58 | 130, 59 | 584, 60 | 81, 61 | 284, 62 | 305, 63 | 545, 64 | 587, 65 | 448, 66 | 656, 67 | 623, 68 | 582, 69 | 568, 70 | 49, 71 | 567, 72 | 573, 73 | 446, 74 | 118, 75 | 510, 76 | 313, 77 | 303, 78 | 294, 79 | 346, 80 | 257, 81 | 511, 82 | 236, 83 | 558, 84 | 364, 85 | 514, 86 | 482, 87 | 271, 88 | 677, 89 | 309, 90 | 491, 91 | 581, 92 | 506, 93 | 671, 94 | 125, 95 | 35, 96 | 331, 97 | 232, 98 | 522, 99 | 85, 100 | 291, 101 | 12, 102 | 624, 103 | 198, 104 | 153, 105 | 104, 106 | 22, 107 | 653, 108 | 213, 109 | 662, 110 | 273, 111 | 355, 112 | 6, 113 | 496, 114 | 458, 115 | 577, 116 | 228, 117 | 134, 118 | 609, 119 | 339, 120 | 105, 121 | 408, 122 | 654, 123 | 569, 124 | 640, 125 | 184, 126 | 63, 127 | 107, 128 | 433, 129 | 676, 130 | 248, 131 | 159, 132 | 553, 133 | 456, 134 | 442, 135 | 30, 136 | 525, 137 | 139, 138 | 630, 139 | 322, 140 | 471, 141 | 694, 142 | 73, 143 | 535, 144 | 324, 145 | 149, 146 | 335, 147 | 594, 148 | 486, 149 | 422, 150 | 127, 151 | 110, 152 | 606, 153 | 167, 154 | 34, 155 | 154, 156 | 87, 157 | 316, 158 | 348, 159 | 245, 160 | 557, 161 | 382, 162 | 636, 163 | 69, 164 | 342, 165 | 432, 166 | 537, 167 | 589, 168 | 352, 169 | 345, 170 | 326, 171 | 18, 172 | 434, 173 | 60, 174 | 686, 175 | 452, 176 | 697, 177 | 267, 178 | 363, 179 | 101, 180 | 530, 181 | 296, 182 | 188, 183 | 675, 184 | 492, 185 | 444, 186 | 639, 187 | 691, 188 | 488, 189 | 193, 190 | 532, 191 | 483, 192 | 610, 193 | 398, 194 | 38, 195 | 208, 196 | 660, 197 | 502, 198 | 100, 199 | 234, 200 | 578, 201 | 58, 202 | 89, 203 | 489, 204 | 387, 205 | 64, 206 | 310, 207 | 53, 208 | 210, 209 | 503, 210 | 420, 211 | 430, 212 | 253, 213 | 415, 214 | 384, 215 | 426, 216 | 315, 217 | 23, 218 | 298, 219 | 453, 220 | 542, 221 | 367, 222 | 508, 223 | 457, 224 | 547, 225 | 353, 226 | 148, 227 | 31, 228 | 407, 229 | 86, 230 | 465, 231 | 183, 232 | 437, 233 | 329, 234 | 389, 235 | 9, 236 | 160, 237 | 516, 238 | 509, 239 | 643, 240 | 328, 241 | 575, 242 | 445, 243 | 665, 244 | 5, 245 | 337, 246 | 263, 247 | 607, 248 | 174, 249 | 323, 250 | 132, 251 | 447, 252 | 168, 253 | 683, 254 | 546, 255 | 625, 256 | 519, 257 | 256, 258 | 428, 259 | 443, 260 | 435, 261 | 563, 262 | 627, 263 | 343, 264 | 52, 265 | 56, 266 | 646, 267 | 588, 268 | 237, 269 | 417, 270 | 600, 271 | 131, 272 | 526, 273 | 338, 274 | 622, 275 | 8, 276 | 222, 277 | 681, 278 | 543, 279 | 521, 280 | 29, 281 | 695, 282 | 440, 283 | 687, 284 | 244, 285 | 485, 286 | 306, 287 | 659, 288 | 51, 289 | 505, 290 | 45, 291 | 84, 292 | 561, 293 | 595, 294 | 612, 295 | 436, 296 | 498, 297 | 411, 298 | 201, 299 | 481, 300 | 517, 301 | 461, 302 | 470, 303 | 637, 304 | 385, 305 | 666, 306 | 423, 307 | 570, 308 | 15, 309 | 112, 310 | 272, 311 | 571, 312 | 233, 313 | 478, 314 | 650, 315 | 191, 316 | 507, 317 | 405, 318 | 192, 319 | 682, 320 | 119, 321 | 182, 322 | 620, 323 | 152, 324 | 672, 325 | 601, 326 | 227, 327 | 79, 328 | 319, 329 | 277, 330 | 223, 331 | 144, 332 | 359, 333 | 455, 334 | 169, 335 | 266, 336 | 330, 337 | 172, 338 | 65, 339 | 472, 340 | 467, 341 | 692, 342 | 529, 343 | 528, 344 | 243, 345 | 641, 346 | 361, 347 | 44, 348 | 42, 349 | 312, 350 | 115, 351 | 556, 352 | 585, 353 | 459, 354 | 241, 355 | 204, 356 | 512, 357 | 283, 358 | 538, 359 | 297, 360 | 173, 361 | 632, 362 | 77, 363 | 531, 364 | 603, 365 | 268, 366 | 357, 367 | 356, 368 | 300, 369 | 596, 370 | 421, 371 | 605, 372 | 299, 373 | 41, 374 | 566, 375 | 402, 376 | 10, 377 | 668, 378 | 94, 379 | 400, 380 | 593, 381 | 579, 382 | 83, 383 | 55, 384 | 539, 385 | 597, 386 | 495, 387 | 388, 388 | 281, 389 | 450, 390 | 698, 391 | 615, 392 | 554, 393 | 613, 394 | 150, 395 | 217, 396 | 238, 397 | 633, 398 | 171, 399 | 27, 400 | 120, 401 | 565, 402 | 202, 403 | 176, 404 | 602, 405 | 699, 406 | 98, 407 | 499, 408 | 590, 409 | 524, 410 | 141, 411 | 215, 412 | 583, 413 | 614, 414 | 212, 415 | 136, 416 | 48, 417 | 369, 418 | 117, 419 | 211, 420 | 391, 421 | 599, 422 | 365, 423 | 301, 424 | 239, 425 | 621, 426 | 121, 427 | 371, 428 | 368, 429 | 123, 430 | 235, 431 | 185, 432 | 685, 433 | 412, 434 | 451, 435 | 515, 436 | 161, 437 | 670, 438 | 533, 439 | 679, 440 | 468, 441 | 231, 442 | 145, 443 | 673, 444 | 454, 445 | 200, 446 | 655, 447 | 410, 448 | 333, 449 | 487, 450 | 416, 451 | 490, 452 | 7, 453 | 667, 454 | 214, 455 | 219, 456 | 409, 457 | 250, 458 | 290, 459 | 403, 460 | 635, 461 | 657, 462 | 372, 463 | 404, 464 | 544, 465 | 484, 466 | 649, 467 | 20, 468 | 500, 469 | 550, 470 | 479, 471 | 631, 472 | 162, 473 | 374, 474 | 103, 475 | 340, 476 | 549, 477 | 690, 478 | 476, 479 | 314, 480 | 252, 481 | 190, 482 | 541, 483 | 138, 484 | 302, 485 | 618, 486 | 689, 487 | 629, 488 | 474, 489 | 26, 490 | 560, 491 | 54, 492 | 414, 493 | 380, 494 | 678, 495 | 122, 496 | 62, 497 | 320, 498 | 399, 499 | 536, 500 | 381, 501 | 17, 502 | 652, 503 | 276, 504 | 418, 505 | 475, 506 | 376, 507 | 688, 508 | 527, 509 | 395, 510 | 360, 511 | 540, 512 | 611, 513 | 225, 514 | 377, 515 | 155, 516 | 264, 517 | 224, 518 | 386, 519 | 175, 520 | 226, 521 | 137, 522 | 82, 523 | 576, 524 | 696, 525 | 647, 526 | 347, 527 | 195, 528 | 21, 529 | 327, 530 | 466, 531 | 71, 532 | 628, 533 | 477, 534 | 349, 535 | 427, 536 | 586, 537 | 424, 538 | 638, 539 | 684, 540 | 397, 541 | 494, 542 | 59, 543 | 661, 544 | 258, 545 | 580, 546 | 4, 547 | 151, 548 | 25, 549 | 57, 550 | 74, 551 | 3, 552 | 658, 553 | 311, 554 | 221, 555 | 564, 556 | 644, 557 | 591, 558 | 425, 559 | 497, 560 | 574, 561 | 592, 562 | 406, 563 | 431, 564 | 50, 565 | 674, 566 | 255, 567 | 114, 568 | 598, 569 | 321, 570 | 501, 571 | 336, 572 | 262, 573 | 664, 574 | 93, 575 | 518, 576 | 493, 577 | 396, 578 | 95, 579 | 91, 580 | 129, 581 | 378, 582 | 462, 583 | 392, 584 | 207, 585 | 559, 586 | 80, 587 | 634, 588 | 419, 589 | 645, 590 | 293, 591 | 72, 592 | 648, 593 | 552, 594 | 441, 595 | 186, 596 | 146, 597 | 286, 598 | 126, 599 | 142, 600 | 551, 601 | 520 602 | ], 603 | "validation": [ 604 | 140, 605 | 308, 606 | 147, 607 | 242, 608 | 304, 609 | 270, 610 | 33, 611 | 189, 612 | 179, 613 | 67, 614 | 19, 615 | 230, 616 | 37, 617 | 282, 618 | 180, 619 | 344, 620 | 351, 621 | 197, 622 | 46, 623 | 181, 624 | 373, 625 | 196, 626 | 229, 627 | 358, 628 | 334, 629 | 40, 630 | 32, 631 | 379, 632 | 75, 633 | 292, 634 | 128, 635 | 247, 636 | 246, 637 | 251, 638 | 143 639 | ], 640 | "test": [ 641 | 102, 642 | 90, 643 | 275, 644 | 111, 645 | 166, 646 | 216, 647 | 68, 648 | 158, 649 | 209, 650 | 260, 651 | 366, 652 | 240, 653 | 325, 654 | 254, 655 | 295, 656 | 362, 657 | 135, 658 | 2, 659 | 88, 660 | 274, 661 | 393, 662 | 28, 663 | 280, 664 | 261, 665 | 354, 666 | 218, 667 | 203, 668 | 106, 669 | 170, 670 | 108, 671 | 36, 672 | 205, 673 | 157, 674 | 288, 675 | 76, 676 | 278, 677 | 177, 678 | 375, 679 | 178, 680 | 206, 681 | 156, 682 | 317, 683 | 163, 684 | 16, 685 | 133, 686 | 287, 687 | 61, 688 | 370, 689 | 194, 690 | 165, 691 | 390, 692 | 92, 693 | 332, 694 | 307, 695 | 394, 696 | 164, 697 | 13, 698 | 47, 699 | 249, 700 | 78, 701 | 265, 702 | 289, 703 | 187, 704 | 113, 705 | 350 706 | ] 707 | } -------------------------------------------------------------------------------- /batches/transplanted_tiles_20_timestamp_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "train": [ 3 | 383, 4 | 660, 5 | 673, 6 | 26, 7 | 169, 8 | 386, 9 | 144, 10 | 461, 11 | 286, 12 | 233, 13 | 696, 14 | 340, 15 | 95, 16 | 526, 17 | 301, 18 | 521, 19 | 486, 20 | 219, 21 | 321, 22 | 591, 23 | 257, 24 | 355, 25 | 22, 26 | 202, 27 | 480, 28 | 694, 29 | 117, 30 | 549, 31 | 617, 32 | 193, 33 | 637, 34 | 195, 35 | 125, 36 | 420, 37 | 505, 38 | 176, 39 | 453, 40 | 239, 41 | 455, 42 | 124, 43 | 481, 44 | 529, 45 | 514, 46 | 478, 47 | 96, 48 | 692, 49 | 392, 50 | 567, 51 | 258, 52 | 327, 53 | 423, 54 | 188, 55 | 225, 56 | 168, 57 | 273, 58 | 642, 59 | 574, 60 | 503, 61 | 509, 62 | 81, 63 | 281, 64 | 650, 65 | 406, 66 | 80, 67 | 627, 68 | 629, 69 | 623, 70 | 693, 71 | 404, 72 | 398, 73 | 374, 74 | 605, 75 | 238, 76 | 353, 77 | 100, 78 | 546, 79 | 264, 80 | 363, 81 | 300, 82 | 551, 83 | 405, 84 | 613, 85 | 619, 86 | 532, 87 | 611, 88 | 451, 89 | 683, 90 | 201, 91 | 9, 92 | 41, 93 | 439, 94 | 107, 95 | 573, 96 | 672, 97 | 560, 98 | 284, 99 | 160, 100 | 8, 101 | 382, 102 | 602, 103 | 539, 104 | 248, 105 | 329, 106 | 477, 107 | 51, 108 | 1, 109 | 276, 110 | 231, 111 | 427, 112 | 364, 113 | 384, 114 | 597, 115 | 598, 116 | 316, 117 | 185, 118 | 21, 119 | 237, 120 | 369, 121 | 587, 122 | 531, 123 | 518, 124 | 29, 125 | 690, 126 | 620, 127 | 609, 128 | 513, 129 | 608, 130 | 506, 131 | 689, 132 | 74, 133 | 130, 134 | 680, 135 | 664, 136 | 638, 137 | 378, 138 | 82, 139 | 472, 140 | 154, 141 | 454, 142 | 595, 143 | 636, 144 | 450, 145 | 123, 146 | 662, 147 | 109, 148 | 516, 149 | 55, 150 | 646, 151 | 475, 152 | 104, 153 | 150, 154 | 618, 155 | 371, 156 | 14, 157 | 681, 158 | 89, 159 | 389, 160 | 136, 161 | 624, 162 | 115, 163 | 667, 164 | 603, 165 | 31, 166 | 183, 167 | 232, 168 | 417, 169 | 501, 170 | 262, 171 | 655, 172 | 495, 173 | 119, 174 | 207, 175 | 333, 176 | 291, 177 | 159, 178 | 271, 179 | 473, 180 | 422, 181 | 625, 182 | 137, 183 | 116, 184 | 121, 185 | 432, 186 | 553, 187 | 640, 188 | 651, 189 | 659, 190 | 236, 191 | 584, 192 | 493, 193 | 604, 194 | 434, 195 | 522, 196 | 436, 197 | 199, 198 | 471, 199 | 658, 200 | 497, 201 | 511, 202 | 496, 203 | 85, 204 | 256, 205 | 679, 206 | 457, 207 | 294, 208 | 93, 209 | 653, 210 | 508, 211 | 98, 212 | 155, 213 | 59, 214 | 391, 215 | 313, 216 | 544, 217 | 430, 218 | 674, 219 | 64, 220 | 460, 221 | 241, 222 | 112, 223 | 290, 224 | 198, 225 | 482, 226 | 53, 227 | 11, 228 | 517, 229 | 45, 230 | 215, 231 | 77, 232 | 487, 233 | 311, 234 | 54, 235 | 220, 236 | 356, 237 | 413, 238 | 5, 239 | 492, 240 | 401, 241 | 616, 242 | 10, 243 | 306, 244 | 352, 245 | 577, 246 | 396, 247 | 336, 248 | 530, 249 | 361, 250 | 99, 251 | 610, 252 | 599, 253 | 585, 254 | 66, 255 | 535, 256 | 175, 257 | 566, 258 | 20, 259 | 630, 260 | 572, 261 | 285, 262 | 388, 263 | 105, 264 | 118, 265 | 418, 266 | 564, 267 | 400, 268 | 548, 269 | 372, 270 | 558, 271 | 279, 272 | 582, 273 | 335, 274 | 448, 275 | 484, 276 | 149, 277 | 671, 278 | 500, 279 | 581, 280 | 612, 281 | 399, 282 | 596, 283 | 698, 284 | 540, 285 | 3, 286 | 586, 287 | 25, 288 | 467, 289 | 402, 290 | 446, 291 | 35, 292 | 528, 293 | 639, 294 | 12, 295 | 173, 296 | 310, 297 | 263, 298 | 309, 299 | 635, 300 | 297, 301 | 142, 302 | 489, 303 | 312, 304 | 299, 305 | 328, 306 | 204, 307 | 542, 308 | 504, 309 | 368, 310 | 463, 311 | 663, 312 | 314, 313 | 676, 314 | 570, 315 | 319, 316 | 330, 317 | 536, 318 | 44, 319 | 466, 320 | 318, 321 | 343, 322 | 145, 323 | 38, 324 | 141, 325 | 583, 326 | 687, 327 | 43, 328 | 594, 329 | 670, 330 | 644, 331 | 407, 332 | 326, 333 | 255, 334 | 668, 335 | 253, 336 | 483, 337 | 4, 338 | 127, 339 | 79, 340 | 408, 341 | 527, 342 | 167, 343 | 84, 344 | 315, 345 | 440, 346 | 71, 347 | 380, 348 | 424, 349 | 200, 350 | 381, 351 | 228, 352 | 445, 353 | 101, 354 | 502, 355 | 545, 356 | 641, 357 | 410, 358 | 243, 359 | 476, 360 | 474, 361 | 97, 362 | 86, 363 | 7, 364 | 675, 365 | 415, 366 | 338, 367 | 395, 368 | 365, 369 | 72, 370 | 387, 371 | 485, 372 | 588, 373 | 24, 374 | 151, 375 | 191, 376 | 643, 377 | 161, 378 | 62, 379 | 443, 380 | 578, 381 | 94, 382 | 245, 383 | 63, 384 | 91, 385 | 138, 386 | 403, 387 | 324, 388 | 60, 389 | 49, 390 | 224, 391 | 132, 392 | 346, 393 | 214, 394 | 444, 395 | 538, 396 | 347, 397 | 652, 398 | 456, 399 | 409, 400 | 357, 401 | 87, 402 | 377, 403 | 73, 404 | 235, 405 | 42, 406 | 266, 407 | 654, 408 | 15, 409 | 303, 410 | 23, 411 | 547, 412 | 411, 413 | 534, 414 | 425, 415 | 656, 416 | 580, 417 | 227, 418 | 65, 419 | 556, 420 | 48, 421 | 337, 422 | 562, 423 | 433, 424 | 234, 425 | 615, 426 | 557, 427 | 488, 428 | 172, 429 | 555, 430 | 322, 431 | 568, 432 | 192, 433 | 647, 434 | 561, 435 | 320, 436 | 684, 437 | 34, 438 | 576, 439 | 50, 440 | 537, 441 | 499, 442 | 152, 443 | 148, 444 | 267, 445 | 590, 446 | 525, 447 | 186, 448 | 695, 449 | 462, 450 | 250, 451 | 153, 452 | 459, 453 | 221, 454 | 688, 455 | 429, 456 | 437, 457 | 217, 458 | 83, 459 | 626, 460 | 226, 461 | 666, 462 | 52, 463 | 519, 464 | 359, 465 | 283, 466 | 162, 467 | 579, 468 | 665, 469 | 428, 470 | 699, 471 | 397, 472 | 507, 473 | 520, 474 | 331, 475 | 685, 476 | 593, 477 | 510, 478 | 614, 479 | 606, 480 | 682, 481 | 491, 482 | 648, 483 | 244, 484 | 543, 485 | 465, 486 | 70, 487 | 600, 488 | 469, 489 | 533, 490 | 414, 491 | 27, 492 | 259, 493 | 6, 494 | 524, 495 | 649, 496 | 490, 497 | 114, 498 | 122, 499 | 110, 500 | 697, 501 | 222, 502 | 69, 503 | 565, 504 | 296, 505 | 628, 506 | 277, 507 | 621, 508 | 385, 509 | 360, 510 | 223, 511 | 464, 512 | 211, 513 | 563, 514 | 571, 515 | 349, 516 | 17, 517 | 435, 518 | 523, 519 | 103, 520 | 419, 521 | 669, 522 | 339, 523 | 268, 524 | 441, 525 | 470, 526 | 184, 527 | 468, 528 | 622, 529 | 479, 530 | 575, 531 | 146, 532 | 569, 533 | 552, 534 | 341, 535 | 30, 536 | 348, 537 | 592, 538 | 442, 539 | 345, 540 | 449, 541 | 494, 542 | 631, 543 | 458, 544 | 293, 545 | 272, 546 | 431, 547 | 323, 548 | 190, 549 | 302, 550 | 298, 551 | 541, 552 | 645, 553 | 686, 554 | 376, 555 | 515, 556 | 426, 557 | 213, 558 | 550, 559 | 589, 560 | 269, 561 | 131, 562 | 607, 563 | 139, 564 | 601, 565 | 416, 566 | 305, 567 | 452, 568 | 421, 569 | 129, 570 | 39, 571 | 126, 572 | 559, 573 | 342, 574 | 657, 575 | 678, 576 | 57, 577 | 447, 578 | 56, 579 | 438, 580 | 498, 581 | 18, 582 | 208, 583 | 691, 584 | 634, 585 | 182, 586 | 367, 587 | 174, 588 | 252, 589 | 120, 590 | 212, 591 | 58, 592 | 512, 593 | 210, 594 | 661, 595 | 412, 596 | 633, 597 | 554, 598 | 171, 599 | 677, 600 | 134, 601 | 632 602 | ], 603 | "validation": [ 604 | 140, 605 | 308, 606 | 147, 607 | 242, 608 | 304, 609 | 270, 610 | 33, 611 | 189, 612 | 179, 613 | 67, 614 | 19, 615 | 230, 616 | 37, 617 | 282, 618 | 180, 619 | 344, 620 | 351, 621 | 197, 622 | 46, 623 | 181, 624 | 373, 625 | 196, 626 | 229, 627 | 358, 628 | 334, 629 | 40, 630 | 32, 631 | 379, 632 | 75, 633 | 292, 634 | 128, 635 | 247, 636 | 246, 637 | 251, 638 | 143 639 | ], 640 | "test": [ 641 | 102, 642 | 90, 643 | 275, 644 | 111, 645 | 166, 646 | 216, 647 | 68, 648 | 158, 649 | 209, 650 | 260, 651 | 366, 652 | 240, 653 | 325, 654 | 254, 655 | 295, 656 | 362, 657 | 135, 658 | 2, 659 | 88, 660 | 274, 661 | 393, 662 | 28, 663 | 280, 664 | 261, 665 | 354, 666 | 218, 667 | 203, 668 | 106, 669 | 170, 670 | 108, 671 | 36, 672 | 205, 673 | 157, 674 | 288, 675 | 76, 676 | 278, 677 | 177, 678 | 375, 679 | 178, 680 | 206, 681 | 156, 682 | 317, 683 | 163, 684 | 16, 685 | 133, 686 | 287, 687 | 61, 688 | 370, 689 | 194, 690 | 165, 691 | 390, 692 | 92, 693 | 332, 694 | 307, 695 | 394, 696 | 164, 697 | 13, 698 | 47, 699 | 249, 700 | 78, 701 | 265, 702 | 289, 703 | 187, 704 | 113, 705 | 350 706 | ] 707 | } -------------------------------------------------------------------------------- /batches/transplanted_tiles_20_timestamp_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "train": [ 3 | 491, 4 | 505, 5 | 398, 6 | 222, 7 | 679, 8 | 442, 9 | 624, 10 | 456, 11 | 515, 12 | 447, 13 | 481, 14 | 53, 15 | 477, 16 | 324, 17 | 352, 18 | 70, 19 | 26, 20 | 130, 21 | 606, 22 | 411, 23 | 182, 24 | 97, 25 | 200, 26 | 498, 27 | 593, 28 | 665, 29 | 663, 30 | 316, 31 | 675, 32 | 215, 33 | 343, 34 | 408, 35 | 186, 36 | 15, 37 | 595, 38 | 657, 39 | 284, 40 | 369, 41 | 376, 42 | 537, 43 | 407, 44 | 568, 45 | 642, 46 | 42, 47 | 681, 48 | 290, 49 | 494, 50 | 565, 51 | 327, 52 | 496, 53 | 3, 54 | 651, 55 | 516, 56 | 72, 57 | 531, 58 | 488, 59 | 483, 60 | 272, 61 | 633, 62 | 188, 63 | 608, 64 | 487, 65 | 293, 66 | 503, 67 | 636, 68 | 659, 69 | 381, 70 | 583, 71 | 136, 72 | 63, 73 | 692, 74 | 337, 75 | 212, 76 | 424, 77 | 425, 78 | 560, 79 | 162, 80 | 501, 81 | 91, 82 | 638, 83 | 650, 84 | 634, 85 | 201, 86 | 302, 87 | 81, 88 | 569, 89 | 131, 90 | 8, 91 | 504, 92 | 223, 93 | 451, 94 | 228, 95 | 599, 96 | 101, 97 | 580, 98 | 510, 99 | 696, 100 | 183, 101 | 472, 102 | 661, 103 | 646, 104 | 470, 105 | 676, 106 | 603, 107 | 513, 108 | 122, 109 | 52, 110 | 221, 111 | 538, 112 | 685, 113 | 671, 114 | 347, 115 | 259, 116 | 585, 117 | 24, 118 | 300, 119 | 245, 120 | 371, 121 | 152, 122 | 399, 123 | 572, 124 | 610, 125 | 372, 126 | 426, 127 | 58, 128 | 253, 129 | 422, 130 | 77, 131 | 319, 132 | 604, 133 | 43, 134 | 89, 135 | 590, 136 | 174, 137 | 364, 138 | 525, 139 | 652, 140 | 311, 141 | 508, 142 | 1, 143 | 395, 144 | 208, 145 | 511, 146 | 473, 147 | 598, 148 | 384, 149 | 437, 150 | 672, 151 | 269, 152 | 415, 153 | 357, 154 | 214, 155 | 382, 156 | 225, 157 | 207, 158 | 365, 159 | 609, 160 | 12, 161 | 322, 162 | 412, 163 | 39, 164 | 578, 165 | 459, 166 | 388, 167 | 478, 168 | 125, 169 | 405, 170 | 626, 171 | 653, 172 | 615, 173 | 378, 174 | 625, 175 | 448, 176 | 440, 177 | 444, 178 | 83, 179 | 279, 180 | 439, 181 | 446, 182 | 454, 183 | 397, 184 | 349, 185 | 547, 186 | 643, 187 | 460, 188 | 461, 189 | 190, 190 | 310, 191 | 529, 192 | 313, 193 | 432, 194 | 514, 195 | 336, 196 | 500, 197 | 315, 198 | 385, 199 | 60, 200 | 421, 201 | 387, 202 | 403, 203 | 109, 204 | 367, 205 | 172, 206 | 698, 207 | 377, 208 | 150, 209 | 86, 210 | 220, 211 | 522, 212 | 34, 213 | 298, 214 | 239, 215 | 542, 216 | 64, 217 | 458, 218 | 82, 219 | 73, 220 | 629, 221 | 306, 222 | 192, 223 | 648, 224 | 673, 225 | 363, 226 | 688, 227 | 59, 228 | 27, 229 | 694, 230 | 285, 231 | 684, 232 | 532, 233 | 556, 234 | 169, 235 | 575, 236 | 255, 237 | 107, 238 | 252, 239 | 587, 240 | 571, 241 | 87, 242 | 519, 243 | 396, 244 | 617, 245 | 644, 246 | 474, 247 | 462, 248 | 664, 249 | 493, 250 | 112, 251 | 518, 252 | 535, 253 | 96, 254 | 466, 255 | 576, 256 | 596, 257 | 167, 258 | 224, 259 | 41, 260 | 695, 261 | 127, 262 | 605, 263 | 18, 264 | 202, 265 | 345, 266 | 244, 267 | 297, 268 | 45, 269 | 647, 270 | 217, 271 | 540, 272 | 241, 273 | 283, 274 | 601, 275 | 582, 276 | 104, 277 | 21, 278 | 114, 279 | 29, 280 | 401, 281 | 138, 282 | 697, 283 | 699, 284 | 693, 285 | 670, 286 | 445, 287 | 658, 288 | 635, 289 | 276, 290 | 559, 291 | 321, 292 | 198, 293 | 526, 294 | 562, 295 | 438, 296 | 50, 297 | 418, 298 | 641, 299 | 455, 300 | 495, 301 | 35, 302 | 309, 303 | 65, 304 | 199, 305 | 326, 306 | 682, 307 | 597, 308 | 613, 309 | 333, 310 | 548, 311 | 509, 312 | 56, 313 | 469, 314 | 690, 315 | 219, 316 | 584, 317 | 303, 318 | 312, 319 | 621, 320 | 237, 321 | 294, 322 | 552, 323 | 148, 324 | 176, 325 | 44, 326 | 534, 327 | 619, 328 | 420, 329 | 256, 330 | 38, 331 | 490, 332 | 632, 333 | 586, 334 | 286, 335 | 544, 336 | 640, 337 | 551, 338 | 185, 339 | 471, 340 | 348, 341 | 686, 342 | 210, 343 | 137, 344 | 161, 345 | 129, 346 | 567, 347 | 622, 348 | 342, 349 | 30, 350 | 391, 351 | 11, 352 | 238, 353 | 262, 354 | 320, 355 | 155, 356 | 10, 357 | 655, 358 | 281, 359 | 441, 360 | 453, 361 | 533, 362 | 475, 363 | 457, 364 | 339, 365 | 645, 366 | 227, 367 | 329, 368 | 340, 369 | 314, 370 | 266, 371 | 159, 372 | 154, 373 | 680, 374 | 356, 375 | 554, 376 | 7, 377 | 144, 378 | 243, 379 | 115, 380 | 191, 381 | 263, 382 | 49, 383 | 301, 384 | 153, 385 | 639, 386 | 380, 387 | 392, 388 | 520, 389 | 31, 390 | 550, 391 | 211, 392 | 423, 393 | 296, 394 | 545, 395 | 620, 396 | 419, 397 | 592, 398 | 51, 399 | 145, 400 | 530, 401 | 506, 402 | 523, 403 | 666, 404 | 435, 405 | 486, 406 | 204, 407 | 623, 408 | 484, 409 | 277, 410 | 406, 411 | 85, 412 | 142, 413 | 328, 414 | 346, 415 | 233, 416 | 555, 417 | 566, 418 | 383, 419 | 271, 420 | 463, 421 | 497, 422 | 335, 423 | 62, 424 | 502, 425 | 141, 426 | 118, 427 | 662, 428 | 492, 429 | 482, 430 | 436, 431 | 602, 432 | 689, 433 | 22, 434 | 449, 435 | 291, 436 | 656, 437 | 79, 438 | 330, 439 | 235, 440 | 173, 441 | 667, 442 | 499, 443 | 404, 444 | 126, 445 | 579, 446 | 236, 447 | 171, 448 | 674, 449 | 99, 450 | 389, 451 | 268, 452 | 577, 453 | 95, 454 | 360, 455 | 139, 456 | 232, 457 | 581, 458 | 416, 459 | 591, 460 | 386, 461 | 374, 462 | 124, 463 | 611, 464 | 6, 465 | 25, 466 | 267, 467 | 305, 468 | 361, 469 | 414, 470 | 69, 471 | 103, 472 | 600, 473 | 660, 474 | 429, 475 | 17, 476 | 539, 477 | 570, 478 | 120, 479 | 71, 480 | 450, 481 | 353, 482 | 524, 483 | 691, 484 | 258, 485 | 521, 486 | 430, 487 | 55, 488 | 98, 489 | 649, 490 | 66, 491 | 168, 492 | 489, 493 | 677, 494 | 654, 495 | 549, 496 | 628, 497 | 4, 498 | 400, 499 | 299, 500 | 616, 501 | 607, 502 | 573, 503 | 74, 504 | 54, 505 | 678, 506 | 341, 507 | 480, 508 | 100, 509 | 433, 510 | 119, 511 | 434, 512 | 687, 513 | 443, 514 | 517, 515 | 264, 516 | 331, 517 | 512, 518 | 631, 519 | 618, 520 | 250, 521 | 536, 522 | 123, 523 | 273, 524 | 134, 525 | 151, 526 | 427, 527 | 234, 528 | 683, 529 | 146, 530 | 359, 531 | 20, 532 | 476, 533 | 627, 534 | 528, 535 | 409, 536 | 9, 537 | 195, 538 | 57, 539 | 94, 540 | 668, 541 | 614, 542 | 428, 543 | 318, 544 | 160, 545 | 14, 546 | 257, 547 | 175, 548 | 557, 549 | 110, 550 | 467, 551 | 417, 552 | 543, 553 | 465, 554 | 402, 555 | 588, 556 | 213, 557 | 184, 558 | 48, 559 | 612, 560 | 452, 561 | 193, 562 | 248, 563 | 323, 564 | 338, 565 | 563, 566 | 231, 567 | 669, 568 | 479, 569 | 410, 570 | 23, 571 | 117, 572 | 431, 573 | 561, 574 | 564, 575 | 637, 576 | 589, 577 | 105, 578 | 116, 579 | 132, 580 | 574, 581 | 485, 582 | 507, 583 | 558, 584 | 93, 585 | 80, 586 | 413, 587 | 594, 588 | 5, 589 | 630, 590 | 553, 591 | 84, 592 | 541, 593 | 368, 594 | 355, 595 | 149, 596 | 464, 597 | 546, 598 | 226, 599 | 121, 600 | 527, 601 | 468 602 | ], 603 | "validation": [ 604 | 140, 605 | 308, 606 | 147, 607 | 242, 608 | 304, 609 | 270, 610 | 33, 611 | 189, 612 | 179, 613 | 67, 614 | 19, 615 | 230, 616 | 37, 617 | 282, 618 | 180, 619 | 344, 620 | 351, 621 | 197, 622 | 46, 623 | 181, 624 | 373, 625 | 196, 626 | 229, 627 | 358, 628 | 334, 629 | 40, 630 | 32, 631 | 379, 632 | 75, 633 | 292, 634 | 128, 635 | 247, 636 | 246, 637 | 251, 638 | 143 639 | ], 640 | "test": [ 641 | 102, 642 | 90, 643 | 275, 644 | 111, 645 | 166, 646 | 216, 647 | 68, 648 | 158, 649 | 209, 650 | 260, 651 | 366, 652 | 240, 653 | 325, 654 | 254, 655 | 295, 656 | 362, 657 | 135, 658 | 2, 659 | 88, 660 | 274, 661 | 393, 662 | 28, 663 | 280, 664 | 261, 665 | 354, 666 | 218, 667 | 203, 668 | 106, 669 | 170, 670 | 108, 671 | 36, 672 | 205, 673 | 157, 674 | 288, 675 | 76, 676 | 278, 677 | 177, 678 | 375, 679 | 178, 680 | 206, 681 | 156, 682 | 317, 683 | 163, 684 | 16, 685 | 133, 686 | 287, 687 | 61, 688 | 370, 689 | 194, 690 | 165, 691 | 390, 692 | 92, 693 | 332, 694 | 307, 695 | 394, 696 | 164, 697 | 13, 698 | 47, 699 | 249, 700 | 78, 701 | 265, 702 | 289, 703 | 187, 704 | 113, 705 | 350 706 | ] 707 | } -------------------------------------------------------------------------------- /batches/transplanted_tiles_20_timestamp_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "train": [ 3 | 406, 4 | 567, 5 | 545, 6 | 478, 7 | 482, 8 | 457, 9 | 99, 10 | 515, 11 | 590, 12 | 541, 13 | 359, 14 | 153, 15 | 534, 16 | 608, 17 | 458, 18 | 297, 19 | 269, 20 | 257, 21 | 680, 22 | 159, 23 | 255, 24 | 563, 25 | 183, 26 | 625, 27 | 614, 28 | 677, 29 | 450, 30 | 259, 31 | 173, 32 | 652, 33 | 689, 34 | 59, 35 | 26, 36 | 662, 37 | 463, 38 | 456, 39 | 96, 40 | 666, 41 | 416, 42 | 74, 43 | 540, 44 | 663, 45 | 120, 46 | 85, 47 | 487, 48 | 601, 49 | 144, 50 | 480, 51 | 546, 52 | 657, 53 | 100, 54 | 605, 55 | 410, 56 | 378, 57 | 686, 58 | 544, 59 | 407, 60 | 558, 61 | 322, 62 | 319, 63 | 501, 64 | 647, 65 | 365, 66 | 561, 67 | 577, 68 | 639, 69 | 326, 70 | 44, 71 | 84, 72 | 454, 73 | 311, 74 | 415, 75 | 154, 76 | 386, 77 | 584, 78 | 695, 79 | 305, 80 | 687, 81 | 399, 82 | 588, 83 | 619, 84 | 129, 85 | 162, 86 | 81, 87 | 453, 88 | 547, 89 | 699, 90 | 516, 91 | 432, 92 | 349, 93 | 672, 94 | 681, 95 | 372, 96 | 284, 97 | 82, 98 | 356, 99 | 29, 100 | 634, 101 | 592, 102 | 345, 103 | 422, 104 | 441, 105 | 318, 106 | 93, 107 | 572, 108 | 329, 109 | 56, 110 | 172, 111 | 235, 112 | 617, 113 | 578, 114 | 633, 115 | 184, 116 | 38, 117 | 421, 118 | 225, 119 | 557, 120 | 660, 121 | 512, 122 | 60, 123 | 674, 124 | 627, 125 | 151, 126 | 239, 127 | 103, 128 | 348, 129 | 315, 130 | 599, 131 | 5, 132 | 185, 133 | 226, 134 | 402, 135 | 374, 136 | 430, 137 | 381, 138 | 566, 139 | 642, 140 | 640, 141 | 602, 142 | 451, 143 | 622, 144 | 263, 145 | 73, 146 | 207, 147 | 43, 148 | 461, 149 | 434, 150 | 443, 151 | 535, 152 | 529, 153 | 697, 154 | 604, 155 | 479, 156 | 495, 157 | 398, 158 | 369, 159 | 460, 160 | 3, 161 | 469, 162 | 665, 163 | 71, 164 | 131, 165 | 382, 166 | 18, 167 | 630, 168 | 114, 169 | 656, 170 | 559, 171 | 219, 172 | 492, 173 | 127, 174 | 442, 175 | 552, 176 | 323, 177 | 324, 178 | 244, 179 | 48, 180 | 685, 181 | 554, 182 | 586, 183 | 500, 184 | 355, 185 | 579, 186 | 452, 187 | 476, 188 | 252, 189 | 477, 190 | 176, 191 | 437, 192 | 200, 193 | 520, 194 | 14, 195 | 594, 196 | 337, 197 | 338, 198 | 283, 199 | 564, 200 | 536, 201 | 66, 202 | 490, 203 | 473, 204 | 548, 205 | 227, 206 | 41, 207 | 125, 208 | 648, 209 | 539, 210 | 581, 211 | 644, 212 | 352, 213 | 58, 214 | 508, 215 | 45, 216 | 208, 217 | 580, 218 | 671, 219 | 391, 220 | 641, 221 | 142, 222 | 675, 223 | 237, 224 | 481, 225 | 136, 226 | 496, 227 | 281, 228 | 573, 229 | 201, 230 | 405, 231 | 313, 232 | 24, 233 | 138, 234 | 69, 235 | 20, 236 | 55, 237 | 222, 238 | 440, 239 | 693, 240 | 408, 241 | 171, 242 | 77, 243 | 83, 244 | 645, 245 | 367, 246 | 192, 247 | 474, 248 | 51, 249 | 653, 250 | 363, 251 | 659, 252 | 31, 253 | 504, 254 | 21, 255 | 124, 256 | 426, 257 | 211, 258 | 376, 259 | 139, 260 | 612, 261 | 241, 262 | 518, 263 | 327, 264 | 562, 265 | 130, 266 | 217, 267 | 50, 268 | 607, 269 | 409, 270 | 531, 271 | 141, 272 | 221, 273 | 272, 274 | 384, 275 | 238, 276 | 435, 277 | 397, 278 | 668, 279 | 532, 280 | 213, 281 | 346, 282 | 115, 283 | 293, 284 | 596, 285 | 654, 286 | 243, 287 | 603, 288 | 89, 289 | 301, 290 | 439, 291 | 472, 292 | 271, 293 | 574, 294 | 643, 295 | 256, 296 | 623, 297 | 267, 298 | 444, 299 | 497, 300 | 145, 301 | 494, 302 | 527, 303 | 433, 304 | 250, 305 | 86, 306 | 331, 307 | 676, 308 | 683, 309 | 9, 310 | 95, 311 | 510, 312 | 445, 313 | 98, 314 | 1, 315 | 296, 316 | 484, 317 | 446, 318 | 491, 319 | 149, 320 | 533, 321 | 224, 322 | 694, 323 | 199, 324 | 152, 325 | 521, 326 | 333, 327 | 126, 328 | 264, 329 | 498, 330 | 468, 331 | 631, 332 | 670, 333 | 447, 334 | 403, 335 | 431, 336 | 273, 337 | 523, 338 | 620, 339 | 30, 340 | 12, 341 | 413, 342 | 507, 343 | 636, 344 | 669, 345 | 353, 346 | 360, 347 | 117, 348 | 191, 349 | 8, 350 | 425, 351 | 465, 352 | 470, 353 | 464, 354 | 593, 355 | 556, 356 | 475, 357 | 519, 358 | 212, 359 | 528, 360 | 591, 361 | 387, 362 | 629, 363 | 414, 364 | 285, 365 | 526, 366 | 555, 367 | 509, 368 | 262, 369 | 411, 370 | 54, 371 | 589, 372 | 202, 373 | 34, 374 | 568, 375 | 606, 376 | 49, 377 | 692, 378 | 105, 379 | 698, 380 | 302, 381 | 423, 382 | 483, 383 | 377, 384 | 245, 385 | 321, 386 | 380, 387 | 188, 388 | 146, 389 | 72, 390 | 342, 391 | 110, 392 | 314, 393 | 597, 394 | 542, 395 | 438, 396 | 396, 397 | 513, 398 | 52, 399 | 347, 400 | 123, 401 | 570, 402 | 638, 403 | 401, 404 | 303, 405 | 525, 406 | 122, 407 | 576, 408 | 392, 409 | 543, 410 | 551, 411 | 137, 412 | 678, 413 | 511, 414 | 232, 415 | 6, 416 | 471, 417 | 419, 418 | 190, 419 | 455, 420 | 223, 421 | 104, 422 | 436, 423 | 70, 424 | 598, 425 | 655, 426 | 688, 427 | 595, 428 | 404, 429 | 23, 430 | 169, 431 | 286, 432 | 97, 433 | 650, 434 | 502, 435 | 167, 436 | 626, 437 | 64, 438 | 101, 439 | 361, 440 | 690, 441 | 427, 442 | 53, 443 | 459, 444 | 649, 445 | 87, 446 | 290, 447 | 79, 448 | 537, 449 | 233, 450 | 585, 451 | 161, 452 | 116, 453 | 661, 454 | 613, 455 | 499, 456 | 182, 457 | 582, 458 | 517, 459 | 91, 460 | 493, 461 | 412, 462 | 258, 463 | 538, 464 | 682, 465 | 429, 466 | 175, 467 | 112, 468 | 35, 469 | 132, 470 | 400, 471 | 27, 472 | 609, 473 | 658, 474 | 294, 475 | 530, 476 | 420, 477 | 637, 478 | 300, 479 | 193, 480 | 204, 481 | 679, 482 | 107, 483 | 94, 484 | 340, 485 | 628, 486 | 388, 487 | 253, 488 | 368, 489 | 298, 490 | 565, 491 | 569, 492 | 428, 493 | 449, 494 | 309, 495 | 11, 496 | 17, 497 | 63, 498 | 236, 499 | 316, 500 | 549, 501 | 57, 502 | 134, 503 | 357, 504 | 571, 505 | 279, 506 | 174, 507 | 65, 508 | 234, 509 | 210, 510 | 341, 511 | 466, 512 | 330, 513 | 624, 514 | 119, 515 | 39, 516 | 371, 517 | 118, 518 | 121, 519 | 266, 520 | 646, 521 | 248, 522 | 395, 523 | 691, 524 | 335, 525 | 62, 526 | 155, 527 | 462, 528 | 651, 529 | 467, 530 | 231, 531 | 418, 532 | 220, 533 | 611, 534 | 312, 535 | 550, 536 | 80, 537 | 553, 538 | 424, 539 | 150, 540 | 268, 541 | 10, 542 | 320, 543 | 486, 544 | 291, 545 | 15, 546 | 4, 547 | 488, 548 | 339, 549 | 343, 550 | 448, 551 | 25, 552 | 299, 553 | 522, 554 | 215, 555 | 673, 556 | 168, 557 | 514, 558 | 575, 559 | 635, 560 | 696, 561 | 22, 562 | 7, 563 | 417, 564 | 186, 565 | 198, 566 | 385, 567 | 148, 568 | 195, 569 | 615, 570 | 664, 571 | 632, 572 | 618, 573 | 328, 574 | 336, 575 | 489, 576 | 42, 577 | 503, 578 | 610, 579 | 583, 580 | 616, 581 | 276, 582 | 667, 583 | 587, 584 | 310, 585 | 109, 586 | 389, 587 | 524, 588 | 160, 589 | 364, 590 | 506, 591 | 277, 592 | 214, 593 | 600, 594 | 383, 595 | 560, 596 | 621, 597 | 228, 598 | 485, 599 | 306, 600 | 684, 601 | 505 602 | ], 603 | "validation": [ 604 | 140, 605 | 308, 606 | 147, 607 | 242, 608 | 304, 609 | 270, 610 | 33, 611 | 189, 612 | 179, 613 | 67, 614 | 19, 615 | 230, 616 | 37, 617 | 282, 618 | 180, 619 | 344, 620 | 351, 621 | 197, 622 | 46, 623 | 181, 624 | 373, 625 | 196, 626 | 229, 627 | 358, 628 | 334, 629 | 40, 630 | 32, 631 | 379, 632 | 75, 633 | 292, 634 | 128, 635 | 247, 636 | 246, 637 | 251, 638 | 143 639 | ], 640 | "test": [ 641 | 102, 642 | 90, 643 | 275, 644 | 111, 645 | 166, 646 | 216, 647 | 68, 648 | 158, 649 | 209, 650 | 260, 651 | 366, 652 | 240, 653 | 325, 654 | 254, 655 | 295, 656 | 362, 657 | 135, 658 | 2, 659 | 88, 660 | 274, 661 | 393, 662 | 28, 663 | 280, 664 | 261, 665 | 354, 666 | 218, 667 | 203, 668 | 106, 669 | 170, 670 | 108, 671 | 36, 672 | 205, 673 | 157, 674 | 288, 675 | 76, 676 | 278, 677 | 177, 678 | 375, 679 | 178, 680 | 206, 681 | 156, 682 | 317, 683 | 163, 684 | 16, 685 | 133, 686 | 287, 687 | 61, 688 | 370, 689 | 194, 690 | 165, 691 | 390, 692 | 92, 693 | 332, 694 | 307, 695 | 394, 696 | 164, 697 | 13, 698 | 47, 699 | 249, 700 | 78, 701 | 265, 702 | 289, 703 | 187, 704 | 113, 705 | 350 706 | ] 707 | } -------------------------------------------------------------------------------- /backend/pipeline.py: -------------------------------------------------------------------------------- 1 | import gc 2 | import os 3 | import math 4 | import statistics 5 | import json 6 | import random 7 | import shutil 8 | import pandas 9 | import numpy as np 10 | import matplotlib.pyplot as plt 11 | from typing import Tuple, Sequence, List, Dict 12 | from tensorflow.image import flip_up_down, flip_left_right, rot90 13 | from tensorflow.keras.utils import Sequence as KerasSequence 14 | from tensorflow.keras.models import Model 15 | from tensorflow.keras.backend import clear_session 16 | from backend.utils import adjust_rgb 17 | from backend.metrics import MIOU 18 | from backend.config import get_timestamp, get_waterbody_transfer, get_random_subsample, get_fusion_head, get_water_threshold 19 | from models.utils import evaluate_model 20 | from backend.data_loader import DataLoader 21 | 22 | 23 | class ImgSequence(KerasSequence): 24 | def __init__(self, timestamp: int, tiles: List[int], batch_size: int = 32, bands: Sequence[str] = None, is_train: bool = False, random_subsample: bool = False, upscale_swir: bool = True): 25 | # Initialize Member Variables 26 | self.data_loader = DataLoader(timestamp, overlapping_patches=is_train, random_subsample=(random_subsample and is_train), upscale_swir=upscale_swir) 27 | self.batch_size = batch_size 28 | self.bands = ["RGB"] if bands is None else bands 29 | self.indices = [] 30 | self.is_train = is_train 31 | 32 | # Generate Patch Indices From Tiles 33 | for tile in tiles: 34 | self.indices += [((tile * 100) + patch_index) for patch_index in range(1, (10 if is_train else 5))] 35 | 36 | # Shuffle Patches 37 | if self.is_train: 38 | np.random.shuffle(self.indices) 39 | 40 | def __len__(self) -> int: 41 | return math.ceil(len(self.indices) / self.batch_size) 42 | 43 | def __getitem__(self, idx, normalize_data=True): 44 | # Create Batch 45 | feature_batches = {"RGB": [], "NIR": [], "SWIR": [], "mask": []} 46 | batch = self.indices[idx*self.batch_size:(idx+1)*self.batch_size] 47 | for b in batch: 48 | 49 | # Get Mask And Features For Patch b 50 | features = self._get_features(b) 51 | 52 | # Augment Data 53 | if self.is_train: 54 | self.augment_features(features) 55 | 56 | # Add Features To Batch 57 | for key, val in features.items(): 58 | if normalize_data: 59 | feature_batches[key].append(DataLoader.normalize_channels(val.astype("float32")) if key != "mask" else val) 60 | else: 61 | feature_batches[key].append(val) 62 | 63 | # Return Batch 64 | return [np.array(feature_batches[band]).astype("float32") for band in ("RGB", "NIR", "SWIR") if len(feature_batches[band]) > 0], np.array(feature_batches["mask"]).astype("float32") 65 | 66 | def on_epoch_end(self): 67 | if self.is_train: 68 | np.random.shuffle(self.indices) 69 | 70 | def get_patch_indices(self) -> List[int]: 71 | """ 72 | Get the patch indices for all patches in this dataset 73 | :returns: The list of all patch indices in this dataset. 74 | """ 75 | return list(self.indices) 76 | 77 | def predict_batch(self, model: Model, directory: str): 78 | """ 79 | Predict on a batch of feature samples and save the resulting prediction to disk alongside its mask and MIoU performance 80 | :param batch: A list of patch indexes on which we want to predict 81 | :param data_loader: An object for reading patches from the disk 82 | :param model: The model whose prediction we are interested in 83 | :param config: The script configuration stored as a dictionary; typically read from an external file 84 | :param directory: The name of the directory in which we want to save the model predictions 85 | :param threshold: We filter out patches whose water content percentage is below this value 86 | :return: Nothing 87 | """ 88 | # Create Directory To Save Predictions 89 | if directory not in os.listdir(): 90 | os.mkdir(directory) 91 | model_directory = f"{directory}/{model.name}" 92 | if model.name in os.listdir(directory): 93 | shutil.rmtree(model_directory) 94 | os.mkdir(model_directory) 95 | 96 | # Iterate Over All Patches In Batch 97 | MIoUs, MIoU, i = [], MIOU(), 0 98 | for batch in range(len(self)): 99 | 100 | # Get Batch 101 | features, masks = self.__getitem__(batch, normalize_data=False) 102 | normalized_features, _ = self.__getitem__(batch) 103 | rgb_features = features[0] if "RGB" in self.bands else None 104 | nir_features = features[1 if "RGB" in self.bands else 0] if "NIR" in self.bands else None 105 | swir_features = features[2] if "SWIR" in self.bands else None 106 | 107 | # Get Prediction 108 | predictions = model.predict(normalized_features) 109 | 110 | # Iterate Over Each Prediction In The Batch 111 | for p in range(predictions.shape[0]): 112 | 113 | mask = masks[p, ...] 114 | prediction = predictions[p, ...] 115 | MIoUs.append([self.indices[i], MIoU(mask, prediction).numpy()]) 116 | 117 | # Plot Features 118 | col = 0 119 | _, axs = plt.subplots(1, len(self.bands) + 2) 120 | for band, feature in zip(["RGB", "NIR", "SWIR"], [rgb_features, nir_features, swir_features]): 121 | if feature is not None: 122 | axs[col].imshow(adjust_rgb(feature[p, ...], gamma=0.5) if feature.shape[-1] == 3 else feature[p, ...]) 123 | axs[col].set_title(band, fontsize=6) 124 | axs[col].axis("off") 125 | col += 1 126 | 127 | # Plot Ground Truth 128 | axs[col].imshow(mask) 129 | axs[col].set_title("Ground Truth", fontsize=6) 130 | axs[col].axis("off") 131 | col += 1 132 | 133 | # Plot Prediction 134 | axs[col].imshow(np.where(prediction < 0.5, 0, 1)) 135 | axs[col].set_title(f"Prediction ({MIoUs[-1][1]:.3f})", fontsize=6) 136 | axs[col].axis("off") 137 | col += 1 138 | 139 | # Save Prediction To Disk 140 | plt.tight_layout() 141 | plt.savefig(f"{model_directory}/prediction.{self.indices[i]}.png", dpi=300, bbox_inches='tight') 142 | plt.cla() 143 | plt.close() 144 | 145 | # Housekeeping 146 | gc.collect() 147 | clear_session() 148 | i += 1 149 | 150 | # Save MIoU For Each Patch 151 | # summary = np.array(MIoUs) 152 | # df = pandas.DataFrame(summary[:, 1:], columns=["MIoU"], index=summary[:, 0].astype("int32")) 153 | # df.to_csv(f"{model_directory}/Evaluation.csv", index_label="patch") 154 | 155 | # Evaluate Final Performance 156 | results = evaluate_model(model, self) 157 | df = pandas.DataFrame(np.reshape(np.array(results), (1, len(results))), columns=model.metrics_names) 158 | df.to_csv(f"{model_directory}/Overview.csv", index=False) 159 | return results 160 | 161 | def augment_features(self, features: Dict[str, np.ndarray]) -> None: 162 | # Apply Random Horizontal/Vertical Flip with 50% Probability 163 | self._rotate_patch(features) 164 | self._flip_patch(features) 165 | 166 | def _rotate_patch(self, patch: Dict[str, np.ndarray]) -> None: 167 | """Apply 90 degree clockwise rotation to a given patch with 25% probability""" 168 | outcome = random.randint(1, 100) 169 | if outcome <= 25: 170 | for band in patch.keys(): 171 | patch[band] = rot90(patch[band], k=1).numpy() 172 | 173 | def _flip_patch(self, patch: Dict[str, np.ndarray]) -> None: 174 | """Apply a horizontal flip with 50% probability and a vertical flip with 50% probability to a given patch""" 175 | outcome_1 = random.randint(1, 100) 176 | outcome_2 = random.randint(1, 100) 177 | for band in patch.keys(): 178 | patch[band] = flip_up_down(patch[band]).numpy() if outcome_1 <= 50 else patch[band] 179 | patch[band] = flip_left_right(patch[band]).numpy() if outcome_2 <= 50 else patch[band] 180 | 181 | def _water_content(self, mask: np.ndarray) -> float: 182 | return np.sum(mask) / mask.size * 100.0 183 | 184 | def _get_features(self, patch: int, subsample: bool = True) -> Dict[str, np.ndarray]: 185 | return self.data_loader.get_features(patch, self.bands, subsample=subsample) 186 | 187 | 188 | class WaterbodyTransferImgSequence(ImgSequence): 189 | def __init__(self, timestamp: int, tiles: List[int], batch_size: int = 32, bands: Sequence[str] = None, is_train: bool = False, random_subsample: bool = False, upscale_swir: bool = True, water_threshold: int = 5): 190 | super().__init__(timestamp, tiles, batch_size, bands, is_train, random_subsample, upscale_swir) 191 | self.water_threshold = water_threshold 192 | 193 | """A data pipeline that returns tiles with transplanted waterbodies""" 194 | def _get_features(self, patch: int, subsample: bool = True) -> Dict[str, np.ndarray]: 195 | tile_index = patch // 100 196 | return self.data_loader.get_features(patch, self.bands, tile_dir="tiles" if tile_index <= 400 else f"transplanted_tiles_{self.water_threshold}") 197 | 198 | 199 | def load_dataset(config) -> Tuple[ImgSequence, ImgSequence, ImgSequence]: 200 | """ 201 | Load the training, validation, and test datasets 202 | :param config: The script configuration encoded as a Python dictionary; typically read from an external file 203 | :returns: The training, validation, and test data as a tuple of the form (train, validation, test) 204 | """ 205 | # Read Parameters From Config File 206 | bands = config["hyperparameters"]["bands"] 207 | batch_size = config["hyperparameters"]["batch_size"] 208 | 209 | # Read Batches From JSON File 210 | water_threshold = get_water_threshold(config) 211 | batch_filename = f"batches/transplanted_tiles_{water_threshold}_timestamp_{get_timestamp(config)}.json" if get_waterbody_transfer(config) else "batches/tiles.json" 212 | with open(batch_filename) as f: 213 | batch_file = json.loads(f.read()) 214 | 215 | # Create Train, Validation, And Test Data 216 | upscale_swir = get_fusion_head(config) != "paper" 217 | if get_waterbody_transfer(config): 218 | train_data = WaterbodyTransferImgSequence(get_timestamp(config), batch_file["train"], batch_size=batch_size, bands=bands, is_train=True, random_subsample=get_random_subsample(config), upscale_swir=upscale_swir, water_threshold=water_threshold) 219 | else: 220 | train_data = ImgSequence(get_timestamp(config), batch_file["train"], batch_size=batch_size, bands=bands, is_train=True, random_subsample=get_random_subsample(config), upscale_swir=upscale_swir) 221 | val_data = ImgSequence(get_timestamp(config), batch_file["validation"], batch_size=12, bands=bands, is_train=False, upscale_swir=upscale_swir) 222 | test_data = ImgSequence(get_timestamp(config), batch_file["test"], batch_size=12, bands=bands, is_train=False, upscale_swir=upscale_swir) 223 | return train_data, val_data, test_data --------------------------------------------------------------------------------