<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Convolutional neural network in the images colorization problem</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>M V Bulygin</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>M M Gayanova</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>A M Vulfin</string-name>
          <email>vulfin.alexey@gmail.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>A D Kirillova</string-name>
          <email>kirillova.andm@gmail.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>R Ch Gayanov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Higher School of Economics</institution>
          ,
          <addr-line>Myasnitskaya str., 20, Moscow, Russia, 101000</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Ufa State Aviation Technical University</institution>
          ,
          <addr-line>K. Marks str. 12, Ufa, Russia, 450008</addr-line>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2019</year>
      </pub-date>
      <fpage>340</fpage>
      <lpage>353</lpage>
      <abstract>
        <p>Object of the research are modern structures and architectures of neural networks for image processing. Goal of the work is improving the existing image processing algorithms based on the extraction and compression of features using neural networks using the colorization of black and white images as an example. The subject of the work is the algorithms of neural network image processing using heterogeneous convolutional networks in the colorization problem. The analysis of image processing algorithms with the help of neural networks is carried out, the structure of the neural network processing system for image colorization is developed, colorization algorithms are developed and implemented. To analyze the proposed algorithms, a computational experiment was conducted and conclusions were drawn about the advantages and disadvantages of each of the algorithms.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        1. Introduction
Modern neural networks (NN) show good results in a wide range of image processing tasks (Figure 1),
which could not be achieved earlier by other methods. Thus, the neural network ResNet50 in the
classification problem on the Imagenet set showed an accuracy of 96.43%, while the average person
correctly recognizes only 94.9% of the images [
        <xref ref-type="bibr" rid="ref1 ref2 ref3 ref4 ref5">1-5</xref>
        ].
      </p>
      <p>The urgency of the problem is explained by the need to reduce the computational complexity of
implementing neural networks for image processing.</p>
      <p>Neural
networks
recognition
colorization
detection
demarcation</p>
      <p>Goal of the work is improving the existing image processing algorithms based on the extraction
and compression of features using neural networks using the colorization of black and white images as
an example.</p>
      <p>To achieve this goal it is necessary to solve the following tasks:
1. Analysis of image processing algorithms based on neural networks;
2. Development of the structure of a neural network processing system for image colorization;
3. Development of a heterogeneous neural network architecture in the problem of colorization of
images;</p>
      <p>4. Carrying out the experiment and analyzing the results.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Analysis of image processing algorithms based on neural networks</title>
      <p>
        Image colorization is the process of adding color to a monochromatic (black and white) image or
video [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. The color space is constructed in such a way that any color is represented by a point having
certain coordinates.
      </p>
      <p>
        The problem of colorization does not have an unambiguous solution, since one gray scale
corresponds to several color space points at once. For this reason, for colorization, it is necessary to
use not only data about the color of the point, but also additional information. The source of such
information can serve as another image (reference image), or expert opinion, or, identified in the
image by a neural network an additional high-level features [
        <xref ref-type="bibr" rid="ref10 ref7 ref8 ref9">7-10</xref>
        ].
      </p>
      <p>
        Today, colorization is in demand, for example, for color versions of black and white films. There
are many methods for solving the problem of colorizing images, each of which has its own advantages
and disadvantages – Table 1 [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
      </p>
    </sec>
    <sec id="sec-3">
      <title>Disadvantages</title>
      <p>Manual division into multiple zones
with the color assignment;
Impossibility of automatically separating
the boundaries of significant areas in the
presence of fuzziness or with
considerable complexity
Neural network High processing speed (5-7 s); It is not always possible to determine the
coloring based on Quite high quality of colorization due to colors of the desired image points;
reference points and the analysis of expert data Self-matching color for a point is a
expert data difficult task;
If coloring a large number of similar
images, it is necessary to specify hints
points for each.</p>
      <p>Neural network The colorization of one image takes less Low quality of colorization (photos do
colorization based on than 2 minutes; not turn out to be full-color, most of the
reference points The process does not require human pictures are painted in brown tones);
intervention. The image size is limited to 1 MB.</p>
      <sec id="sec-3-1">
        <title>Neural network</title>
        <p>colorization</p>
        <p>Open source and a detailed description of Low quality of colorization of most
the principles of its operation; images.</p>
        <p>It does not require large processing
power and can be run in a Google</p>
        <p>Colaboratory or FloydHub environment.</p>
        <p>Therefore, the actuality lies in developing a neural network architecture for image colorization
based on existing solutions, characterized by the organization of the input space of high-dimensional
features and the reduced number of layers and neurons in the hidden layers, which allows to increase
the speed of image processing and maintain the required quality of processing.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>3. Development of the structure of a neural network processing system for image colorization</title>
      <p>
        When carrying out a computational experiment with a neural network based on [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], it was found that
after the colorization some of the images lose their clarity. To improve the process of colorization, it is
necessary to apply the image with selected contours to the inputs of the neural network as a source of
additional information - meta-attributes, in addition to the image itself.
      </p>
      <p>
        The solution proposed in this work is based on [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] and uses the allocation of image contours with
the help of the neural network InceptionV3 [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] to improve the colorization of images through the use
of meta-features.
      </p>
      <p>In the proposed solution, a hint is a color image containing information that can help a neural
network when coloring (for example, a similar color photo or a photo of a person presented in the
main photo, painted by a expert).</p>
      <p>If the neural network inputs is fed by the original image, its outlines, extracted features and the
uncompressed image-hint, the neural network will have too many adjustable coefficients, which will
lead to a significant increase in the requirements for computing resources for training and further work
of the NN in color mode. It is suggested to compress images (original monochrome and image-hints),
as well as submit selected outlines in a compressed form.</p>
      <p>Thus, the original task is divided into the following subtasks:
1. Compress the original monochrome image;
2. Extract and compress the outlines from the original image;
3. Extract the signs from the image using one of the giant neural networks;
4. Compress the image-hint;
5. Train a neural network that takes inputs to the results of solving past subtasks and receives a
color image output.</p>
      <p>Thus, a generalized structure of a heterogeneous convolutional neural network is proposed
(Figure 2).</p>
      <p>An array of pixels
corresponding to the
original monochrome</p>
      <p>image.</p>
      <p>An array of pixels
corresponding to the
original hint image.</p>
      <p>image compression
outlines extraction and</p>
      <p>compression
feature extraction using
neural network for</p>
      <p>classification
hint image compression</p>
      <p>compressed
black and white</p>
      <p>image
compressed
representation of</p>
      <p>outlines
representation of
features extracted by
neural network for</p>
      <p>classification
compressed hint</p>
      <p>image</p>
      <p>It is important to note that the solutions obtained in solving the first four subtasks can be used to
solve other problems.</p>
      <sec id="sec-4-1">
        <title>3.1. Algorithms of compressing the original image</title>
        <p>The tasks of compressing the original black-and-white image and the color hinting image are related to
the tasks of information compression. It is possible to use methods that eliminate visual redundancy –
information that can be deleted without compromising human perception.</p>
        <p>A general classification and comparative analysis of image compression methods suitable for
integration with subsequent neural network processing layers is shown in Figure 3 and Table 2.</p>
        <p>Wavelet transform
The Haar
transformation</p>
        <p>Transforma</p>
        <p>tion
Daubechies</p>
        <p>Compression of information: classification of
approaches for image processing</p>
        <p>Neural
network
processing
Kohonen's NN</p>
        <p>NN Hopfield</p>
        <p>AutoCoder</p>
        <p>Classic
autocoders</p>
        <p>Noise
Reduction
Autocoders</p>
        <p>Basic
methods of</p>
        <p>image
compression</p>
        <p>Principal
component</p>
        <p>analysis
Independent
component</p>
        <p>analysis
Convolutional
Autocoders</p>
        <p>
          When learning neural network with auto-coding, the problem of choosing the error function and
optimizer arises. The most common error functions are MSE – mean squared error. Modern optimizers
allow to prevent errors from reaching the local minimum, help to more evenly update the network
weights and increase the speed of training. Some features can be extremely informative, but they are
rare to meet. For this reason, updating the network parameters, taking into account the extent to which
a typical feature represents this parameter, can make learning more effective. For this, in the
Adagrad [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] Optimizer the sum of the squares of updates for each parameter is stored. The choice of
the optimizer and the error function for the auto-encoder is extremely important, since this directly
affects the quality and speed of the network. The empirical selection of the optimizer and the error
function also seems extremely difficult, since it requires a large number of experiments that take a
large amount of time. The use of the MSE error function and the optimizer Adam proved themselves
in solving the colorization problem in the works of Amir Avni [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ], Emil Wolner [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ], Baldasar [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ].
        </p>
        <p>To compress the original black and white images, convolutional autocoders were used. The
autocoder for image compression accepts a black and white image represented as an array. The
dimensions of the original images are 512x512 pixels, so the array and the input layer of the neural
network have a dimension of 512x512x1. To solve the main problem, it is necessary to compress the
image up to the dimension of 128x128x1. Compression is performed using the encoder. To restore the
original images in order to verify the quality of the compression, as well as the training of the encoder,
it is also necessary to use a decoder.</p>
      </sec>
      <sec id="sec-4-2">
        <title>3.2. Algorithms of selecting the image object outlines</title>
        <p>The most popular algorithms for extracting contours are the methods of Roberts, Prewitt and Sobel,
based on the use of operators. However, the resulting contour images are quite large and contain a lot
of features. An autocoder could be applied to the image of contours, but data that is of value to a
neural network may be lost. Also, if the filters are applied, the solution will not be homogeneous. To
isolate contours and simultaneously compress them, it was decided to use an autocoder of the same
structure that was used to compress the image, however, during the training of this autocoder, the
outputs will be requested not for the original image but for its outlines. To extract the contours for the
training sample, we use the Sobel operator, since the contours obtained by this method are the thinnest
and sharpest ones.</p>
      </sec>
      <sec id="sec-4-3">
        <title>3.3. Neural network object recognition systems</title>
        <p>At the moment there are many neural networks for the classification of images, but the largest of them
and showing consistently high results are InceptionV3, ResNet, NasNet and VGG19. The architectures
of these neural networks, as well as the weights for them after training on large image databases are
freely available for download. A comparative analysis of modern neural network architectures is
presented in Table 3.</p>
        <p>Method
Wavelet compression (Haar
wavelet)
Wavelet compression
(Daubechy wavelet)
Kohonen’s Neural networks
Hopfield's Neural Networks
Neural network autocoders
Noise-reduction neural
network autocoders
Sparse neural network
autocoders</p>
        <p>Method
Conversion neural network
autocoders
Classical methods of
dimension reduction (principal
components analysis,
independent components
analysis)
Areas with approximately equal brightness Transformations are based on the
make up a small part of the image, zeroing features of human perception of
of the constant part is performed images;
When processing with the help of neural Loss of features important for the
networks, the high-frequency coefficients neural network as the main core of
zeroed out at wavelet transform can carry a the colorization system is possible.
lot of information
If the number of network clusters is less When compressing arbitrary images
than the number of different fragments of that were not contained in the
source images, then the recovery is not training sample, an image
accurate. consisting of fragments that were in
the training sample will be restored.</p>
        <p>In the problem of image
colorization, the approach is not
applicable.</p>
        <p>Application as an associative memory In the event of an arbitrary image
allows the exact reconstruction of a submission, the image from the
distorted image. training sample closest to the image</p>
        <p>being fed will be restored.</p>
        <p>A feature is the ability to recreate the output The most suitable are convolutional
of the same signal as the input (displays a autocoders using the dropout
larger space with complex connections in a algorithm of the convolution and
space of smaller dimensions); sweep layers.</p>
        <p>Ability to represent diverse and complex The greatest effect when
varieties. compressing images of one type,
Restore the input x not by itself, but from such as handwritten figures, aircraft
its noisy representation x ̇. or persons.</p>
        <p>The artificial noisiness of the input data
(augmentation) forces the NN to construct
independent features
Introduces a measure of dissimilarity
between the distribution of attributes of
input images and is added to the objective
function as a regularizer</p>
        <p>Advantages and Disadvantages</p>
        <p>Possibility of application in the</p>
        <p>colorization problem
Built using convolutional layers in the
encoder and scan layers in the decoder.</p>
        <p>Linear attribute systems are distinguished. They are used when compressing
images of the same type with
similar characteristics.
original monochrome</p>
        <p>image
colored hint image</p>
        <p>compression using a
convolutional auto-coder
outlines extraction using</p>
        <p>neural network
feature extraction using
neural network for</p>
        <p>recognition
compression using a
convolutional auto-coder</p>
        <p>Neural network for
colorization
colored
image</p>
        <p>To extract the features in the work, it is suggested to use the NasNet network, since it shows good
classification results even with a small number of layers, and, therefore, the signs extracted with it are
the most informative.</p>
        <p>The final structure of a heterogeneous convolutional neural network for colorization is shown in
Figure 4.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>4. Development of algorithms for image processing using neural networks</title>
      <p>
        Formation of a data set for a neural network of the selected architecture is a non-trivial task. Images
from classic sets for learning neural networks, such as CIFAR-100 or STL, are too small. In Emile
Wolner's decision [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], the discolored images from the Unsplash service were used to teach the neural
network and its testing. These images cannot be used to learn this neural network, because the help
image cannot be found. Considered the possibility of taking frames from the colorized black and white
films. This idea was rejected because every film was painted by professionals in the style of the time
when the film was shot and the colorization can turn unnatural. Another reason for refusing this
method of obtaining data was the possible problems with copyrights. To obtain natural coloration, it
was decided to search for video with a natural color transfer, and then make black and white individual
frames, which will be fed as initial. As a hint, it was planned to feed frames went in the video in a few
seconds. At the same time, the problem of the clarity of the original frames arose. To solve this, videos
were taken that had at least 60 frames per second in the video stream. In this case, blurring when
divided into frames is not so noticeable.
      </p>
      <p>The number of seconds of delay between the original frame was chosen randomly in the interval
from 1 to 5 to provide a different degree of similarity of frames. However, there was another problem:
when training on a video containing one continuous scene, it is difficult to provide a variety of
samples for training and testing. When using video collected from different scenes, there were also
problems: the original frame could belong to one scene, for example, an urban landscape, and a
framehint – another, for example, a scene shot on the sea coast. In this case, the Euclidean distance was used
to select the pairs of images “original-hint” before decolorizing the original image. If it exceeded a
certain threshold value, a warning was output and the frames were checked for belonging to one scene
manually.</p>
      <sec id="sec-5-1">
        <title>4.1. Neural network object recognition systems</title>
        <p>Convolutional autocoders was used to compress the original black-and-white images – Table 4. The
structure of the encoder is described below.</p>
        <sec id="sec-5-1-1">
          <title>The number of weighting coefficients (total, in the autocoder) Type of layers used Convolutional, subsampling layers, layers of increasing dimension</title>
          <p>The size of the convolution kernel 2x2
The size of the subsampling kernel 2x2
Dimension of the original image 512x512x1
Dimension of the compressed image 128x128x1
Number of learning epochs 8
Number of images in the training and validation samples 1500/500
The type of the error function (the nature of the change), RMS (reduction over all epochs),
Optimizer Adam
Activation function ReLU - for all layers except the last one
Sigmoidal - output layer
1060356/528129</p>
          <p>The first layer of the neural network is the input layer. The next layer is the convolution layer, this
layer has 256 filters, the convolution core is 2x2 in size. Then follows the first downsampling layer,
which serves to reduce the dimension. This layer has a core of dimension 2x2. At the output of this
layer there are 256 signs of dimension 256x256. The next layer performs the convolution; it has a 2x2
core, as well as 128 filters. To obtain a representation of the desired dimension, a sub-sampling layer
is added, having a core dimension of 2x2. The last layer of the encoder is a convolution layer with a
2x2 core, as well as a single filter. At the outputs of the last layer described, an encoded, compressed
representation of the original image is removed.</p>
          <p>The structure of the decoder has the form resembling a mirror image of the encoder structure. First,
the encoded representation passes through a convolution layer, the core of which is 2x2 in size. This
layer has 128 filters. Then, to increase the dimension, a layer is inserted that performs the inverse
operation of the downsampling. The kernel size of this operator is 2x2. This is followed by a
convolution layer, the core of which has a size of 2x2, and the number of filters is 256. Then, to obtain
features of the original dimension, a dimension increase layer with a 2x2 core is used. Further, to
obtain the final representation, a convolution layer with a 2x2 kernel and the number of filters equal to
one is used.</p>
          <p>Training is performed by combining the encoder and decoder into an auto-encoder. An array
corresponding to the original black and white image is fed to the inputs of the auto-encoder, and the
outputs require obtaining the same array. As an activation function for all layers except the last, the
“ReLU” function is used. For the last layer, the sigmoidal activation function is used. The training also
uses the “Adam” optimizer. The root mean square error is chosen as the error function.</p>
          <p>The neural network was trained for eight epochs, the training sample contained 1500 images, the
sample for validation had a volume of 500 images. Throughout all epochs, except the last one, a steady
decrease in the error was observed, both for the training sample and during validation. The initial error
value in the first epoch of learning exceeded 0.09, while by the end of the eighth epoch it was less than
0.011. The total number of coefficients for the auto-encoder is 1060356, of which 528129 are the
encoder and the rest are the decoder.</p>
          <p>The results of this neural network are shown in Figures 5 and 6.</p>
          <p>Convolutional autocoders was used to compress the initial color images-hints.</p>
          <p>The results of this neural network are shown in Figures 7 and 8.</p>
          <p>To compress the original color hint images convolutional autocoders were used. Autocoder for
image compression accepts a color image as an array (RGB color space is used). The dimensions of
the original images are 512x512 pixels, so the array and the input layer of the neural network have a
dimension of 512x512x3. To solve the main problem, it is necessary to compress the image up to the
dimension of 128x128x3. Compression is performed using the encoder. To restore the original images
in order to verify the quality of the compression, as well as the training of the encoder, it is also
necessary to write a decoder.</p>
          <p>The structure of encoder is described below. The first layer of the neural network is the input layer.
The next layer is the convolution layer, this layer has 768 filters, the core of the convolution is 2x2 in
size. Then follows the first downsampling layer, which serves to reduce the dimension. This layer has
a core of dimension 2x2. At the output of this layer there are 768 signs of dimension 256x256. The
next layer performs the convolution; it has a 2x2 core, as well as 384 filters. To obtain a representation
of the desired dimension, a sub-sampling layer is added, having a core dimension of 2x2. The last
layer of the encoder is a convolution layer with a 2x2 core, as well as three filters. At the outputs of
the last layer described, an encoded, compressed representation of the original image is removed.</p>
          <p>The structure of the decoder has the form resembling a mirror image of the encoder structure. First,
the encoded representation passes through a convolution layer, the core of which is 2x2 in size. This
layer has 384 filters. Then, to increase the dimension, a layer is inserted that performs the inverse
operation of the downsampling. The kernel size of this operator is 2x2. Next comes the convolution
layer, the core of which has a size of 2x2, and the number of filters is 768. Then, to obtain features of
the original dimension, a layer of increasing dimension with a 2x2 core is used. Further, to obtain the
final representation, a convolution layer with a 2x2 core and a number of filters equal to three is used.</p>
          <p>
            Training is performed by combining the encoder and decoder into an auto-encoder. An array
corresponding to the original color image is fed to the inputs of the auto-encoder, and the outputs
require obtaining the same array. As an activation function for all layers except the last, the “ReLU”
function is used. For the last layer, the sigmoidal activation function is used. The training also uses the
Adam optimizer. The root mean square error is chosen as the error function. These decisions were
made after studying neural networks created by Emil Wolner [
            <xref ref-type="bibr" rid="ref15">15</xref>
            ] and Baldasar, which showed good
results.
          </p>
          <p>The neural network was trained for eight epochs, the training sample contained 1500 images, the
sample for validation had a volume of 500 images. Throughout all epochs, except the last one, a steady
decrease in the error was observed, both for the training sample and during validation. The initial error
value in the first epoch of learning exceeded 0.12, while by the end of the eighth epoch it was less than
0.02. The total number of coefficients for the autocoder is 2389254, 1194627 of which are the
encoder, and the rest are the decoder.</p>
        </sec>
      </sec>
      <sec id="sec-5-2">
        <title>4.2. Isolating and compressing the outlines of the original image</title>
        <p>To isolate and compress the outlines of the original black-and-white images, convolutional autocoders
were used. An array corresponding to the original black-and-white image is fed at the inputs of the
autocoder, and at the outputs it is required to obtain an array corresponding to the contours of the
original image extracted with the help of the Sobel operator.</p>
        <sec id="sec-5-2-1">
          <title>The size of the convolution kernel</title>
          <p>The size of the subsampling kernel
Dimension of the original image
Dimension of the compressed image
Number of learning epochs
Number of images in the training and
validation samples
The type of the error function (the nature of
the change), Optimizer
Activation function
The results of this neural network are shown in Figures 9 and 10.</p>
        </sec>
      </sec>
      <sec id="sec-5-3">
        <title>4.3. Features selection by the NasNet network</title>
        <p>As a result of the analysis of the NASNet neural network architecture it was concluded that the
number of features needed to build a network for coloring can be extracted from the 257-th layer, if to
count from the last layer of the network. This layer has the form 32x32x16, which allows it to be
transformed into a layer of dimension 128x128x1, which will be convenient for forming the final input
figure for the neural network for colorization.</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>5. Experiments on image colorization</title>
      <p>The implementation of all structures and architectures of neural networks described in the previous
chapter was performed in the Google Colaboratory environment using the Keras library. The
experiments are performed according to the Table 7:</p>
      <sec id="sec-6-1">
        <title>Experiment 2 Image compressed with</title>
        <p>the autocoder 16 times
Experiment 3 An image compressed
with an autocoder, as
well as a compressed
representation of
contours
Experiment 4 The image compressed Most of the photos colored with low accuracy. Sharpness of
by the autocoder, as well images is broken, not always objects are discernible by a
as the compressed image person. In some cases, images are obtained, painted
hint completely reliably (there are differences from the original)
Experiment 5 Original image, outlines, Colonization is absolutely unreliable. The network is
(6) hint, (NASNet features) uneducable.</p>
        <p>in compressed form</p>
        <sec id="sec-6-1-1">
          <title>5.1. Colorization using a fully-connected neural network</title>
          <p>As a result of the colorization with the help of a fully connected neural network, trained on the set of
“Fruits”, unrealistic images were obtained. Colorization is reduced to replacing monochrome black
and white images with monochrome brown images. However, when coloring the test sample, positive
results were also obtained. In particular, black-and-white photographs obtained natural dark blue
shades, as well as natural shades of green when staining stems. Training neural network took a long
time, this neural network of all implemented has the greatest number of coefficients, as well as
addition/ multiplication operations for obtaining results – Figure 11.</p>
        </sec>
        <sec id="sec-6-1-2">
          <title>5.2. Colorization with the help of convolutional autocoder</title>
          <p>This network structure was tested on the aircraft photos of the CIFAR set. The training of this neural
network was carried out in eight epochs. Training took less time than in the case of a fully connected
network. The results of coloration can be characterized as good. The shades of the sky are transmitted
quite accurately, realistically, the sky's coloring does not overlap planes. The color of the aircraft itself
is incomplete, but distortions are not perceived by a person without viewing the original images.
However, there is a part of the images, the output versions of which are very fuzzy, blurry, the
detailing is much lower than the original images.</p>
          <p>Examples of coloration using a neural network of this structure are shown in Figure 12.</p>
        </sec>
        <sec id="sec-6-1-3">
          <title>5.3. Colorization using a compressed representation of images and a compressed representation of contours</title>
          <p>Colorization with the addition of a compressed representation of the contours to the original image led
to improved results. This type of colorization successfully showed itself in the photographs of aircraft,
as it led to an improvement in the quality of output images and was tested on a set of arbitrary images.
The resulting images have become clearer than using coloring without contours, as can be seen in
Figure 13, but the color component has become less significant.</p>
          <p>Only some areas of the sky were correctly colored. Color quality is comparable to the first works
by Emil Wolner.</p>
        </sec>
        <sec id="sec-6-1-4">
          <title>5.4. Coloring an arbitrary image using a color image hint</title>
          <p>When using a color image-hint, the color component of the output image has in many cases
significantly improved. Some arbitrary photographs are painted realistically and do not cause
problems in human perception. However, for photos for which the hint-image is too far away, the
coloration is unnatural. Objects are blurred, sometimes unrecognizable. Also typical is the situation
where a neural network “does not recognize” objects and covers the entire image in blue. Also
sometimes there is a situation when the network “learns” only part of the image, spends the coloration
of this part, and the rest of the image turns muddy, indistinct, and also remains black and white or
acquires an unnatural color. In general, this kind of colorization gives an ambiguous result. On the one
hand, this method produced the best, most natural images in some cases, but in others – the images at
all ceased to be recognizable, which was not observed in other types of colorization.</p>
          <p>Examples of coloration using hinting images are presented in Figure 14.</p>
        </sec>
        <sec id="sec-6-1-5">
          <title>5.5. Colorization with the help of a complete set of selected features</title>
          <p>When using a compressed original image, a compressed representation of the contours, and a
compressed image of the hint, the learning network could not be obtained. As a result of using a neural
network after one learning epoch, it was discovered that the output image for any input looks like a
monotonically colored square. When analyzing activities at the outputs of a neural network, one can
see that there are differences in brightness, but they are insignificant and when they are rounded up to
integers they are the same.</p>
          <p>
            Any noticeable changes, except for increasing the learning time and obtaining results were not
observed when adding to the set of input data features extracted with the NASNet network. The results
of colorization are also single-color images [
            <xref ref-type="bibr" rid="ref16 ref17 ref18">16-18</xref>
            ].
          </p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>6. Conclusions</title>
      <p>The proposed algorithms for processing images based on the extraction and compression of features
using neural networks for colorization of black and white images are based on the use of deep
convolutional networks of a heterogeneous architecture with pre-trained modules for solving
individual subtasks.</p>
      <p>The architecture of the neural network for image colorization is developed, based on existing
solutions, characterized by the organization of the input space of high dimensionality features and the
reduced number of layers and neurons in the hidden layers, which allows to increase the speed of
image processing and maintain the required quality of processing.</p>
      <p>The proposed solution uses allocation of image contours with the help of the neural network
InceptionV3 to improve the colorization of images through the use of metfeatures. The hint is a color
image. If the original image is used in its entirety, its outlines, extracted features, and the
uncompressed image-hint, the neural network will have too many adjustable coefficients, which will
lead to a significant increase in the requirements for computing resources for learning and further
work of the NN in the colorization mode. It is proposed to compress images (original monochrome
and image-hints), as well as submit selected outlines in a compressed form, which allowed to
significantly reduce the number of customized NN coefficients and reduce the requirements for
computational resources.</p>
      <p>In the future, it is possible to develop the architecture of the colorization system, which is possible
by a small increase in the depth of the network, as well as the number of filters on each layer. Perhaps,
other architectures should be tested, except for convolutional ones, for example, recurrent neural
networks.</p>
    </sec>
    <sec id="sec-8">
      <title>Acknowledgments</title>
      <p>This work was supported by the Russian Foundation for Basic Research, research № 17-08-01569.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1] VGG-19 in Keras URL: https://keras.io/applications/#vgg19 (
          <issue>10</issue>
          .
          <fpage>06</fpage>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2] ResNet50 in Keras URL: https://keras.io/applications/#resnet50 (
          <issue>10</issue>
          .
          <fpage>06</fpage>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3] NASNet in Keras URL: https://keras.io/applications/#nasnet (
          <volume>10</volume>
          .
          <fpage>06</fpage>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Convolutional</given-names>
            <surname>Layers</surname>
          </string-name>
          in Keras URL: https://keras.io/layers/convolutional/ (
          <volume>10</volume>
          .
          <fpage>06</fpage>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <article-title>[5] Profile of Andrey Karpaty Official site</article-title>
          of Stanford University URL: https://www.cs.stanford. edu/~karpathy/ (
          <volume>10</volume>
          .
          <fpage>06</fpage>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Hand</given-names>
            <surname>Colored Films</surname>
          </string-name>
          <string-name>
            <surname>URL</surname>
          </string-name>
          : http://www.widescreenmuseum.com/old-color/handtint.htm (
          <volume>10</volume>
          .
          <fpage>06</fpage>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Soldatova</surname>
            <given-names>O P</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Garshin</surname>
            <given-names>A A</given-names>
          </string-name>
          <year>2010</year>
          <article-title>The use of convolutional neural network for handwriting digit recognition</article-title>
          <source>Computer Optics</source>
          <volume>34</volume>
          (
          <issue>2</issue>
          )
          <fpage>252</fpage>
          -
          <lpage>259</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Izotov</surname>
            <given-names>P Yu</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Kazanskiy N L</given-names>
            ,
            <surname>Golovashkin D L and Sukhanov S V 2011 CUDA-</surname>
          </string-name>
          <article-title>Enable Implementation of a Neural Network Algorithm for Handwritten Digit Recognition Optical Memory and Neural Networks</article-title>
          (Information Optics)
          <volume>20</volume>
          (
          <issue>2</issue>
          )
          <fpage>98</fpage>
          -
          <lpage>106</lpage>
          DOI: 10.3103/ S1060992X11020032
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Zoev</surname>
            <given-names>I V</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Beresnev</surname>
            <given-names>A P</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Markov N G and Malchukov</surname>
            <given-names>A N</given-names>
          </string-name>
          <year>2017</year>
          FPGA
          <article-title>-based device for recognizing handwritten digits in images</article-title>
          <source>Computer Optics</source>
          <volume>41</volume>
          (
          <issue>6</issue>
          )
          <fpage>938</fpage>
          -
          <lpage>949</lpage>
          DOI: 10.18287/
          <fpage>2412</fpage>
          - 6179-2017-41-6-
          <fpage>938</fpage>
          -949
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Vizil'ter Yu</surname>
            <given-names>V</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gorbatsevich</surname>
            <given-names>V S</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vorotnikov</surname>
            <given-names>A V</given-names>
          </string-name>
          and
          <string-name>
            <surname>Kostromov</surname>
            <given-names>N A</given-names>
          </string-name>
          <year>2017</year>
          <article-title>Real-time face identification with the use of convolutional neural network and a hashing forest</article-title>
          <source>Computer Optics</source>
          <volume>41</volume>
          (
          <issue>2</issue>
          )
          <fpage>254</fpage>
          -
          <lpage>265</lpage>
          DOI: 10.18287/
          <fpage>2412</fpage>
          -6179-2017-41-2-
          <fpage>254</fpage>
          -265
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <article-title>AI-Powered Software for Colorizing Black and White Photos URL: https://gizmodo.com/aipowered-software-makes-it-incredibly-easy-</article-title>
          <string-name>
            <surname>to-</surname>
          </string-name>
          coloriz-
          <volume>1795298582</volume>
          (
          <issue>10</issue>
          .
          <fpage>06</fpage>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Colorizing</surname>
            <given-names>B</given-names>
          </string-name>
          &amp;
          <article-title>W photos with Neural Networks URL: https://blog.floydhub.com/colorizing-bw-photos-with-neural-</article-title>
          <source>networks/ (10.06</source>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <article-title>Image Recognition InceptionV3 URL: https://www</article-title>
          .tensorflow.org/tutorials/image_recognition/ (
          <volume>10</volume>
          .
          <fpage>06</fpage>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <surname>Nikolenko</surname>
            <given-names>S</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kadurin</surname>
            <given-names>A</given-names>
          </string-name>
          and
          <string-name>
            <surname>Arkhangelskaya E 2017 Deep</surname>
          </string-name>
          <article-title>Learning (Immersion in the World of Neural Networks</article-title>
          ) p
          <fpage>480</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <article-title>Image Colorization using CNNs</article-title>
          and
          <string-name>
            <surname>Inception-ResNet-V2</surname>
            <given-names>URL</given-names>
          </string-name>
          : https://arxiv.org /abs/1712.03400 (
          <issue>10</issue>
          .
          <fpage>06</fpage>
          .
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <surname>Gonzalez</surname>
            <given-names>R</given-names>
          </string-name>
          and
          <string-name>
            <surname>Woods R 2005 Digital Image Processing</surname>
          </string-name>
          (Moscow: Tehnosfera) p
          <fpage>1007</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <surname>Rangayyan R M 2015</surname>
          </string-name>
          <article-title>Biomedical signal analysis</article-title>
          (John Wiley &amp; Sons) p
          <fpage>720</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <surname>Rutkovskaya</surname>
            <given-names>D</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pilihjskij</surname>
            <given-names>M</given-names>
          </string-name>
          and
          <string-name>
            <surname>Rutkovskij L 2008 Neural Networks</surname>
          </string-name>
          ,
          <source>Genetic Algorithms and Fuzzy Systems</source>
          (Moscow: Goryachaya Liniya - Telekom)
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>