Skip to content

Instantly share code, notes, and snippets.

@Yuvnish017
Created July 10, 2021 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yuvnish017/8514cba83f09400c0dee1151c9af4e04 to your computer and use it in GitHub Desktop.
Save Yuvnish017/8514cba83f09400c0dee1151c9af4e04 to your computer and use it in GitHub Desktop.
Parkinson_disease_detection
def parkinson_disease_detection_model(input_shape=(128, 128, 1)):
regularizer = tf.keras.regularizers.l2(0.001)
model = Sequential()
model.add(Input(shape=input_shape))
model.add(Conv2D(128, (5, 5), padding='same', strides=(1, 1), name='conv1', activation='relu',
kernel_initializer='glorot_uniform', kernel_regularizer=regularizer))
model.add(MaxPool2D((9, 9), strides=(3, 3)))
model.add(Conv2D(64, (5, 5), padding='same', strides=(1, 1), name='conv2', activation='relu',
kernel_initializer='glorot_uniform', kernel_regularizer=regularizer))
model.add(MaxPool2D((7, 7), strides=(3, 3)))
model.add(Conv2D(32, (3, 3), padding='same', strides=(1, 1), name='conv3', activation='relu',
kernel_initializer='glorot_uniform', kernel_regularizer=regularizer))
model.add(MaxPool2D((5, 5), strides=(2, 2)))
model.add(Conv2D(32, (3, 3), padding='same', strides=(1, 1), name='conv4', activation='relu',
kernel_initializer='glorot_uniform', kernel_regularizer=regularizer))
model.add(MaxPool2D((3, 3), strides=(2, 2)))
model.add(Flatten())
model.add(Dropout(0.5))
model.add(Dense(64, activation='relu', kernel_initializer='glorot_uniform', name='fc1'))
model.add(Dropout(0.5))
model.add(Dense(2, activation='softmax', kernel_initializer='glorot_uniform', name='fc3'))
optimizer = Adam(3.15e-5)
model.compile(optimizer=optimizer, loss='categorical_crossentropy', metrics=['accuracy'])
return model
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment