I changed the model after your comments but it’s not heling me out rather the accuracy is decreasing
Need help in how to increase the accuracy in retrained mdels using pytorch ? Any good references will also help!
Notebook Link
class EfficientNet_b0(nn.Module):
    def __init__(self):
        super(EfficientNet_b0, self).__init__()
        self.model = efficientnet_pytorch.EfficientNet.from_pretrained('efficientnet-b0')
        
        self.dense_layer_1 = nn.Linear(1280 , 512)
        self.batchNorm_layer = nn.BatchNorm1d(512)
        self.droput_layer = nn.Dropout(0.2)
        
        self.dense_layer_2 = nn.Linear(512,216)
        
        self.dense_layer_3 = nn.Linear(216,104)
        
        
    def forward(self, inputs):
        x = self.model.extract_features(inputs)

        # Pooling and final linear layer
        x = self.model._avg_pooling(x)
        x = x.flatten(start_dim=1)
        x = self.model._dropout(x)
        
        x = self.dense_layer_1(x)
        x = self.batchNorm_layer(x)
        x = self.droput_layer(x)
        
        x = self.dense_layer_2(x)
        x = torch.relu(x)
        
        x = self.dense_layer_3(x)
        x = torch.log_softmax(x , dim =1)
        return x
    
model = EfficientNet_b0()

image438×715 36.2 KB