State of art pre-trained image embedding for a custom auto-encoder


I would like to try an auto-encoder using a pretrained layer for transfert learning.

The code would be something like that:

class Autoencoder(nn.Module):
    def __init__(self):

        self.encoder = pretrained_encoder(...)
        self.decoder = symetric_decoder(...)
        self.linear1 = nn.Linear(dim_encoder_output, dim_intermediary)
        self.linear2 = nn.Linear(dim_intermediary, dim_embedding)
        self.linear3 = nn.Linear(dim_embedding, dim_embedding)
        self.linear4 = nn.Linear(dim_embedding, dim_intermediary)
        self.linear5 = nn.Linear(dim_intermediary,dim_decoder_input)
        self.relu = nn.ReLU()

    def forward(self, x):
        x = self.encode(x)
        x = self.decode(x)
        return x

    def encode(self, x):
        x = self.encoder(x)
        x = self.linear1(x)
        x = self.relu(x)
        x = self.linear2(x)
        x = self.relu(x)
        x = self.linear3(x)
        x = self.relu(x)
        return x

    def decode(self,x):
        x = self.linear4(x)
        x = self.relu(x)
        x = self.linear5(x)
        x = self.relu(x)
        x = self.decoder(x)
        return x

The goal of this auto_encoder is to detect small changes in industrial parts. Such as defects, pollutions, rust… Currently it works with a custom auto encoder and I want to see if a pre-trained state of art model improve it.

I wonder what pretrained encoder to use. Is there some state of art pre-trained encoders that are already implemented as a PyTorch module that you would recommend for a test?