COVID-19/Pneumonia x-ray images project

Hello everyone,

Here is the repository which holds my solution to the x-ray imaging challenge project. Sadly, my machine learning algorithm doesn’t do much better than random, so this wasn’t a very successful project. It would be interesting to revisit it to see why that is and what sort of model would perform better.

1 Like

Honestly I would like to have some solution how to solve this one. It seems that despite having cateogrical accuracy above 80%, auc 94%. F1 score is 0.2, 0.3, max 0.45. I t makes no sense to me. My model below. Any hints why there is such huge and unexpected difference between regular metrics and classification report?
model.add(tf.keras.Input(shape=(256,256,1)))
model.add(tf.keras.layers.Conv2D(8,5, padding=‘same’, activation=‘relu’))
model.add(tf.keras.layers.Conv2D(5,3, strides=2, padding=‘same’, activation=‘relu’))
model.add(tf.keras.layers.MaxPooling2D(pool_size=(2,2), strides=(2,2)))
model.add(tf.keras.layers.Conv2D(10,3, padding=‘valid’, strides=2, activation=‘relu’))
model.add(tf.keras.layers.Conv2D(8,3, padding=‘valid’, strides=2, activation=‘relu’))
model.add(tf.keras.layers.MaxPooling2D(pool_size=(2,2), strides=(2,2)))
model.add(tf.keras.layers.Flatten())
model.add(tf.keras.layers.Dense(64, activation=‘relu’))
model.add(tf.keras.layers.Dense(3, activation=‘softmax’))

Hi,

I have same question. I got 90% accuracy. but F1 score is very bad. Any help would be appreciated.

You should put shuffle = False as an argument when loading validation data in the .flow_from_directory(). This way, validation data will not be shuffled when creating classification report… When shuffle = True, classification report results are equal to a random guess.