# Restoring the corrupted image with a neural network? Going to create a neural network for image reconstruction given above and the like.

Each image is damaged color planes R/G/B on a regular basis (see the callout at the right side of the picture). I.e. as an example — in every fourth (second) pixel leaving only the R-coordinate. Also damaged so the picture is optional, will be present noise (the training will take place at real photos). The amount of damage — about 2/3, i.e., every pixel remains intact only one of the R/G/B values. The output network must give the restored value of the center pixel of a block of NxN, N is naturally an odd number, the maximum block size of 15x15.

The input will be clean by subtracting interpolated on the original image data (as a preliminary result).

While stopped on a multilayer Ann and the network of Elman.

If someone faced with the decision of problems of this kind give me some advice on what type of neural network is better to use and how to teach? Whether to use genetic algorithms?
October 8th 19 at 01:48
4 answers
October 8th 19 at 01:50
Perhaps You'll appreciate this article: habrahabr.ru/post/120473/
To train the network on any number of fragments, but should work on any image. Plus, the differences that I see in the example above, the loss per pixel 100% and random, but in my application they affect 99% of the time 2 of the three color planes, leaving the third intact. The above algorithm is able to consider the regularity of damage? - Eula_Von commented on October 8th 19 at 01:53
There neural network is first trained with a good picture, and then feed her the same image, but corrupted. Practical use no, you can only draw out something useful. - Sim_Volkm commented on October 8th 19 at 01:56
October 8th 19 at 01:52
View in the direction of the Hopfield Neural network
If I understand correctly, the ins Hopfield not versatility.
I need the network, so to speak, "implementing the algorithm" and not "storage". - Eula_Von commented on October 8th 19 at 01:55
October 8th 19 at 01:54
The interesting task. Here are some thoughts come to mind about the decision.
1. Neurosci. Maybe, but it is not clear how to organize learning. Generally try to work/not work in NeuroNet toolbox in Matlab, there is documentation standing.
2. Perhaps the best solution would be fractal techniques based on iterated functions systems (Iteration Function System). This method is used when compressed and can give a fairly good extrapolation.
Regarding the genetic algorithm is a good optimization technique for complex functions with large number of parameters, this method can be used in this task as the auxiliary, for example, when training the network. But as a primary method of solution is unlikely... - Eula_Von commented on October 8th 19 at 01:57
1) IFS will have to be applied to each color plane separately, as I understand it? If I can work around this limitation...

2) In my search stumbled on the fact that the task is very similar to debianization (demosaic) in modern digital cameras. However, you need to solve it is through the ins.

3) In the process of learning how to build a full-color image on the grid of the Bayer filter found interesting assumption, used in many algorithms between adjacent pixels, the value of Hue (color tone, it is the same relationship of R, G and B to each other) is changed slightly. Ins if you use this assumption as a reference interpolator would be best, I think, need to check.
In the picture below in the upper half — card of the color tones down the original: But above me the solution follows the problem — you need to change the input representation of the data given the hue constancy, while I think how to do it. - Sim_Volkm commented on October 8th 19 at 02:00
October 8th 19 at 01:56
Just a thought.

If the ins is fundamentally important, then you might like the ins, but tiny and with a narrow neck (small number of neurons in the hidden layer).

Terribly slow algorithm:
1) train mesh running window of 3x3 (or so) on the field 15x15 (as associative memory, i.e., the window input and output).
2) after training, the network will be approximated by the surface i.e. smooth out noise, such as small network size and the early stopping of training.
3) the network output for all positions of the window-remember, the results to be averaged pixel by pixel.
4) next move the square 15x15 and the whole process repeats. The offset must be overlapping (i.e. less than 15 pixels), otherwise the joints will come out.

If the field of one training cycle to do more than 15x15, then the approximation will smear the image due to excessive averaging. Algorithm to work on the idea in this way will be, but spermadine.

PS And generally here IMHO appropriate conventional non-linear regression or something like splines, but for two input variables.
Inputs a maximum of 15x15 (or 13x13 or 11x11 etc.), the output value of one Central pixel. - Eula_Von commented on October 8th 19 at 01:59
I meant a neural network with dimension of 3x3 inputs and outputs the same. The net learns to approximate a certain surface, but the surface is a field of 15x15 — from this field come from the training data, i.e. examples will be (15-2)*(15-2)=169. If neurons of the hidden layer will be a little (literally from 2 to 5), the network will attempt to summarize the data — this is the desired behavior. But the whole photo at a time so not to process, because you will need a larger number of neurons in the hidden layer and the ability to generalize will disappear. The network will just memorize data and all. Therefore, the need for each set of 15x15 to complete a full training cycle.

As I propose to do you too, probably possible, but will have to learn on a large number of different raw and already pre-processed images. And if you already have a tool for photo processing, it is not clear why the neural network. - Sim_Volkm commented on October 8th 19 at 02:02
Remember the network will start with a lack of examples for training, as I see it. Why do I need it? Classical algorithms in this topic is not enough "understanding of the microstructure" of the image is a simple generalization of the maximum — with the calculation of local gradients. I want to achieve more) - Eula_Von commented on October 8th 19 at 02:05

Find more questions by tags Algorithmsimage processingdata recoveryArtificial intelligenceNeural networks