text_html_output_1.png
from keras.layers import Dense, Dropout, Flatten, Input, Conv2D, MaxPooling2D, BatchNormalization, Activation, UpSampling2D, GlobalAveragePooling2D

from keras.models import Sequential, Model

from keras.preprocessing.image import ImageDataGenerator

from tensorflow.keras.applications import EfficientNetB0

from tensorflow.keras.metrics import AUC

train_data_dir = '../input/1056lab-covid19-chest-xray-recognit/train'
generator = ImageDataGenerator(width_shift_range=0.3, height_shift_range=0.3, horizontal_flip=True, validation_split=0.2)

train_generator = generator.flow_from_directory(train_data_dir, target_size=(224, 224), color_mode='rgb', batch_size=64, class_mode='categorical', shuffle=True)

from tensorflow.keras.applications import EfficientNetB0
efnb0 = EfficientNetB0(weights='imagenet', include_top=False, input_shape=(224, 224, 3))
model = Sequential()
model.add(efnb0)
model.add(GlobalAveragePooling2D())
model.add(Dropout(0.2))
model.add(Dense(1024, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(512, activation='relu'))
model.add(Dropout(0.2))
model.add(Dense(4, activation='sigmoid'))
for layer in efnb0.layers:
    layer.trainable = False
model.summary()

from tensorflow.keras.metrics import AUC
auc = AUC()
model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy', auc])

hist = model.fit_generator(train_generator, steps_per_epoch=231, epochs=50)