Complete the code to import the correct layer for convolution in U-Net.
from tensorflow.keras.layers import [1]
The U-Net architecture uses 2D convolutional layers to process image data. Conv2D is the correct layer to use.
Complete the code to define the input shape for a U-Net model processing 128x128 RGB images.
inputs = Input(shape=[1])The input shape for RGB images includes height, width, and 3 color channels. So (128, 128, 3) is correct.
Fix the error in the code to correctly add a max pooling layer in U-Net.
pool1 = [1](2, 2)(conv1)
MaxPooling2D is used to reduce spatial dimensions in 2D images. MaxPooling1D is for sequences, so it's incorrect here.
Fill both blanks to correctly concatenate skip connection features in U-Net.
merge1 = Concatenate(axis=[1])([[2], up1])
Concatenation in U-Net happens along the channel axis, which is axis 3 in TensorFlow's channel-last format. The skip connection uses conv1 features.
Fill all three blanks to complete the output layer of U-Net for binary segmentation.
outputs = Conv2D([1], (1, 1), activation=[2])([3])
For binary segmentation, the output layer has 1 filter with sigmoid activation applied to the last convolution layer conv10.