Application of the Neural Network for Recognition of Artificially Generated Images

2017. Т. 17, No 3. С. 135–141 135 Introduction From the very beginning of the development of cybernetics, scientists immediately drew attention to the problem of modeling perception. There was a transition from the analysis of three-dimensional scenes to flat images, from dynamic samples to static ones to simplify the solution of the perception problem. Subsequently, to identify the selection of certain objects from the background of the static sample began to use such a concept as pattern recognition. In this paper, a system was developed that has letters at different angles and imposes noise on them. After that, a neural network was created in order to process these results and undergo the procedure for recognizing reference images. The use of a neural network is the best option for recognition, since with the correct adjustment of the scales and the choice of the metric, the learning process takes place in the best possible way. It has been experimentally proven that samples obtained by artificial means are suitable for training a neural network. The neural network with back propagation of errors correctly works on new reference values. Pattern recognition is performed by various methods. There are following methods for recognizing visual images: 1. Raster. The image is represented as a matrix of points and each point corresponds to the brightness of the image. In this case, the image is previously read by some scanner, the brightness of the points is fixed and a spatial matrix of points with different brightness is formed by spatial decomposition. Quite often, from brightness, many gradations pass to luminances having 2 values: 0 or 1. The standard is the matrix of points. And a really recognizable image is compared with the reference image most often point-by-point, where the number of coincidences of points is fixed. For this method, it is important that the input image be normalized (of the same size and orientation) [1]. The image can also be assigned to a given size and position. This method is well suited for recognizing printed texts. The disadvantage is the need to select individual objects from the image. 2. Indicative. Some distinctive features (size, direction, color, vector) are distinguished in the image, which are set by the person so that they help to recognize objects on the one hand, and on the other hand they are invariant with respect to possible deformations, changing the size and position of the recognized symbol. A set of attributes can be represented as a vector in the n-dimensional space of attributes [1]. The point on the graph refers to a single characteristic (Fig. 1). When learning, vector points are taken from different objects, memorized, special weights are calculated. If a set of attributes is Fig. 1. The feature vectors DOI: 10.14529/ctcr170315


Introduction
invariant and some feature in the image, then points representing objects of different classes are assembled into compact sets. Representing variants of objects of a certain class (Fig. 2).

Fig. 2. Distribution of objects in clusters
Sometimes a hyperplane is constructed (Fig. 3).  For each threshold value, two values are calculated: the proportion of true positive examples is the number of outputs that are greater than or equal to the threshold, divided by the number of single target values (values to the left of the hyperplane); The proportion of false positive examples is the number of outputs that are less than the threshold divided by the number of zero target values (values to the right of the hyperplane) [2]. In this way, the distances in the n-dimensional feature space are calculated. The metric of distance calculation can be, as Euclidean distance, Hamming distance or Mahalonobis distance.
3. Structural. On the image of an individual object, the structural elements are selected, which are specified in advance. It can be segments, arcs, dots. At training a certain description in terms of structural elements is constructed. When recognized, these descriptions are compared.
The recognition problem defines an image as a vector in an n-dimensional space. This vector is called the feature vector. We have a base of vectors and we need to recognize these vectors, that is, to determine for each vector which class it belongs to. And the neural network learns recognition by precedents. We have accumulated statistics that we want to study and already by the results of this study to diagnose already new vectors [2].
A neural network is organized, which has several outputs, each of which corresponds to a certain class. Each of these outputs is fed with "-1" if the vector does not belong to this class and "1" if it belongs to this class. When a vector is applied to a neural network, we obtain some output data and assign the vector to that class whose signal corresponding to the output neuron is larger.
We will recognize images that are noisy. We use the generator of such images, which will rotate the letters at different angles and will impose a white noise on them. Next, we train the neural network on the generated images and then apply the neural network to analyze the real ones.
To recognize letters located at different angles, we will use a neural network with direct signal propagation and back propagation of the error. It is the use of this type of network will provide better recognition. When solving the classification problem, the use of the hierarchical model or the selforganizing map of Kohonen is unacceptable. Since each letter will have exactly one output. The neural network works as follows (Fig. 4). We represent x as a function of weights: = ( , , ) = ( + + ).
Find the partial derivative and that : Network error on k-th example: ( ) = ( ( , , ), ( , , ); The calculation of these formulas makes it possible to calculate the gradient of the error function from the weights of the neural network for the first layer. The algorithm for back propagation of the error makes it possible to calculate the error distribution by the weights of the output layer and to drag this distribution back using the formulas: ( ) = ( , … , ) = ( , … , ) = , … , ; Errors on the inputs of the previous layer are calculated by the formula: Value сalculate for the current layer, and for the previous [2].
Hence, the algorithm with direct propagation of the signal and back propagation of the error allowed us to calculate the partial derivative of the error over all the weights of the neural network of the output, the previous one, etc. layer.
During the study, letters of the Latin alphabet of size 5 to 7 were created. After encoding the letters of the alphabet in 0 or 1, the generator of the angle of inclination of the letter was created in this study. The maximum angle was 60 degrees (Fig. 5).

Fig. 5. Example of rotation of the angle of the letter
Next, the neural network learned to correctly recognize letters in different positions. The progress of the training is shown in the graph below (Fig. 6). Seen a decrease in the values of the mean square error. After that, the data was noisy. And the neural network learned to recognize images with noise. The noisy image looked like this (Fig. 7).

Fig. 7. Example of noisy image
At the stage of the learning process it can be seen that the standard error was z-shaped. Training with noise took a long time (Fig. 8).

Fig. 8. Example of learning an image with noise
During the test, a noisy image was sent to the input (for example, the letter O) and the neural network successfully recognized it (Fig. 9).

Fig. 9. Successful recognition distorted letters
Nevertheless, errors still arise: the neural network recognizes the noisy letter Q as O. As the angle of rotation is reduced, the neural network becomes more unrepresentative, it does not allow the neural network to provide a complete picture of how the turned character looks.

Conclusion
The conducted research has shown that the use of a neural network for pattern recognition is an acceptable option, especially if the picture is not of good quality. The application of a neural network with direct signal propagation and back propagation of the error is optimal, since noisy images were recognized in 24 of 26 cases. It was proved that the generated system using artificial creation of a letter and turning it to a certain degree with subsequent noise is correct. Subsequently, all reference images were successfully recognized based on this training sample.