I am working on image classification of breast cancer using DenseNet121. I used confusion_matrix
and classification_report
and accuracy_score
but it didn't calculate the requirement metrics as I want to calculate ROC and sensitivity. I tried in many ways but it didn't work.
This is the code:
in_model = tf.keras.applications.DenseNet121(input_shape=(224,224,3),
include_top=False,
weights='imagenet',classes = 2)
in_model.trainable = False
inputs = tf.keras.Input(shape=(224,224,3))
x = in_model(inputs)
flat = Flatten()(x)
dense_1 = Dense(4096,activation = 'relu')(flat)
dense_2 = Dense(4096,activation = 'relu')(dense_1)
prediction = Dense(2,activation = 'softmax')(dense_2)
in_pred = Model(inputs = inputs,outputs = prediction)
in_pred.evaluate(test_data,test_labels)
test_ = in_pred.predict(test_text)
Y_pred= np.argmax(test_labels, axis=1)
vgg19 = np.argmax(test_, axis=1)
I used confusion_matrix
and classification_report
and accuracy_score
using the below code but I don't know how to calculate ROC and Sensitivity.
Any help would be appreciated.
print(confusion_matrix(Y_pred,vgg19))
print(classification_report(Y_pred,vgg19))
print(accuracy_score(Y_pred,vgg19))