Imported model have lower accuracy

I want to import a tensorflow model.h5 file. The model will take in an image and predict whether its a real or fake face. But the newly imported DL4J model is not as accurate as the original tensorflow model. Is there any things I can fix about it ?

NativeImageLoader loader = new NativeImageLoader(height, width, 3);
INDArray image = loader.asMatrix(file, false);

//Normalization
DataNormalization scalar = new ImagePreProcessingScaler(0, 1);
scalar.transform(image);

//Read in model file
File resourcesDirectory = new File(“src/main/resources”);
final String SIMPLE_MLP = new File(resourcesDirectory.getAbsolutePath(), “model.h5”).getAbsolutePath();

//Predict Result
ComputationGraph model = KerasModelImport.importKerasModelAndWeights(SIMPLE_MLP, true);
INDArray results = model.outputSingle(image);

@minyueyong there are a lot of variables to consider here. Could you show the equivalent code from tensorflow to make sure the data pipelines are equivalent?

Hi , here is the model summary , h5 file and sample image for the tensorflow model.

Is it enough to troubleshoot?

@minyueyong can you make this a bit easier? I would prefer to not have to download something if possible. All you did was give me a drive link I can’t even access. For now just start with the model summary and code. I’m not here to learn your full code base. I’m here to try to help you. Please try to minimize the amount of work I have to do to do that.