keras icon indicating copy to clipboard operation
keras copied to clipboard

I want to add svm in last layer of my model

Open feridesecil13 opened this issue 1 year ago • 2 comments

Hello I am extracting buildings from 512x512 images using the Massachusetts building dataset. In order to get more accurate results, I want to add a Support Vector Machine to the last layer of the architecture I created, that is, the classifier layer. I don't want to apply Flatten because I aim to get 512x512 output dimensions. Can you help me?

The last part of my architecture is like this;

c7=(BatchNormalization())(c7)
u7=(Conv2DTranspose(32,(3,3), strides=(2, 2), activation='relu', kernel_initializer='he_normal', padding='same'))(c7)
u7=(Dropout(0.3))(u7)
c8=(Conv2D(32, (3,3),activation='relu', kernel_initializer='he_uniform', padding='same'))(u7)
c8=(Dropout(0.2))(c8)

c8=(BatchNormalization())(c8)
u9=(Conv2DTranspose(16,(3,3), strides=(2, 2), activation='relu', kernel_initializer='he_normal', padding='same'))(c8)
u9=(Dropout(0.3))(u9)
c9=(Conv2D(16, (3,3),activation='relu', kernel_initializer='he_normal', padding='same'))(u9)
c9=(Dropout(0.2))(c9)

c9=(BatchNormalization())(c9)
outputs=(Conv2D(2, (1, 1), activation='sigmoid'))(c9)

model = Model(inputs=[inputs], outputs=[outputs])
#model.compile(optimizer=optimizer,loss="categorical_crossentropy", metrics=["accuracy"]) 
return model 

feridesecil13 avatar Jan 21 '24 20:01 feridesecil13

Hi @feridesecil13 ,

Could you please refer the reply here whether serves your purpose. Thanks!

SuryanarayanaY avatar Jan 22 '24 05:01 SuryanarayanaY

This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar Feb 06 '24 01:02 github-actions[bot]

This issue was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.

github-actions[bot] avatar Feb 21 '24 01:02 github-actions[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Feb 21 '24 01:02 google-ml-butler[bot]