Need help in understanding feature extraction using transfer learning

Hi

I need help in understanding the following behavior of feature extraction from the pretrained model

Output1:

def get_net():
    model = bninception(pretrained="imagenet")
    model.gp = nn.AdaptiveAvgPool2d(1)
    model.conv = nn.Conv2d(config.channels, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3))
    model.last = nn.Sequential(
                nn.BatchNorm1d(1024),
                nn.Dropout(0.5),
                nn.Linear(1024, config.num_classes),
            )
    return model
model = get_net()
model.cuda()
output1 =model(images)

Output2:
I am after features obtained at ‘model.conv’ , therefore i removed the later section as follows.

def get_net():
    model = bninception(pretrained="imagenet")
    model.gp = nn.AdaptiveAvgPool2d(1)
    model.conv = nn.Conv2d(config.channels, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3))
    return model
model = get_net()
model.cuda()
features = model(images)

and got the features for N images as : [N, 1000]. I fed these features into the following as follows

class ManualLinearRegression(nn.Module):
    def __init__(self):
        super(ManualLinearRegression,self).__init__()
        #self.linear = nn.Linear(1000, 28)
        self.linear = nn.Sequential(
                nn.BatchNorm1d(1000),#1024
                nn.Dropout(0.5),
                nn.Linear(1000, config.num_classes),
            )

    def forward(self, x):
        return self.linear(x)
model = ManualLinearRegression().cuda()
output2 = model(images)

I was expecting Output1 almost similar to Output 2. But it is a lot different. On computation of F1 score, output1 is 0.44 while Output2 is 0.09.

I think i am falling short in understanding some major aspect here. May I know what am I doing wrong here.

Just to add on, ultimately I want to extract features from convolutional layer, apply oversampling and perform classification.

Thank you.