Icon

02. Define U-Net - solution

Create a U-Net Architecture networkFor Option 2: Create a Tensorflow2 environment under Preferences -> KNIME -> Python Deep Learning Option 1: Create a Unet Architecture using No-Code nodes1. Use the Keras Input Layer node to create the input layer of shape (224,224,1)2. Create 5 Encoding Layers using the U-Net 2D Encoding Layer component with the following settings - Filter = 16, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.1, MaxPooling Pool Size = 2,2 - Filter = 32, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.1, MaxPooling Pool Size = 2,2 - Filter = 64, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.2, MaxPooling Pool Size = 2,2 - Filter = 128, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.2, MaxPooling Pool Size = 2,2 - Filter = 256, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.3, MaxPooling Pool Size = 2,23. Create 4 Decoding Layers using the U-Net 2D DEconding Layer component (the settings will be taken automatically from the Encoding Layers)4. Create on final convolutional layer using the Keras Convolution 2D Layer node with Padding = "same" and Activation function = "Sigmoid"5. Use the Keras Network Writer node to write your network to a file named u-net.h5 in the data folder (Hint: use workflow relative path: knime://knime.workflow/../../data/u-net.h5) Option 2: Create a Unet Architecture using DL Python Nodes1. In the Conda Environment propagation use the correct conda environment (using Tensorflow2 environment created in the beginning under Preferences) is selected.2. In the DL Python Network Creator update the Python code to create a U-Net with 5 Encoding Layers and 4 Decoding Layers with the follwoing settings - Filter = 16, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.1, MaxPooling Pool Size = 2,2 - Filter = 32, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.1, MaxPooling Pool Size = 2,2 - Filter = 64, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.2, MaxPooling Pool Size = 2,2 - Filter = 128, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.2, MaxPooling Pool Size = 2,2 - Filter = 256, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.3, MaxPooling Pool Size = 2,23. Use the Tensorflow2 Network Writer node to write your network to a file named u-net-tf2.h5 in the data folder and make sure the conda.enrionment variable is selected in the Executable Tab (Hint: use workflow relative path: ../../data/u-net.h5) 161UNet13264128256128643216u-net.h5u-net-tf2.h5 U-Net 2D -Encoding Layer Keras Input Layer DL PythonNetwork Creator Keras Convolution2D Layer U-Net 2D -Encoding Layer U-Net 2D -Encoding Layer U-Net 2D -Encoding Layer U-Net 2D -Encoding Layer U-Net 2D -Decoding Layer U-Net 2D -Decoding Layer U-Net 2D -Decoding Layer U-Net 2D -Decoding Layer Keras NetworkWriter TensorFlow 2Network Writer Conda EnvironmentPropagation Create a U-Net Architecture networkFor Option 2: Create a Tensorflow2 environment under Preferences -> KNIME -> Python Deep Learning Option 1: Create a Unet Architecture using No-Code nodes1. Use the Keras Input Layer node to create the input layer of shape (224,224,1)2. Create 5 Encoding Layers using the U-Net 2D Encoding Layer component with the following settings - Filter = 16, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.1, MaxPooling Pool Size = 2,2 - Filter = 32, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.1, MaxPooling Pool Size = 2,2 - Filter = 64, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.2, MaxPooling Pool Size = 2,2 - Filter = 128, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.2, MaxPooling Pool Size = 2,2 - Filter = 256, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.3, MaxPooling Pool Size = 2,23. Create 4 Decoding Layers using the U-Net 2D DEconding Layer component (the settings will be taken automatically from the Encoding Layers)4. Create on final convolutional layer using the Keras Convolution 2D Layer node with Padding = "same" and Activation function = "Sigmoid"5. Use the Keras Network Writer node to write your network to a file named u-net.h5 in the data folder (Hint: use workflow relative path: knime://knime.workflow/../../data/u-net.h5) Option 2: Create a Unet Architecture using DL Python Nodes1. In the Conda Environment propagation use the correct conda environment (using Tensorflow2 environment created in the beginning under Preferences) is selected.2. In the DL Python Network Creator update the Python code to create a U-Net with 5 Encoding Layers and 4 Decoding Layers with the follwoing settings - Filter = 16, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.1, MaxPooling Pool Size = 2,2 - Filter = 32, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.1, MaxPooling Pool Size = 2,2 - Filter = 64, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.2, MaxPooling Pool Size = 2,2 - Filter = 128, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.2, MaxPooling Pool Size = 2,2 - Filter = 256, Activation function = "ELU”, Kernel Size = 3,3, Dropout Rate = 0.3, MaxPooling Pool Size = 2,23. Use the Tensorflow2 Network Writer node to write your network to a file named u-net-tf2.h5 in the data folder and make sure the conda.enrionment variable is selected in the Executable Tab (Hint: use workflow relative path: ../../data/u-net.h5) 161UNet13264128256128643216u-net.h5u-net-tf2.h5U-Net 2D -Encoding Layer Keras Input Layer DL PythonNetwork Creator Keras Convolution2D Layer U-Net 2D -Encoding Layer U-Net 2D -Encoding Layer U-Net 2D -Encoding Layer U-Net 2D -Encoding Layer U-Net 2D -Decoding Layer U-Net 2D -Decoding Layer U-Net 2D -Decoding Layer U-Net 2D -Decoding Layer Keras NetworkWriter TensorFlow 2Network Writer Conda EnvironmentPropagation

Nodes

Extensions

Links