parameters: (self)
return_statement: return model
docstring: Create the 3D CNN Model for Emphnet
docstring_summary: Create the 3D CNN Model for Emphnet
docstring_tokens: Create the 3D CNN Model for Emphnet
function: def get_model(self):
          """Create the 3D CNN Model for Emphnet"""
  
  
          model = Sequential()
  
          # Convolutional Group 1
          model.add(Conv3D(64, (3, 3, 3),
                           name='conv1', strides=2, padding='same',
                           input_shape=(128, 128, 128, 1))) #(64, 64, 64, 64)
          model.add(BatchNormalization(name='batch_norm1'))
          model.add(Activation('relu', name='relu1'))
          model.add(MaxPooling3D(name='pool1',
                                 pool_size=(2, 2, 2))) # (32, 32, 32, 64)
  
          # Convolution Group 2
          model.add(Conv3D(128, (3, 3, 3),
                           name='conv2', padding='same')) #(32, 32, 32, 128)
          model.add(BatchNormalization(name='batch_norm2'))
          model.add(Activation('relu', name='relu2'))
          model.add(MaxPooling3D(name='pool2',
                                 pool_size=(2, 2, 2))) #(16, 16, 16, 128)
  
          # Convolution Group 3
          model.add(Conv3D(256, (3, 3, 3),
                           name='conv3', padding='same')) #(16, 16, 16, 256)
          model.add(BatchNormalization(name='batch_norm3'))
          model.add(Activation('relu', name='relu3'))
          model.add(MaxPooling3D(name='pool3',
                                 pool_size=(2, 2, 2))) #(8, 8, 8, 256)
  
          # Convolution Group 4
          model.add(Conv3D(512, (3, 3, 3),
                           name='conv4', padding='same')) #(8, 8, 8, 512)
          model.add(BatchNormalization(name='batch_norm4'))
          model.add(Activation('relu', name='relu4'))
          model.add(MaxPooling3D(name='pool4',
                    pool_size=(2, 2, 2))) #(4, 4, 4, 512)
  
          # Convolution Group 5
          model.add(Conv3D(512, (3, 3, 3),
                           name='conv5', padding='same')) #(4, 4, 4, 512)
          model.add(BatchNormalization(name='batch_norm5'))
          model.add(Activation('relu', name='relu5'))
          model.add(MaxPooling3D(name='pool5',
                                 pool_size=(2, 2, 2))) #(2, 2, 2, 512)
  
          # Convolution Group 6
          model.add(Conv3D(512, (2, 2, 2),
                           name='conv6', padding='valid')) #(1, 1, 1, 512)
          model.add(BatchNormalization(name='batch_norm6'))
          model.add(Activation('relu', name='relu6'))
          model.add(Dropout(0.5, name='dropout'))
  
          # Fully Connected & Output
          model.add(Conv3D(512, (1, 1, 1),
                           name='fc1', activation='relu')) #(1, 1, 1, 512)
          model.add(Dropout(0.5, name='dropout_fc1'))
          model.add(Conv3D(512, (1, 1, 1),
                           name='fc2', activation='relu')) #(1, 1, 1, 512)
          model.add(Dropout(0.5, name='dropout_fc2'))
          model.add(Flatten(name='flatten'))
          model.add(Dense(2, name='class', activation='softmax')) #(2)
  
          print(model.summary())
  
          # Compile model
          model = multi_gpu_model(model, gpus=4)
          model.compile(loss='categorical_crossentropy',
                        optimizer='adam',
                        metrics=['accuracy'])
  
          return model
function_tokens: def get_model ( self ) : model = Sequential ( ) # Convolutional Group 1 model . add ( Conv3D ( 64 , ( 3 , 3 , 3 ) , name = 'conv1' , strides = 2 , padding = 'same' , input_shape = ( 128 , 128 , 128 , 1 ) ) ) #(64, 64, 64, 64) model . add ( BatchNormalization ( name = 'batch_norm1' ) ) model . add ( Activation ( 'relu' , name = 'relu1' ) ) model . add ( MaxPooling3D ( name = 'pool1' , pool_size = ( 2 , 2 , 2 ) ) ) # (32, 32, 32, 64) # Convolution Group 2 model . add ( Conv3D ( 128 , ( 3 , 3 , 3 ) , name = 'conv2' , padding = 'same' ) ) #(32, 32, 32, 128) model . add ( BatchNormalization ( name = 'batch_norm2' ) ) model . add ( Activation ( 'relu' , name = 'relu2' ) ) model . add ( MaxPooling3D ( name = 'pool2' , pool_size = ( 2 , 2 , 2 ) ) ) #(16, 16, 16, 128) # Convolution Group 3 model . add ( Conv3D ( 256 , ( 3 , 3 , 3 ) , name = 'conv3' , padding = 'same' ) ) #(16, 16, 16, 256) model . add ( BatchNormalization ( name = 'batch_norm3' ) ) model . add ( Activation ( 'relu' , name = 'relu3' ) ) model . add ( MaxPooling3D ( name = 'pool3' , pool_size = ( 2 , 2 , 2 ) ) ) #(8, 8, 8, 256) # Convolution Group 4 model . add ( Conv3D ( 512 , ( 3 , 3 , 3 ) , name = 'conv4' , padding = 'same' ) ) #(8, 8, 8, 512) model . add ( BatchNormalization ( name = 'batch_norm4' ) ) model . add ( Activation ( 'relu' , name = 'relu4' ) ) model . add ( MaxPooling3D ( name = 'pool4' , pool_size = ( 2 , 2 , 2 ) ) ) #(4, 4, 4, 512) # Convolution Group 5 model . add ( Conv3D ( 512 , ( 3 , 3 , 3 ) , name = 'conv5' , padding = 'same' ) ) #(4, 4, 4, 512) model . add ( BatchNormalization ( name = 'batch_norm5' ) ) model . add ( Activation ( 'relu' , name = 'relu5' ) ) model . add ( MaxPooling3D ( name = 'pool5' , pool_size = ( 2 , 2 , 2 ) ) ) #(2, 2, 2, 512) # Convolution Group 6 model . add ( Conv3D ( 512 , ( 2 , 2 , 2 ) , name = 'conv6' , padding = 'valid' ) ) #(1, 1, 1, 512) model . add ( BatchNormalization ( name = 'batch_norm6' ) ) model . add ( Activation ( 'relu' , name = 'relu6' ) ) model . add ( Dropout ( 0.5 , name = 'dropout' ) ) # Fully Connected & Output model . add ( Conv3D ( 512 , ( 1 , 1 , 1 ) , name = 'fc1' , activation = 'relu' ) ) #(1, 1, 1, 512) model . add ( Dropout ( 0.5 , name = 'dropout_fc1' ) ) model . add ( Conv3D ( 512 , ( 1 , 1 , 1 ) , name = 'fc2' , activation = 'relu' ) ) #(1, 1, 1, 512) model . add ( Dropout ( 0.5 , name = 'dropout_fc2' ) ) model . add ( Flatten ( name = 'flatten' ) ) model . add ( Dense ( 2 , name = 'class' , activation = 'softmax' ) ) #(2) print ( model . summary ( ) ) # Compile model model = multi_gpu_model ( model , gpus = 4 ) model . compile ( loss = 'categorical_crossentropy' , optimizer = 'adam' , metrics = [ 'accuracy' ] ) return model