How can I use Deeplearning4j regression to do image noise reduction?

203 views Asked by At

I'm very new to NN and have started playing around with Deeplearning4j. I have tried as an exercise the idea of reducing ISO noise from a photo. To do this I took 2 photos identically framed, but one shot at ISO 100 and one shot at ISO25600.

I made a simple NN with 2 hidden layers. The input is the noisy, high ISO image (3 channels * 100px * 100px = 30000) and the output should be the clean image (same size as the input)

Here's how my NN looks like:

final int numHiddenNodes = 50;
    return new NeuralNetConfiguration.Builder()
            .seed(seed)
            .iterations(iterations)
            .optimizationAlgo(
                    OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
            .learningRate(learningRate)
            .weightInit(WeightInit.XAVIER)
            .updater(Updater.NESTEROVS)
            .optimizationAlgo(
                        OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)
            .list()
            .layer(0,
                    new DenseLayer.Builder().nIn(numInputs)
                            .nOut(numHiddenNodes)
                            .activation(Activation.TANH).build())
            .layer(1,
                    new DenseLayer.Builder().nIn(numHiddenNodes)
                            .nOut(numHiddenNodes)
                            .activation(Activation.TANH).build())
            .layer(2,
                    new OutputLayer.Builder(LossFunctions.LossFunction.MSE)
                            .activation(Activation.RELU)
                            .nIn(numHiddenNodes).nOut(numOutputs).build())
            .pretrain(false).backprop(true).build();

I've trained my network for several thousands epochs, and the score I get is around 130 (that's probably the Mean Squared Error), but the result I'm getting is not what I expected.

Input: enter image description here

Ouptut: enter image description here

Am I going about this the wrong way?

0

There are 0 answers