{"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.10.13"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":7708506,"sourceType":"datasetVersion","datasetId":4500725},{"sourceId":12184,"sourceType":"modelInstanceVersion","modelInstanceId":9887},{"sourceId":12187,"sourceType":"modelInstanceVersion","modelInstanceId":9890}],"dockerImageVersionId":30646,"isInternetEnabled":false,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"This version has all three outputs, calculates strain (ezz) and uses a mask input.","metadata":{}},{"cell_type":"markdown","source":"It should be noted that development and training was done on a local machine. Importing the dataset into Kaggle seems to have changed the way the images are ordered, hence the train/validation/test sets defined are different despite using the same random seed.\n\nThis has the knock on effect of meaning that the 'test' slices used on the paper will likely not be in the test set now if running the notebook below with the currently defined random seed. This will have an impact on all outputs and stats generated if loading one of the provided trained models (which were used for generating the paper results).\n","metadata":{}},{"cell_type":"code","source":"#importing the libraries used\nimport os\nimport cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport tifffile as tiff\nimport tensorflow as tf\nfrom tensorflow.keras.layers import Input, Conv2D, MaxPooling2D, Flatten, Dense\nfrom tensorflow.keras.models import Model\nfrom scipy.ndimage import zoom\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import MinMaxScaler\nfrom tensorflow.keras.layers import Input, Conv2D, MaxPooling2D, Flatten, Dense, Dropout, concatenate, BatchNormalization, Multiply, UpSampling2D\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\nfrom tensorflow.keras.callbacks import LearningRateScheduler\nfrom tensorflow.keras.callbacks import ModelCheckpoint\nfrom keras.regularizers import l2, l1\nfrom scipy.ndimage import binary_dilation, binary_erosion\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\nimport matplotlib.gridspec as gridspec\n\n%matplotlib inline","metadata":{"execution":{"iopub.status.busy":"2024-02-26T23:40:40.579644Z","iopub.execute_input":"2024-02-26T23:40:40.580429Z","iopub.status.idle":"2024-02-26T23:40:59.195292Z","shell.execute_reply.started":"2024-02-26T23:40:40.580383Z","shell.execute_reply":"2024-02-26T23:40:59.193858Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"