{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "import sys\n",
    "import six\n",
    "import glob\n",
    "import math\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from keras.utils import to_categorical\n",
    "import scipy.ndimage as nd\n",
    "from scipy.ndimage import zoom\n",
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import keras\n",
    "import tensorflow as tf\n",
    "from keras import Model\n",
    "from keras import backend as K\n",
    "from keras.regularizers import l2\n",
    "from keras.engine import Layer,InputSpec\n",
    "from keras.layers.merge import concatenate\n",
    "from keras.callbacks import TensorBoard,Callback\n",
    "from keras.layers.advanced_activations import LeakyReLU\n",
    "from keras.preprocessing.image import ImageDataGenerator\n",
    "from keras.layers.normalization import BatchNormalization\n",
    "from keras.callbacks import ModelCheckpoint, ReduceLROnPlateau\n",
    "from keras import initializers, regularizers, constraints,optimizers\n",
    "from keras.callbacks import ModelCheckpoint, LearningRateScheduler,TensorBoard\n",
    "from keras.layers import Add,Input,Conv3D,Convolution3D,Dropout,UpSampling3D,Concatenate,MaxPooling3D,\\\n",
    "GlobalAveragePooling3D,Dense,GlobalMaxPooling3D,Lambda,Activation,Reshape,Permute, PReLU, Deconvolution3D,Multiply,GlobalAveragePooling3D,Dense"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "from InstanceNorm import InstanceNormalization"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "num_blocks = 5\n",
    "# strides = [2,2,2,2,2]\n",
    "strides = [1,2,2,2,2]\n",
    "nodule_seg_strides = [1,2,2,2,2]\n",
    "# atrous_rates = [1,1,2,4,8]\n",
    "atrous_rates = [1,1,1,1,1]\n",
    "base_filters = 32\n",
    "norm_func = InstanceNormalization\n",
    "activation_func = LeakyReLU\n",
    "kernel_size = 3\n",
    "padding = 'same'\n",
    "dropout_rate = 0\n",
    "input_shape = (32,64,64,1)\n",
    "num_classes = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "{\n",
    "    \"training\": {\n",
    "        \"train_file\": \"../files/train_files.json\",\n",
    "        \"val_txt\": \"../files/val_files.json\",\n",
    "        \"encoder\":\"NoduleSegEncoder_proxima\",\n",
    "        \"encoder_file\":\"\",\n",
    "        \"decoder_file\":\"\",\n",
    "        \"decoder\":\"NoduleSegDecoder_proxima\",\n",
    "        \"num_classes\": 1,\n",
    "        \"voxel_size\":32,\n",
    "        \"num_slice\":64,\n",
    "        \"load_pre_trained\": false,\n",
    "        \"pre_model_file\": \"\",\n",
    "        \"base_path\":'/hdd/disk4/Segmentation/Weights',\n",
    "        \"n_channels\": 1,\n",
    "        \"early_stop\": 10,\n",
    "        \"initial_learning_rate\": 5*1e-4,\n",
    "        \"learning_rate_drop\": 0.5,\n",
    "        \"train_batch_size\": 2,\n",
    "        \"val_batch_size\": 2,\n",
    "        \"normalizer\": [-1024.0, 400.0],\n",
    "        \"n_epochs\": 25,\n",
    "        \"shuffle\": true,\n",
    "        \"aug\": true,\n",
    "        \n",
    "    }\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "from ResNet import Resnet3DBuilder\n",
    "from VGGmodel import VGG\n",
    "from NoduleSegEncoder import NoduleSegEncoder_proxima\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "from CommonLayers import *\n",
    "# from NoduleSegDecoder import NoduleSegDecoder_proxima\n",
    "sys.path.append('../decoders/')\n",
    "from NoduleSegDecoder import NoduleSegDecoder_proxima"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "parameter_list = {\n",
    "    'num_blocks':num_blocks,\n",
    "    'strides':strides,\n",
    "    'atrous_rates':atrous_rates,\n",
    "    'base_filters':base_filters,\n",
    "    'norm_func':norm_func,\n",
    "    'activation_func':activation_func,\n",
    "    'kernel_size':kernel_size,\n",
    "    'padding':padding,\n",
    "    'dropout_rate':dropout_rate,\n",
    "    'num_classes':1,\n",
    "    'classification_layers':GlobalMaxPooling3D\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "resnet_parameter_list = {\n",
    "    'base_filters':base_filters,\n",
    "    'norm_func':norm_func,\n",
    "    'activation_func':activation_func,\n",
    "    'kernel_size':kernel_size,\n",
    "    'padding':padding,\n",
    "    'dropout_rate':dropout_rate,\n",
    "    'num_classes':1,\n",
    "    'classification_layers':GlobalMaxPooling3D,\n",
    "    'init_kernel_size':1\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "noduleseg_parameter_list = {\n",
    "    'num_blocks':num_blocks,\n",
    "    'strides':nodule_seg_strides,\n",
    "    'atrous_rates':[1 for _ in range(num_blocks)],\n",
    "    'base_filters':base_filters,\n",
    "    'norm_func':norm_func,\n",
    "    'activation_func':activation_func,\n",
    "    'kernel_size':kernel_size,\n",
    "    'padding':padding,\n",
    "    'dropout_rate':0.5,\n",
    "    'num_classes':1,\n",
    "    'classification_layers':GlobalMaxPooling3D\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "result = NoduleSegEncoder_proxima(input_shape,**noduleseg_parameter_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "result1 = VGG(input_shape,**parameter_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "resnet_builder = Resnet3DBuilder(**resnet_parameter_list)\n",
    "result_res = resnet_builder.build_resnet_50(input_shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "noduleseg_decoder_parameter_list = {\n",
    "   'kernel_initializer':'he_normal',\n",
    "    'kernel_regularizer':l2(1e-4),\n",
    "    'kernel_size':kernel_size,\n",
    "    'final_kernel_size':1,\n",
    "    'norm_func':norm_func,\n",
    "    'activation_func':activation_func,\n",
    "    'kernel_size':kernel_size,\n",
    "    'padding':padding,\n",
    "    'seg_num_class':1,\n",
    "    'merge_axis':-1,\n",
    "    'SEB_choice':True,\n",
    "    'ACR_choice':False,\n",
    "    'OCR_choice':False,\n",
    "    'deep_supervision':True,\n",
    "    'num_units':[3,3,3,3]\n",
    "    \n",
    "    \n",
    "    \n",
    "    \n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "model = NoduleSegDecoder_proxima(result,**noduleseg_decoder_parameter_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "__________________________________________________________________________________________________\n",
      "Layer (type)                    Output Shape         Param #     Connected to                     \n",
      "==================================================================================================\n",
      "input_1 (InputLayer)            (None, 32, 64, 64, 1 0                                            \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock01_conv_01 (C (None, 32, 64, 64, 3 896         input_1[0][0]                    \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock01_norm_01 (I (None, 32, 64, 64, 3 2           NoduleSegConvBlock01_conv_01[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock01_activation (None, 32, 64, 64, 3 0           NoduleSegConvBlock01_norm_01[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock01_conv_02 (C (None, 32, 64, 64, 3 27680       NoduleSegConvBlock01_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock01_norm_02 (I (None, 32, 64, 64, 3 2           NoduleSegConvBlock01_conv_02[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock01_activation (None, 32, 64, 64, 3 0           NoduleSegConvBlock01_norm_02[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock01_conv_03 (C (None, 32, 64, 64, 3 27680       NoduleSegConvBlock01_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock01_norm_03 (I (None, 32, 64, 64, 3 2           NoduleSegConvBlock01_conv_03[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock01_activation (None, 32, 64, 64, 3 0           NoduleSegConvBlock01_norm_03[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock01_add (Add)  (None, 32, 64, 64, 3 0           NoduleSegConvBlock01_activation_0\n",
      "                                                                 NoduleSegConvBlock01_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegEncoderDropout01 (Drop (None, 32, 64, 64, 3 0           NoduleSegConvBlock01_add[0][0]   \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock02_conv_01 (C (None, 16, 32, 32, 6 55360       NoduleSegEncoderDropout01[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock02_norm_01 (I (None, 16, 32, 32, 6 2           NoduleSegConvBlock02_conv_01[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock02_activation (None, 16, 32, 32, 6 0           NoduleSegConvBlock02_norm_01[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock02_conv_02 (C (None, 16, 32, 32, 6 110656      NoduleSegConvBlock02_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock02_norm_02 (I (None, 16, 32, 32, 6 2           NoduleSegConvBlock02_conv_02[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock02_activation (None, 16, 32, 32, 6 0           NoduleSegConvBlock02_norm_02[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock02_conv_03 (C (None, 16, 32, 32, 6 110656      NoduleSegConvBlock02_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock02_norm_03 (I (None, 16, 32, 32, 6 2           NoduleSegConvBlock02_conv_03[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock02_activation (None, 16, 32, 32, 6 0           NoduleSegConvBlock02_norm_03[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock02_add (Add)  (None, 16, 32, 32, 6 0           NoduleSegConvBlock02_activation_0\n",
      "                                                                 NoduleSegConvBlock02_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegEncoderDropout02 (Drop (None, 16, 32, 32, 6 0           NoduleSegConvBlock02_add[0][0]   \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock03_conv_01 (C (None, 8, 16, 16, 12 221312      NoduleSegEncoderDropout02[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock03_norm_01 (I (None, 8, 16, 16, 12 2           NoduleSegConvBlock03_conv_01[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock03_activation (None, 8, 16, 16, 12 0           NoduleSegConvBlock03_norm_01[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock03_conv_02 (C (None, 8, 16, 16, 12 442496      NoduleSegConvBlock03_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock03_norm_02 (I (None, 8, 16, 16, 12 2           NoduleSegConvBlock03_conv_02[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock03_activation (None, 8, 16, 16, 12 0           NoduleSegConvBlock03_norm_02[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock03_conv_03 (C (None, 8, 16, 16, 12 442496      NoduleSegConvBlock03_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock03_norm_03 (I (None, 8, 16, 16, 12 2           NoduleSegConvBlock03_conv_03[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock03_activation (None, 8, 16, 16, 12 0           NoduleSegConvBlock03_norm_03[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock03_add (Add)  (None, 8, 16, 16, 12 0           NoduleSegConvBlock03_activation_0\n",
      "                                                                 NoduleSegConvBlock03_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegEncoderDropout03 (Drop (None, 8, 16, 16, 12 0           NoduleSegConvBlock03_add[0][0]   \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock04_conv_01 (C (None, 4, 8, 8, 256) 884992      NoduleSegEncoderDropout03[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock04_norm_01 (I (None, 4, 8, 8, 256) 2           NoduleSegConvBlock04_conv_01[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock04_activation (None, 4, 8, 8, 256) 0           NoduleSegConvBlock04_norm_01[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock04_conv_02 (C (None, 4, 8, 8, 256) 1769728     NoduleSegConvBlock04_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock04_norm_02 (I (None, 4, 8, 8, 256) 2           NoduleSegConvBlock04_conv_02[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock04_activation (None, 4, 8, 8, 256) 0           NoduleSegConvBlock04_norm_02[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock04_conv_03 (C (None, 4, 8, 8, 256) 1769728     NoduleSegConvBlock04_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock04_norm_03 (I (None, 4, 8, 8, 256) 2           NoduleSegConvBlock04_conv_03[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock04_activation (None, 4, 8, 8, 256) 0           NoduleSegConvBlock04_norm_03[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock04_add (Add)  (None, 4, 8, 8, 256) 0           NoduleSegConvBlock04_activation_0\n",
      "                                                                 NoduleSegConvBlock04_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegEncoderDropout04 (Drop (None, 4, 8, 8, 256) 0           NoduleSegConvBlock04_add[0][0]   \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock05_conv_01 (C (None, 2, 4, 4, 512) 3539456     NoduleSegEncoderDropout04[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock05_norm_01 (I (None, 2, 4, 4, 512) 2           NoduleSegConvBlock05_conv_01[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock05_activation (None, 2, 4, 4, 512) 0           NoduleSegConvBlock05_norm_01[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock05_conv_02 (C (None, 2, 4, 4, 512) 7078400     NoduleSegConvBlock05_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock05_norm_02 (I (None, 2, 4, 4, 512) 2           NoduleSegConvBlock05_conv_02[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock05_activation (None, 2, 4, 4, 512) 0           NoduleSegConvBlock05_norm_02[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock05_conv_03 (C (None, 2, 4, 4, 512) 7078400     NoduleSegConvBlock05_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock05_norm_03 (I (None, 2, 4, 4, 512) 2           NoduleSegConvBlock05_conv_03[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock05_activation (None, 2, 4, 4, 512) 0           NoduleSegConvBlock05_norm_03[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegConvBlock05_add (Add)  (None, 2, 4, 4, 512) 0           NoduleSegConvBlock05_activation_0\n",
      "                                                                 NoduleSegConvBlock05_activation_0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegEncoderDropout05 (Drop (None, 2, 4, 4, 512) 0           NoduleSegConvBlock05_add[0][0]   \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_pr (None, 2, 4, 4, 512) 0           NoduleSegEncoderDropout05[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_co (None, 2, 4, 4, 256) 3539200     NoduleSegDecoder_Block01_SEB_preU\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_no (None, 2, 4, 4, 256) 2           NoduleSegDecoder_Block01_SEB_conv\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_upsamp (None, 4, 8, 8, 512) 0           NoduleSegEncoderDropout05[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_ac (None, 2, 4, 4, 256) 0           NoduleSegDecoder_Block01_SEB_norm\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_conv_0 (None, 4, 8, 8, 256) 3539200     NoduleSegDecoder_Block01_upsample\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_up (None, 4, 8, 8, 256) 0           NoduleSegDecoder_Block01_SEB_acti\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_norm_0 (None, 4, 8, 8, 256) 2           NoduleSegDecoder_Block01_conv_01[\n",
      "__________________________________________________________________________________________________\n",
      "multiply_4 (Multiply)           (None, 4, 8, 8, 256) 0           NoduleSegDecoder_Block01_SEB_upsa\n",
      "                                                                 NoduleSegEncoderDropout04[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_activa (None, 4, 8, 8, 256) 0           NoduleSegDecoder_Block01_norm_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_Concat (None, 4, 8, 8, 512) 0           multiply_4[0][0]                 \n",
      "                                                                 NoduleSegDecoder_Block01_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_conv_0 (None, 4, 8, 8, 256) 3539200     NoduleSegDecoder_Block01_Concaten\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_norm_0 (None, 4, 8, 8, 256) 2           NoduleSegDecoder_Block01_conv_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_activa (None, 4, 8, 8, 256) 0           NoduleSegDecoder_Block01_norm_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_pr (None, 4, 8, 8, 512) 0           NoduleSegEncoderDropout05[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_pr (None, 4, 8, 8, 256) 0           NoduleSegEncoderDropout04[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_conv_0 (None, 4, 8, 8, 256) 1769728     NoduleSegDecoder_Block01_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_co (None, 4, 8, 8, 768) 0           NoduleSegDecoder_Block02_SEB_preU\n",
      "                                                                 NoduleSegDecoder_Block02_SEB_preU\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_norm_0 (None, 4, 8, 8, 256) 2           NoduleSegDecoder_Block01_conv_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_co (None, 4, 8, 8, 128) 2654336     NoduleSegDecoder_Block02_SEB_conc\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_activa (None, 4, 8, 8, 256) 0           NoduleSegDecoder_Block01_norm_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_no (None, 4, 8, 8, 128) 2           NoduleSegDecoder_Block02_SEB_conv\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_upsamp (None, 8, 16, 16, 25 0           NoduleSegDecoder_Block01_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_ac (None, 4, 8, 8, 128) 0           NoduleSegDecoder_Block02_SEB_norm\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_conv_0 (None, 8, 16, 16, 12 884864      NoduleSegDecoder_Block02_upsample\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_up (None, 8, 16, 16, 12 0           NoduleSegDecoder_Block02_SEB_acti\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_norm_0 (None, 8, 16, 16, 12 2           NoduleSegDecoder_Block02_conv_01[\n",
      "__________________________________________________________________________________________________\n",
      "multiply_5 (Multiply)           (None, 8, 16, 16, 12 0           NoduleSegDecoder_Block02_SEB_upsa\n",
      "                                                                 NoduleSegEncoderDropout03[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_activa (None, 8, 16, 16, 12 0           NoduleSegDecoder_Block02_norm_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_Concat (None, 8, 16, 16, 25 0           multiply_5[0][0]                 \n",
      "                                                                 NoduleSegDecoder_Block02_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_conv_0 (None, 8, 16, 16, 12 884864      NoduleSegDecoder_Block02_Concaten\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_norm_0 (None, 8, 16, 16, 12 2           NoduleSegDecoder_Block02_conv_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_activa (None, 8, 16, 16, 12 0           NoduleSegDecoder_Block02_norm_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_conv_0 (None, 8, 16, 16, 12 442496      NoduleSegDecoder_Block02_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_pr (None, 8, 16, 16, 51 0           NoduleSegEncoderDropout05[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_pr (None, 8, 16, 16, 25 0           NoduleSegEncoderDropout04[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_pr (None, 8, 16, 16, 12 0           NoduleSegEncoderDropout03[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_norm_0 (None, 8, 16, 16, 12 2           NoduleSegDecoder_Block02_conv_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_co (None, 8, 16, 16, 89 0           NoduleSegDecoder_Block03_SEB_preU\n",
      "                                                                 NoduleSegDecoder_Block03_SEB_preU\n",
      "                                                                 NoduleSegDecoder_Block03_SEB_preU\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_activa (None, 8, 16, 16, 12 0           NoduleSegDecoder_Block02_norm_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_co (None, 8, 16, 16, 64 1548352     NoduleSegDecoder_Block03_SEB_conc\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_no (None, 8, 16, 16, 64 2           NoduleSegDecoder_Block03_SEB_conv\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_upsamp (None, 16, 32, 32, 1 0           NoduleSegDecoder_Block02_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_ac (None, 8, 16, 16, 64 0           NoduleSegDecoder_Block03_SEB_norm\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_conv_0 (None, 16, 32, 32, 6 221248      NoduleSegDecoder_Block03_upsample\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_up (None, 16, 32, 32, 6 0           NoduleSegDecoder_Block03_SEB_acti\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_norm_0 (None, 16, 32, 32, 6 2           NoduleSegDecoder_Block03_conv_01[\n",
      "__________________________________________________________________________________________________\n",
      "multiply_6 (Multiply)           (None, 16, 32, 32, 6 0           NoduleSegDecoder_Block03_SEB_upsa\n",
      "                                                                 NoduleSegEncoderDropout02[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_activa (None, 16, 32, 32, 6 0           NoduleSegDecoder_Block03_norm_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_Concat (None, 16, 32, 32, 1 0           multiply_6[0][0]                 \n",
      "                                                                 NoduleSegDecoder_Block03_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_conv_0 (None, 16, 32, 32, 6 221248      NoduleSegDecoder_Block03_Concaten\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_norm_0 (None, 16, 32, 32, 6 2           NoduleSegDecoder_Block03_conv_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_activa (None, 16, 32, 32, 6 0           NoduleSegDecoder_Block03_norm_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_conv_0 (None, 16, 32, 32, 6 110656      NoduleSegDecoder_Block03_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_norm_0 (None, 16, 32, 32, 6 2           NoduleSegDecoder_Block03_conv_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_activa (None, 16, 32, 32, 6 0           NoduleSegDecoder_Block03_norm_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_upsamp (None, 32, 64, 64, 6 0           NoduleSegDecoder_Block03_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_conv_0 (None, 32, 64, 64, 3 55328       NoduleSegDecoder_Block04_upsample\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_norm_0 (None, 32, 64, 64, 3 2           NoduleSegDecoder_Block04_conv_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_activa (None, 32, 64, 64, 3 0           NoduleSegDecoder_Block04_norm_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_Concat (None, 32, 64, 64, 6 0           NoduleSegEncoderDropout01[0][0]  \n",
      "                                                                 NoduleSegDecoder_Block04_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_conv_0 (None, 32, 64, 64, 3 55328       NoduleSegDecoder_Block04_Concaten\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_norm_0 (None, 32, 64, 64, 3 2           NoduleSegDecoder_Block04_conv_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_activa (None, 32, 64, 64, 3 0           NoduleSegDecoder_Block04_norm_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_conv_0 (None, 32, 64, 64, 3 27680       NoduleSegDecoder_Block04_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_norm_0 (None, 32, 64, 64, 3 2           NoduleSegDecoder_Block04_conv_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_activa (None, 32, 64, 64, 3 0           NoduleSegDecoder_Block04_norm_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 8, 16, 16, 8) 27656       NoduleSegDecoder_Block02_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 16, 32, 32, 8 13832       NoduleSegDecoder_Block03_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 32, 64, 64, 8 6920        NoduleSegDecoder_Block04_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 8, 16, 16, 8) 2           NoduleSegDeepCombineBlock_block01\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 16, 32, 32, 8 2           NoduleSegDeepCombineBlock_block02\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 32, 64, 64, 8 2           NoduleSegDeepCombineBlock_block03\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 8, 16, 16, 8) 0           NoduleSegDeepCombineBlock_block01\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 16, 32, 32, 8 0           NoduleSegDeepCombineBlock_block02\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 32, 64, 64, 8 0           NoduleSegDeepCombineBlock_block03\n",
      "__________________________________________________________________________________________________\n",
      "deep_supervision_upsample_01 (U (None, 32, 64, 64, 8 0           NoduleSegDeepCombineBlock_block01\n",
      "__________________________________________________________________________________________________\n",
      "deep_supervision_upsample_02 (U (None, 32, 64, 64, 8 0           NoduleSegDeepCombineBlock_block02\n",
      "__________________________________________________________________________________________________\n",
      "deep_supervision_upsample_03 (U (None, 32, 64, 64, 8 0           NoduleSegDeepCombineBlock_block03\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_DeepSupervisio (None, 32, 64, 64, 1 9           deep_supervision_upsample_01[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_DeepSupervisio (None, 32, 64, 64, 1 9           deep_supervision_upsample_02[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_DeepSupervisio (None, 32, 64, 64, 1 9           deep_supervision_upsample_03[0][0\n",
      "==================================================================================================\n",
      "Total params: 43,102,165\n",
      "Trainable params: 43,102,165\n",
      "Non-trainable params: 0\n",
      "__________________________________________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "model1 = NoduleSegDecoder_proxima(result1,**noduleseg_decoder_parameter_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "__________________________________________________________________________________________________\n",
      "Layer (type)                    Output Shape         Param #     Connected to                     \n",
      "==================================================================================================\n",
      "input_2 (InputLayer)            (None, 32, 64, 64, 1 0                                            \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block01_conv_01 (Conv3D)    (None, 32, 64, 64, 3 896         input_2[0][0]                    \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block01_norm_01 (InstanceNo (None, 32, 64, 64, 3 2           VGG_block01_conv_01[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block01_activation_01 (Leak (None, 32, 64, 64, 3 0           VGG_block01_norm_01[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block01_conv_02 (Conv3D)    (None, 32, 64, 64, 3 27680       VGG_block01_activation_01[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block01_norm_02 (InstanceNo (None, 32, 64, 64, 3 2           VGG_block01_conv_02[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block01_activation_02 (Leak (None, 32, 64, 64, 3 0           VGG_block01_norm_02[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block02_conv_01 (Conv3D)    (None, 32, 64, 64, 6 55360       VGG_block01_activation_02[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block02_norm_01 (InstanceNo (None, 32, 64, 64, 6 2           VGG_block02_conv_01[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block02_activation_01 (Leak (None, 32, 64, 64, 6 0           VGG_block02_norm_01[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block02_conv_02 (Conv3D)    (None, 32, 64, 64, 6 110656      VGG_block02_activation_01[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block02_norm_02 (InstanceNo (None, 32, 64, 64, 6 2           VGG_block02_conv_02[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block02_activation_02 (Leak (None, 32, 64, 64, 6 0           VGG_block02_norm_02[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block02_pool (MaxPooling3D) (None, 16, 32, 32, 6 0           VGG_block02_activation_02[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block03_conv_01 (Conv3D)    (None, 16, 32, 32, 1 221312      VGG_block02_pool[0][0]           \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block03_norm_01 (InstanceNo (None, 16, 32, 32, 1 2           VGG_block03_conv_01[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block03_activation_01 (Leak (None, 16, 32, 32, 1 0           VGG_block03_norm_01[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block03_conv_02 (Conv3D)    (None, 16, 32, 32, 1 442496      VGG_block03_activation_01[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block03_norm_02 (InstanceNo (None, 16, 32, 32, 1 2           VGG_block03_conv_02[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block03_activation_02 (Leak (None, 16, 32, 32, 1 0           VGG_block03_norm_02[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block03_conv_03 (Conv3D)    (None, 16, 32, 32, 1 442496      VGG_block03_activation_02[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block03_norm_03 (InstanceNo (None, 16, 32, 32, 1 2           VGG_block03_conv_03[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block03_activation_03 (Leak (None, 16, 32, 32, 1 0           VGG_block03_norm_03[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block03_pool (MaxPooling3D) (None, 8, 16, 16, 12 0           VGG_block03_activation_03[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block04_conv_01 (Conv3D)    (None, 8, 16, 16, 25 884992      VGG_block03_pool[0][0]           \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block04_norm_01 (InstanceNo (None, 8, 16, 16, 25 2           VGG_block04_conv_01[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block04_activation_01 (Leak (None, 8, 16, 16, 25 0           VGG_block04_norm_01[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block04_conv_02 (Conv3D)    (None, 8, 16, 16, 25 1769728     VGG_block04_activation_01[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block04_norm_02 (InstanceNo (None, 8, 16, 16, 25 2           VGG_block04_conv_02[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block04_activation_02 (Leak (None, 8, 16, 16, 25 0           VGG_block04_norm_02[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block04_conv_03 (Conv3D)    (None, 8, 16, 16, 25 1769728     VGG_block04_activation_02[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block04_norm_03 (InstanceNo (None, 8, 16, 16, 25 2           VGG_block04_conv_03[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block04_activation_03 (Leak (None, 8, 16, 16, 25 0           VGG_block04_norm_03[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block04_pool (MaxPooling3D) (None, 4, 8, 8, 256) 0           VGG_block04_activation_03[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block05_conv_01 (Conv3D)    (None, 4, 8, 8, 512) 3539456     VGG_block04_pool[0][0]           \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block05_norm_01 (InstanceNo (None, 4, 8, 8, 512) 2           VGG_block05_conv_01[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block05_activation_01 (Leak (None, 4, 8, 8, 512) 0           VGG_block05_norm_01[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block05_conv_02 (Conv3D)    (None, 4, 8, 8, 512) 7078400     VGG_block05_activation_01[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block05_norm_02 (InstanceNo (None, 4, 8, 8, 512) 2           VGG_block05_conv_02[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block05_activation_02 (Leak (None, 4, 8, 8, 512) 0           VGG_block05_norm_02[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block05_conv_03 (Conv3D)    (None, 4, 8, 8, 512) 7078400     VGG_block05_activation_02[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block05_norm_03 (InstanceNo (None, 4, 8, 8, 512) 2           VGG_block05_conv_03[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block05_activation_03 (Leak (None, 4, 8, 8, 512) 0           VGG_block05_norm_03[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "VGG_block05_pool (MaxPooling3D) (None, 2, 4, 4, 512) 0           VGG_block05_activation_03[0][0]  \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_pr (None, 2, 4, 4, 512) 0           VGG_block05_pool[0][0]           \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_co (None, 2, 4, 4, 256) 3539200     NoduleSegDecoder_Block01_SEB_preU\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_no (None, 2, 4, 4, 256) 2           NoduleSegDecoder_Block01_SEB_conv\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_upsamp (None, 4, 8, 8, 512) 0           VGG_block05_pool[0][0]           \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_ac (None, 2, 4, 4, 256) 0           NoduleSegDecoder_Block01_SEB_norm\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_conv_0 (None, 4, 8, 8, 256) 3539200     NoduleSegDecoder_Block01_upsample\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_up (None, 4, 8, 8, 256) 0           NoduleSegDecoder_Block01_SEB_acti\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_norm_0 (None, 4, 8, 8, 256) 2           NoduleSegDecoder_Block01_conv_01[\n",
      "__________________________________________________________________________________________________\n",
      "multiply_7 (Multiply)           (None, 4, 8, 8, 256) 0           NoduleSegDecoder_Block01_SEB_upsa\n",
      "                                                                 VGG_block04_pool[0][0]           \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_activa (None, 4, 8, 8, 256) 0           NoduleSegDecoder_Block01_norm_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_Concat (None, 4, 8, 8, 512) 0           multiply_7[0][0]                 \n",
      "                                                                 NoduleSegDecoder_Block01_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_conv_0 (None, 4, 8, 8, 256) 3539200     NoduleSegDecoder_Block01_Concaten\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_norm_0 (None, 4, 8, 8, 256) 2           NoduleSegDecoder_Block01_conv_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_activa (None, 4, 8, 8, 256) 0           NoduleSegDecoder_Block01_norm_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_pr (None, 4, 8, 8, 512) 0           VGG_block05_pool[0][0]           \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_pr (None, 4, 8, 8, 256) 0           VGG_block04_pool[0][0]           \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_conv_0 (None, 4, 8, 8, 256) 1769728     NoduleSegDecoder_Block01_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_co (None, 4, 8, 8, 768) 0           NoduleSegDecoder_Block02_SEB_preU\n",
      "                                                                 NoduleSegDecoder_Block02_SEB_preU\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_norm_0 (None, 4, 8, 8, 256) 2           NoduleSegDecoder_Block01_conv_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_co (None, 4, 8, 8, 128) 2654336     NoduleSegDecoder_Block02_SEB_conc\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_activa (None, 4, 8, 8, 256) 0           NoduleSegDecoder_Block01_norm_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_no (None, 4, 8, 8, 128) 2           NoduleSegDecoder_Block02_SEB_conv\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_upsamp (None, 8, 16, 16, 25 0           NoduleSegDecoder_Block01_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_ac (None, 4, 8, 8, 128) 0           NoduleSegDecoder_Block02_SEB_norm\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_conv_0 (None, 8, 16, 16, 12 884864      NoduleSegDecoder_Block02_upsample\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_up (None, 8, 16, 16, 12 0           NoduleSegDecoder_Block02_SEB_acti\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_norm_0 (None, 8, 16, 16, 12 2           NoduleSegDecoder_Block02_conv_01[\n",
      "__________________________________________________________________________________________________\n",
      "multiply_8 (Multiply)           (None, 8, 16, 16, 12 0           NoduleSegDecoder_Block02_SEB_upsa\n",
      "                                                                 VGG_block03_pool[0][0]           \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_activa (None, 8, 16, 16, 12 0           NoduleSegDecoder_Block02_norm_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_Concat (None, 8, 16, 16, 25 0           multiply_8[0][0]                 \n",
      "                                                                 NoduleSegDecoder_Block02_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_conv_0 (None, 8, 16, 16, 12 884864      NoduleSegDecoder_Block02_Concaten\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_norm_0 (None, 8, 16, 16, 12 2           NoduleSegDecoder_Block02_conv_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_activa (None, 8, 16, 16, 12 0           NoduleSegDecoder_Block02_norm_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_conv_0 (None, 8, 16, 16, 12 442496      NoduleSegDecoder_Block02_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_pr (None, 8, 16, 16, 51 0           VGG_block05_pool[0][0]           \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_pr (None, 8, 16, 16, 25 0           VGG_block04_pool[0][0]           \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_pr (None, 8, 16, 16, 12 0           VGG_block03_pool[0][0]           \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_norm_0 (None, 8, 16, 16, 12 2           NoduleSegDecoder_Block02_conv_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_co (None, 8, 16, 16, 89 0           NoduleSegDecoder_Block03_SEB_preU\n",
      "                                                                 NoduleSegDecoder_Block03_SEB_preU\n",
      "                                                                 NoduleSegDecoder_Block03_SEB_preU\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_activa (None, 8, 16, 16, 12 0           NoduleSegDecoder_Block02_norm_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_co (None, 8, 16, 16, 64 1548352     NoduleSegDecoder_Block03_SEB_conc\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_no (None, 8, 16, 16, 64 2           NoduleSegDecoder_Block03_SEB_conv\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_upsamp (None, 16, 32, 32, 1 0           NoduleSegDecoder_Block02_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_ac (None, 8, 16, 16, 64 0           NoduleSegDecoder_Block03_SEB_norm\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_conv_0 (None, 16, 32, 32, 6 221248      NoduleSegDecoder_Block03_upsample\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_up (None, 16, 32, 32, 6 0           NoduleSegDecoder_Block03_SEB_acti\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_norm_0 (None, 16, 32, 32, 6 2           NoduleSegDecoder_Block03_conv_01[\n",
      "__________________________________________________________________________________________________\n",
      "multiply_9 (Multiply)           (None, 16, 32, 32, 6 0           NoduleSegDecoder_Block03_SEB_upsa\n",
      "                                                                 VGG_block02_pool[0][0]           \n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_activa (None, 16, 32, 32, 6 0           NoduleSegDecoder_Block03_norm_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_Concat (None, 16, 32, 32, 1 0           multiply_9[0][0]                 \n",
      "                                                                 NoduleSegDecoder_Block03_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_conv_0 (None, 16, 32, 32, 6 221248      NoduleSegDecoder_Block03_Concaten\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_norm_0 (None, 16, 32, 32, 6 2           NoduleSegDecoder_Block03_conv_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_activa (None, 16, 32, 32, 6 0           NoduleSegDecoder_Block03_norm_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_conv_0 (None, 16, 32, 32, 6 110656      NoduleSegDecoder_Block03_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_norm_0 (None, 16, 32, 32, 6 2           NoduleSegDecoder_Block03_conv_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_activa (None, 16, 32, 32, 6 0           NoduleSegDecoder_Block03_norm_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_upsamp (None, 32, 64, 64, 6 0           NoduleSegDecoder_Block03_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_conv_0 (None, 32, 64, 64, 3 55328       NoduleSegDecoder_Block04_upsample\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_norm_0 (None, 32, 64, 64, 3 2           NoduleSegDecoder_Block04_conv_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_activa (None, 32, 64, 64, 3 0           NoduleSegDecoder_Block04_norm_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_Concat (None, 32, 64, 64, 6 0           VGG_block01_activation_02[0][0]  \n",
      "                                                                 NoduleSegDecoder_Block04_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_conv_0 (None, 32, 64, 64, 3 55328       NoduleSegDecoder_Block04_Concaten\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_norm_0 (None, 32, 64, 64, 3 2           NoduleSegDecoder_Block04_conv_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_activa (None, 32, 64, 64, 3 0           NoduleSegDecoder_Block04_norm_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_conv_0 (None, 32, 64, 64, 3 27680       NoduleSegDecoder_Block04_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_norm_0 (None, 32, 64, 64, 3 2           NoduleSegDecoder_Block04_conv_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_activa (None, 32, 64, 64, 3 0           NoduleSegDecoder_Block04_norm_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 8, 16, 16, 8) 27656       NoduleSegDecoder_Block02_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 16, 32, 32, 8 13832       NoduleSegDecoder_Block03_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 32, 64, 64, 8 6920        NoduleSegDecoder_Block04_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 8, 16, 16, 8) 2           NoduleSegDeepCombineBlock_block01\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 16, 32, 32, 8 2           NoduleSegDeepCombineBlock_block02\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 32, 64, 64, 8 2           NoduleSegDeepCombineBlock_block03\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 8, 16, 16, 8) 0           NoduleSegDeepCombineBlock_block01\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 16, 32, 32, 8 0           NoduleSegDeepCombineBlock_block02\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 32, 64, 64, 8 0           NoduleSegDeepCombineBlock_block03\n",
      "__________________________________________________________________________________________________\n",
      "deep_supervision_upsample_01 (U (None, 32, 64, 64, 8 0           NoduleSegDeepCombineBlock_block01\n",
      "__________________________________________________________________________________________________\n",
      "deep_supervision_upsample_02 (U (None, 32, 64, 64, 8 0           NoduleSegDeepCombineBlock_block02\n",
      "__________________________________________________________________________________________________\n",
      "deep_supervision_upsample_03 (U (None, 32, 64, 64, 8 0           NoduleSegDeepCombineBlock_block03\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_DeepSupervisio (None, 32, 64, 64, 1 9           deep_supervision_upsample_01[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_DeepSupervisio (None, 32, 64, 64, 1 9           deep_supervision_upsample_02[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_DeepSupervisio (None, 32, 64, 64, 1 9           deep_supervision_upsample_03[0][0\n",
      "==================================================================================================\n",
      "Total params: 42,963,825\n",
      "Trainable params: 42,963,825\n",
      "Non-trainable params: 0\n",
      "__________________________________________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "model1.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "model2 = NoduleSegDecoder_proxima(result_res,**noduleseg_decoder_parameter_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "__________________________________________________________________________________________________\n",
      "Layer (type)                    Output Shape         Param #     Connected to                     \n",
      "==================================================================================================\n",
      "input_3 (InputLayer)            (None, 32, 64, 64, 1 0                                            \n",
      "__________________________________________________________________________________________________\n",
      "ResNet_InitBlock_conv_01 (Conv3 (None, 32, 64, 64, 3 64          input_3[0][0]                    \n",
      "__________________________________________________________________________________________________\n",
      "ResNet_InitBlock_norm_01 (Insta (None, 32, 64, 64, 3 2           ResNet_InitBlock_conv_01[0][0]   \n",
      "__________________________________________________________________________________________________\n",
      "ResNet_InitBlock_activation_01  (None, 32, 64, 64, 3 0           ResNet_InitBlock_norm_01[0][0]   \n",
      "__________________________________________________________________________________________________\n",
      "ResNet_InitBlock_pool (MaxPooli (None, 16, 32, 32, 3 0           ResNet_InitBlock_activation_01[0]\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_1v1_co (None, 16, 32, 32, 6 2112        ResNet_InitBlock_pool[0][0]      \n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_1v1_no (None, 16, 32, 32, 6 2           ResNet_BottleNeckBlock01_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_1v1_ac (None, 16, 32, 32, 6 0           ResNet_BottleNeckBlock01_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_3v3__c (None, 16, 32, 32, 2 442624      ResNet_BottleNeckBlock01_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_3v3__n (None, 16, 32, 32, 2 2           ResNet_BottleNeckBlock01_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_3v3__a (None, 16, 32, 32, 2 0           ResNet_BottleNeckBlock01_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_residu (None, 16, 32, 32, 6 442432      ResNet_BottleNeckBlock01_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_residu (None, 16, 32, 32, 6 2           ResNet_BottleNeckBlock01_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_layer0 (None, 16.0, 32.0, 3 55360       ResNet_InitBlock_pool[0][0]      \n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_residu (None, 16, 32, 32, 6 0           ResNet_BottleNeckBlock01_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_layer0 (None, 16.0, 32.0, 3 0           ResNet_BottleNeckBlock01_layer01_\n",
      "                                                                 ResNet_BottleNeckBlock01_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_1v1_co (None, 16.0, 32.0, 3 4160        ResNet_BottleNeckBlock01_layer01_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_1v1_no (None, 16.0, 32.0, 3 2           ResNet_BottleNeckBlock01_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_1v1_ac (None, 16.0, 32.0, 3 0           ResNet_BottleNeckBlock01_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_3v3__c (None, 16.0, 32.0, 3 442624      ResNet_BottleNeckBlock01_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_3v3__n (None, 16.0, 32.0, 3 2           ResNet_BottleNeckBlock01_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_3v3__a (None, 16.0, 32.0, 3 0           ResNet_BottleNeckBlock01_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_residu (None, 16.0, 32.0, 3 442432      ResNet_BottleNeckBlock01_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_residu (None, 16.0, 32.0, 3 2           ResNet_BottleNeckBlock01_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_residu (None, 16.0, 32.0, 3 0           ResNet_BottleNeckBlock01_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_layer0 (None, 16.0, 32.0, 3 0           ResNet_BottleNeckBlock01_layer01_\n",
      "                                                                 ResNet_BottleNeckBlock01_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_1v1_co (None, 16.0, 32.0, 3 4160        ResNet_BottleNeckBlock01_layer02_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_1v1_no (None, 16.0, 32.0, 3 2           ResNet_BottleNeckBlock01_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_1v1_ac (None, 16.0, 32.0, 3 0           ResNet_BottleNeckBlock01_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_3v3__c (None, 16.0, 32.0, 3 442624      ResNet_BottleNeckBlock01_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_3v3__n (None, 16.0, 32.0, 3 2           ResNet_BottleNeckBlock01_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_3v3__a (None, 16.0, 32.0, 3 0           ResNet_BottleNeckBlock01_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_residu (None, 16.0, 32.0, 3 442432      ResNet_BottleNeckBlock01_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_residu (None, 16.0, 32.0, 3 2           ResNet_BottleNeckBlock01_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_residu (None, 16.0, 32.0, 3 0           ResNet_BottleNeckBlock01_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock01_layer0 (None, 16.0, 32.0, 3 0           ResNet_BottleNeckBlock01_layer02_\n",
      "                                                                 ResNet_BottleNeckBlock01_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_1v1_co (None, 8.0, 16.0, 16 8320        ResNet_BottleNeckBlock01_layer03_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_1v1_no (None, 8.0, 16.0, 16 2           ResNet_BottleNeckBlock02_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_1v1_ac (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_3v3__c (None, 8.0, 16.0, 16 1769984     ResNet_BottleNeckBlock02_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_3v3__n (None, 8.0, 16.0, 16 2           ResNet_BottleNeckBlock02_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_3v3__a (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_residu (None, 8.0, 16.0, 16 1769600     ResNet_BottleNeckBlock02_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_residu (None, 8.0, 16.0, 16 2           ResNet_BottleNeckBlock02_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_layer0 (None, 8.0, 16.0, 16 221312      ResNet_BottleNeckBlock01_layer03_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_residu (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_layer0 (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_layer01_\n",
      "                                                                 ResNet_BottleNeckBlock02_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_1v1_co (None, 8.0, 16.0, 16 16512       ResNet_BottleNeckBlock02_layer01_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_1v1_no (None, 8.0, 16.0, 16 2           ResNet_BottleNeckBlock02_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_1v1_ac (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_3v3__c (None, 8.0, 16.0, 16 1769984     ResNet_BottleNeckBlock02_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_3v3__n (None, 8.0, 16.0, 16 2           ResNet_BottleNeckBlock02_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_3v3__a (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_residu (None, 8.0, 16.0, 16 1769600     ResNet_BottleNeckBlock02_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_residu (None, 8.0, 16.0, 16 2           ResNet_BottleNeckBlock02_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_residu (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_layer0 (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_layer01_\n",
      "                                                                 ResNet_BottleNeckBlock02_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_1v1_co (None, 8.0, 16.0, 16 16512       ResNet_BottleNeckBlock02_layer02_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_1v1_no (None, 8.0, 16.0, 16 2           ResNet_BottleNeckBlock02_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_1v1_ac (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_3v3__c (None, 8.0, 16.0, 16 1769984     ResNet_BottleNeckBlock02_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_3v3__n (None, 8.0, 16.0, 16 2           ResNet_BottleNeckBlock02_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_3v3__a (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_residu (None, 8.0, 16.0, 16 1769600     ResNet_BottleNeckBlock02_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_residu (None, 8.0, 16.0, 16 2           ResNet_BottleNeckBlock02_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_residu (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_layer0 (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_layer02_\n",
      "                                                                 ResNet_BottleNeckBlock02_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_1v1_co (None, 8.0, 16.0, 16 16512       ResNet_BottleNeckBlock02_layer03_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_1v1_no (None, 8.0, 16.0, 16 2           ResNet_BottleNeckBlock02_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_1v1_ac (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_3v3__c (None, 8.0, 16.0, 16 1769984     ResNet_BottleNeckBlock02_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_3v3__n (None, 8.0, 16.0, 16 2           ResNet_BottleNeckBlock02_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_3v3__a (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_residu (None, 8.0, 16.0, 16 1769600     ResNet_BottleNeckBlock02_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_residu (None, 8.0, 16.0, 16 2           ResNet_BottleNeckBlock02_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_residu (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock02_layer0 (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_layer03_\n",
      "                                                                 ResNet_BottleNeckBlock02_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_co (None, 4.0, 8.0, 8.0 33024       ResNet_BottleNeckBlock02_layer04_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_no (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_ac (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__c (None, 4.0, 8.0, 8.0 7078912     ResNet_BottleNeckBlock03_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__n (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__a (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 7078144     ResNet_BottleNeckBlock03_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_layer0 (None, 4.0, 8.0, 8.0 884992      ResNet_BottleNeckBlock02_layer04_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_layer0 (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_layer01_\n",
      "                                                                 ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_co (None, 4.0, 8.0, 8.0 65792       ResNet_BottleNeckBlock03_layer01_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_no (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_ac (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__c (None, 4.0, 8.0, 8.0 7078912     ResNet_BottleNeckBlock03_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__n (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__a (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 7078144     ResNet_BottleNeckBlock03_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_layer0 (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_layer01_\n",
      "                                                                 ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_co (None, 4.0, 8.0, 8.0 65792       ResNet_BottleNeckBlock03_layer02_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_no (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_ac (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__c (None, 4.0, 8.0, 8.0 7078912     ResNet_BottleNeckBlock03_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__n (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__a (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 7078144     ResNet_BottleNeckBlock03_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_layer0 (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_layer02_\n",
      "                                                                 ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_co (None, 4.0, 8.0, 8.0 65792       ResNet_BottleNeckBlock03_layer03_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_no (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_ac (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__c (None, 4.0, 8.0, 8.0 7078912     ResNet_BottleNeckBlock03_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__n (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__a (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 7078144     ResNet_BottleNeckBlock03_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_layer0 (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_layer03_\n",
      "                                                                 ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_co (None, 4.0, 8.0, 8.0 65792       ResNet_BottleNeckBlock03_layer04_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_no (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_ac (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__c (None, 4.0, 8.0, 8.0 7078912     ResNet_BottleNeckBlock03_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__n (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__a (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 7078144     ResNet_BottleNeckBlock03_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_layer0 (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_layer04_\n",
      "                                                                 ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_co (None, 4.0, 8.0, 8.0 65792       ResNet_BottleNeckBlock03_layer05_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_no (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_1v1_ac (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__c (None, 4.0, 8.0, 8.0 7078912     ResNet_BottleNeckBlock03_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__n (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_3v3__a (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 7078144     ResNet_BottleNeckBlock03_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 2           ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_residu (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock03_layer0 (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_layer05_\n",
      "                                                                 ResNet_BottleNeckBlock03_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_1v1_co (None, 2.0, 4.0, 4.0 131584      ResNet_BottleNeckBlock03_layer06_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_1v1_no (None, 2.0, 4.0, 4.0 2           ResNet_BottleNeckBlock04_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_1v1_ac (None, 2.0, 4.0, 4.0 0           ResNet_BottleNeckBlock04_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_3v3__c (None, 2.0, 4.0, 4.0 28313600    ResNet_BottleNeckBlock04_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_3v3__n (None, 2.0, 4.0, 4.0 2           ResNet_BottleNeckBlock04_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_3v3__a (None, 2.0, 4.0, 4.0 0           ResNet_BottleNeckBlock04_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_residu (None, 2.0, 4.0, 4.0 28312064    ResNet_BottleNeckBlock04_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_residu (None, 2.0, 4.0, 4.0 2           ResNet_BottleNeckBlock04_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_layer0 (None, 2.0, 4.0, 4.0 3539456     ResNet_BottleNeckBlock03_layer06_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_residu (None, 2.0, 4.0, 4.0 0           ResNet_BottleNeckBlock04_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_layer0 (None, 2.0, 4.0, 4.0 0           ResNet_BottleNeckBlock04_layer01_\n",
      "                                                                 ResNet_BottleNeckBlock04_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_1v1_co (None, 2.0, 4.0, 4.0 262656      ResNet_BottleNeckBlock04_layer01_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_1v1_no (None, 2.0, 4.0, 4.0 2           ResNet_BottleNeckBlock04_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_1v1_ac (None, 2.0, 4.0, 4.0 0           ResNet_BottleNeckBlock04_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_3v3__c (None, 2.0, 4.0, 4.0 28313600    ResNet_BottleNeckBlock04_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_3v3__n (None, 2.0, 4.0, 4.0 2           ResNet_BottleNeckBlock04_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_3v3__a (None, 2.0, 4.0, 4.0 0           ResNet_BottleNeckBlock04_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_residu (None, 2.0, 4.0, 4.0 28312064    ResNet_BottleNeckBlock04_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_residu (None, 2.0, 4.0, 4.0 2           ResNet_BottleNeckBlock04_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_residu (None, 2.0, 4.0, 4.0 0           ResNet_BottleNeckBlock04_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_layer0 (None, 2.0, 4.0, 4.0 0           ResNet_BottleNeckBlock04_layer01_\n",
      "                                                                 ResNet_BottleNeckBlock04_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_1v1_co (None, 2.0, 4.0, 4.0 262656      ResNet_BottleNeckBlock04_layer02_\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_1v1_no (None, 2.0, 4.0, 4.0 2           ResNet_BottleNeckBlock04_1v1_conv\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_1v1_ac (None, 2.0, 4.0, 4.0 0           ResNet_BottleNeckBlock04_1v1_norm\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_3v3__c (None, 2.0, 4.0, 4.0 28313600    ResNet_BottleNeckBlock04_1v1_acti\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_3v3__n (None, 2.0, 4.0, 4.0 2           ResNet_BottleNeckBlock04_3v3__con\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_3v3__a (None, 2.0, 4.0, 4.0 0           ResNet_BottleNeckBlock04_3v3__nor\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_residu (None, 2.0, 4.0, 4.0 28312064    ResNet_BottleNeckBlock04_3v3__act\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_residu (None, 2.0, 4.0, 4.0 2           ResNet_BottleNeckBlock04_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_residu (None, 2.0, 4.0, 4.0 0           ResNet_BottleNeckBlock04_residual\n",
      "__________________________________________________________________________________________________\n",
      "ResNet_BottleNeckBlock04_layer0 (None, 2.0, 4.0, 4.0 0           ResNet_BottleNeckBlock04_layer02_\n",
      "                                                                 ResNet_BottleNeckBlock04_residual\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_pr (None, 2.0, 4.0, 4.0 0           ResNet_BottleNeckBlock04_layer03_\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_co (None, 2.0, 4.0, 4.0 3539200     NoduleSegDecoder_Block01_SEB_preU\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_no (None, 2.0, 4.0, 4.0 2           NoduleSegDecoder_Block01_SEB_conv\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_upsamp (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock04_layer03_\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_ac (None, 2.0, 4.0, 4.0 0           NoduleSegDecoder_Block01_SEB_norm\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_conv_0 (None, 4.0, 8.0, 8.0 3539200     NoduleSegDecoder_Block01_upsample\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_SEB_up (None, 4.0, 8.0, 8.0 0           NoduleSegDecoder_Block01_SEB_acti\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_norm_0 (None, 4.0, 8.0, 8.0 2           NoduleSegDecoder_Block01_conv_01[\n",
      "__________________________________________________________________________________________________\n",
      "multiply_10 (Multiply)          (None, 4.0, 8.0, 8.0 0           NoduleSegDecoder_Block01_SEB_upsa\n",
      "                                                                 ResNet_BottleNeckBlock03_layer06_\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_activa (None, 4.0, 8.0, 8.0 0           NoduleSegDecoder_Block01_norm_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_Concat (None, 4.0, 8.0, 8.0 0           multiply_10[0][0]                \n",
      "                                                                 NoduleSegDecoder_Block01_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_conv_0 (None, 4.0, 8.0, 8.0 3539200     NoduleSegDecoder_Block01_Concaten\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_norm_0 (None, 4.0, 8.0, 8.0 2           NoduleSegDecoder_Block01_conv_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_activa (None, 4.0, 8.0, 8.0 0           NoduleSegDecoder_Block01_norm_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_pr (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock04_layer03_\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_pr (None, 4.0, 8.0, 8.0 0           ResNet_BottleNeckBlock03_layer06_\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_conv_0 (None, 4.0, 8.0, 8.0 1769728     NoduleSegDecoder_Block01_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_co (None, 4.0, 8.0, 8.0 0           NoduleSegDecoder_Block02_SEB_preU\n",
      "                                                                 NoduleSegDecoder_Block02_SEB_preU\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_norm_0 (None, 4.0, 8.0, 8.0 2           NoduleSegDecoder_Block01_conv_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_co (None, 4.0, 8.0, 8.0 2654336     NoduleSegDecoder_Block02_SEB_conc\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block01_activa (None, 4.0, 8.0, 8.0 0           NoduleSegDecoder_Block01_norm_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_no (None, 4.0, 8.0, 8.0 2           NoduleSegDecoder_Block02_SEB_conv\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_upsamp (None, 8.0, 16.0, 16 0           NoduleSegDecoder_Block01_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_ac (None, 4.0, 8.0, 8.0 0           NoduleSegDecoder_Block02_SEB_norm\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_conv_0 (None, 8.0, 16.0, 16 884864      NoduleSegDecoder_Block02_upsample\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_SEB_up (None, 8.0, 16.0, 16 0           NoduleSegDecoder_Block02_SEB_acti\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_norm_0 (None, 8.0, 16.0, 16 2           NoduleSegDecoder_Block02_conv_01[\n",
      "__________________________________________________________________________________________________\n",
      "multiply_11 (Multiply)          (None, 8.0, 16.0, 16 0           NoduleSegDecoder_Block02_SEB_upsa\n",
      "                                                                 ResNet_BottleNeckBlock02_layer04_\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_activa (None, 8.0, 16.0, 16 0           NoduleSegDecoder_Block02_norm_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_Concat (None, 8.0, 16.0, 16 0           multiply_11[0][0]                \n",
      "                                                                 NoduleSegDecoder_Block02_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_conv_0 (None, 8.0, 16.0, 16 884864      NoduleSegDecoder_Block02_Concaten\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_norm_0 (None, 8.0, 16.0, 16 2           NoduleSegDecoder_Block02_conv_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_activa (None, 8.0, 16.0, 16 0           NoduleSegDecoder_Block02_norm_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_conv_0 (None, 8.0, 16.0, 16 442496      NoduleSegDecoder_Block02_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_pr (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock04_layer03_\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_pr (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock03_layer06_\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_pr (None, 8.0, 16.0, 16 0           ResNet_BottleNeckBlock02_layer04_\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_norm_0 (None, 8.0, 16.0, 16 2           NoduleSegDecoder_Block02_conv_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_co (None, 8.0, 16.0, 16 0           NoduleSegDecoder_Block03_SEB_preU\n",
      "                                                                 NoduleSegDecoder_Block03_SEB_preU\n",
      "                                                                 NoduleSegDecoder_Block03_SEB_preU\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block02_activa (None, 8.0, 16.0, 16 0           NoduleSegDecoder_Block02_norm_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_co (None, 8.0, 16.0, 16 1548352     NoduleSegDecoder_Block03_SEB_conc\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_no (None, 8.0, 16.0, 16 2           NoduleSegDecoder_Block03_SEB_conv\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_upsamp (None, 16.0, 32.0, 3 0           NoduleSegDecoder_Block02_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_ac (None, 8.0, 16.0, 16 0           NoduleSegDecoder_Block03_SEB_norm\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_conv_0 (None, 16.0, 32.0, 3 221248      NoduleSegDecoder_Block03_upsample\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_SEB_up (None, 16.0, 32.0, 3 0           NoduleSegDecoder_Block03_SEB_acti\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_norm_0 (None, 16.0, 32.0, 3 2           NoduleSegDecoder_Block03_conv_01[\n",
      "__________________________________________________________________________________________________\n",
      "multiply_12 (Multiply)          (None, 16.0, 32.0, 3 0           NoduleSegDecoder_Block03_SEB_upsa\n",
      "                                                                 ResNet_BottleNeckBlock01_layer03_\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_activa (None, 16.0, 32.0, 3 0           NoduleSegDecoder_Block03_norm_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_Concat (None, 16.0, 32.0, 3 0           multiply_12[0][0]                \n",
      "                                                                 NoduleSegDecoder_Block03_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_conv_0 (None, 16.0, 32.0, 3 221248      NoduleSegDecoder_Block03_Concaten\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_norm_0 (None, 16.0, 32.0, 3 2           NoduleSegDecoder_Block03_conv_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_activa (None, 16.0, 32.0, 3 0           NoduleSegDecoder_Block03_norm_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_conv_0 (None, 16.0, 32.0, 3 110656      NoduleSegDecoder_Block03_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_norm_0 (None, 16.0, 32.0, 3 2           NoduleSegDecoder_Block03_conv_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block03_activa (None, 16.0, 32.0, 3 0           NoduleSegDecoder_Block03_norm_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_upsamp (None, 32.0, 64.0, 6 0           NoduleSegDecoder_Block03_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_conv_0 (None, 32.0, 64.0, 6 55328       NoduleSegDecoder_Block04_upsample\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_norm_0 (None, 32.0, 64.0, 6 2           NoduleSegDecoder_Block04_conv_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_activa (None, 32.0, 64.0, 6 0           NoduleSegDecoder_Block04_norm_01[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_Concat (None, 32, 64, 64, 6 0           ResNet_InitBlock_activation_01[0]\n",
      "                                                                 NoduleSegDecoder_Block04_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_conv_0 (None, 32, 64, 64, 3 55328       NoduleSegDecoder_Block04_Concaten\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_norm_0 (None, 32, 64, 64, 3 2           NoduleSegDecoder_Block04_conv_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_activa (None, 32, 64, 64, 3 0           NoduleSegDecoder_Block04_norm_02[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_conv_0 (None, 32, 64, 64, 3 27680       NoduleSegDecoder_Block04_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_norm_0 (None, 32, 64, 64, 3 2           NoduleSegDecoder_Block04_conv_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_Block04_activa (None, 32, 64, 64, 3 0           NoduleSegDecoder_Block04_norm_03[\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 8.0, 16.0, 16 27656       NoduleSegDecoder_Block02_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 16.0, 32.0, 3 13832       NoduleSegDecoder_Block03_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 32, 64, 64, 8 6920        NoduleSegDecoder_Block04_activati\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 8.0, 16.0, 16 2           NoduleSegDeepCombineBlock_block01\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 16.0, 32.0, 3 2           NoduleSegDeepCombineBlock_block02\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 32, 64, 64, 8 2           NoduleSegDeepCombineBlock_block03\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 8.0, 16.0, 16 0           NoduleSegDeepCombineBlock_block01\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 16.0, 32.0, 3 0           NoduleSegDeepCombineBlock_block02\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDeepCombineBlock_block (None, 32, 64, 64, 8 0           NoduleSegDeepCombineBlock_block03\n",
      "__________________________________________________________________________________________________\n",
      "deep_supervision_upsample_01 (U (None, 32.0, 64.0, 6 0           NoduleSegDeepCombineBlock_block01\n",
      "__________________________________________________________________________________________________\n",
      "deep_supervision_upsample_02 (U (None, 32.0, 64.0, 6 0           NoduleSegDeepCombineBlock_block02\n",
      "__________________________________________________________________________________________________\n",
      "deep_supervision_upsample_03 (U (None, 32, 64, 64, 8 0           NoduleSegDeepCombineBlock_block03\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_DeepSupervisio (None, 32.0, 64.0, 6 9           deep_supervision_upsample_01[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_DeepSupervisio (None, 32.0, 64.0, 6 9           deep_supervision_upsample_02[0][0\n",
      "__________________________________________________________________________________________________\n",
      "NoduleSegDecoder_DeepSupervisio (None, 32, 64, 64, 1 9           deep_supervision_upsample_03[0][0\n",
      "==================================================================================================\n",
      "Total params: 296,963,481\n",
      "Trainable params: 296,963,481\n",
      "Non-trainable params: 0\n",
      "__________________________________________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "model2.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}