=Paper= {{Paper |id=Vol-1730/p10 |storemode=property |title=Automatic System to Improve Quality of 2D Images Based on Kohonen Classifier |pdfUrl=https://ceur-ws.org/Vol-1730/p10.pdf |volume=Vol-1730 |authors=Dawid Połap |dblpUrl=https://dblp.org/rec/conf/system/Polap16 }} ==Automatic System to Improve Quality of 2D Images Based on Kohonen Classifier == https://ceur-ws.org/Vol-1730/p10.pdf
              Automatic System to Improve Quality
           of 2D Images Based on Kohonen Classifier
                                                            Dawid Połap
                                                      Institute of Mathematics
                                                 Silesian University of Technology
                                               Kaszubska 23, 44-100 Gliwice, Poland
                                                  Email: Dawid.Polap@gmail.com


   Abstract—In this paper, the idea of creating a system to analyze           One of the most popular applications of image processing is
and improve quality of 2D images is presented. Proposed model              medicine - the detection of various diseases in the early stages
operates on self-organizing Kohonen network. For this purpose,             can save lives. In [8], the authors proposed the detection of
the method of image processing and preparation of vectors
representing the components of the image are described. Tests              various types of smog and stains on the X-rays through the
on various images were made and presented.                                 use of modern methods of artificial intelligence - heuristic
                                                                           algorithms - in search of key-points. Moreover, in [8]–[11]
                        I. I NTRODUCTION                                   was shown the analysis and comparison of different methods
    2D image processing is not only a very important part of               of heuristic search using important areas of 2D images is
today’s science but ubiquitous technology. Mobile phones,                  paramount for efficiency. Not only X-ray images were sub-
police speed cameras, or analysis of images in different                   jected to computer analysis, but magnetic resonance of brain
factories are just a few basic applications of processing of               section images were too [12]. The authors presented three
2D graphics. This is the main motivator for creating new                   different ideas for visual representations of the original data.
and improving existing methods of detection and analysis of                Again, in [13] was presented the analysis of infrared thermal
shapes, or improve quality of graphics.                                    imaging of the skin.
    For the image analysis, it is important to prepare the image,             An interesting topic in the field of image processing are
in a certain way. For this purpose, a number of filters are used           neural networks, which are often used in the classification
to minimize the amount of information contained in the image               of different objects or even the entire image. In [14] was
leaving only the essential information or delete a plurality               shown the use of neural networks as classifiers in clinical
of noise and distortion. An example of a filter is a filter for            diagnosis. Again [15] proposed a model of multi-column deep
removing noise with using the theory of fuzzy sets, and other              neural networks for the classic problem of recognition of
methods of artificial intelligence [1]. In [2] a guided filter             numbers from 0 to 9. The authors of [16] presented an analysis
which acts as a smoothing operator was proposed. Another                   of the accuracy of recognition large-scale image by the use
example is the design of recursive algorithms eg.: the bilateral           of very deep convolutional networks. An interesting idea is
filter [3].                                                                learning neural classifiers to determine the contents of the
    An important aspect of the image processing is their com-              graphic objects [17]–[19]. In the case of use of artificial neural
pression. File compression increases possibility of easy trans-            networks it requires a very large number of samples. Samples
fer and processing of files. Compression algorithms should                 often are stored in databases, and thus algorithms for fast
not only reduce the weight of the file, but keep the best image            searching and sorting of data are important. Algorithm for
quality. One example of the newer compression algorithms                   fast data sorting in large datasets is shown in [20], and [21]
that use rbfnn and discrete wavelet decomposition is shown                 presented possibility of the organization of NoSQL database
in [4]. Another idea for image compression is the use of                   systems. Another known problem with neural networks is
artificial neural networks. In the paper, the authors used and             insufficient number of samples to perform correct learning
compared the different architecture of this structure for the              process. The most common solution is to use the theory
purpose of compression [5]. Again in [6] was presented an                  of fuzzy sets and other methods of artificial intelligence to
idea of a physics-based transform that enables compression.                increase the number of samples on the basis of existing ones
In case of medical research, created image files are usually               [22]–[25].
high resolution and thus the image files have large weight.                   Quick and effective methods have numerous applications
This problem did not pass indifferently, and in [7] was shown              in factories, wineries and orchards eg.: in [26] was shown the
an efficient compression algorithm dedicated to the medical                algorithm for detecting defects of fruit based on pictures using
files.                                                                     radial basis probabilistic neural networks.
                                                                              In this work, I would like to introduce an idea of a system
  Copyright c 2016 held by the author.                                     to improve image quality. For this purpose, an innovative way
                                                                           to extract data about the image quality from image file is



                                                                      57
discussed. In addition, implementing self-organizing Kohonen            where δ = max(R, G, B) and η = min(R, G, B). In the
network to indicate what needs to be improved in order to get           case where δ − η = 0, it is considered that the value is
the best quality picture is presented.                                  indeterminate.
                                                                           The second value describing the HSL model is a saturation
                           II. HSL
                                                                        that is described as the radius of the base that takes values of
   HSL next to RGB and CMYK is one of the most famous                   h0, 1i. The formula describing this attribute is
models of color space. It was first presented in [27] as a model
                                                                                                         δ−η
associated with the perception of color by the human eye.                                      s=                   ,                (3)
Each color is perceived as a light coming from a certain point                                      1 − |δ + η − 1|
(lightning), what is more, each color is derived from white             where δ = η then s = 0.
light. The name comes from the proposed model of the three                 The third and the last variable of the model is lightness l.
characteristics of color Hue, Saturation and Lightness.                 It is interpreted as the height of the cone. Lightness as well
                                                                        as saturation takes values in the range h0, 1i. It is defined as
                                                                        the average value of the largest and smallest components of
                                                                        color what can be represented as the following formula
                                                                                                         δ+η
                                                                                                    l=        .                      (4)
                                                                                                            2
                                                                                   III. KOHONEN ’ S SELF - ORGANIZING MAP
                                                                           The first models of artificial neural networks have already
                                                                        appeared in the 40s of the twentieth century [28]. More than 30
                                                                        years later, a Finnish scientist Teuvo Kohonen has developed
                                                                        a model of neural networks that learning does not require
                                                                        supervision [29], [30]. Applied learning is called competitive
                                                                        learning or learning with the competition. After entering
                                                                        patterns on the network, winning neuron is determined only
                                                                        this one neuron and its neighborhood have updated weight. In
                                                                        the case of this type of network, an important element is the
                                                                        choice of distance measure. With this measure, the network
                                                                        creates image of topological space of the input signals.
                                                                           Euclidean metric is the most common metric. The mathe-
                                                                        matical formula between two points x1 and x2 is defined as
                                                                                                              v
                                                                                                              u n
                                                                                                              uX
                                                                                 d(x1 , x2 ) = ||x1 − x2 || = t (x1i − x2i )2 ,      (5)
                                                                                                                i=0

                                                                        where n is the number of point coordinates.
  Fig. 1: The HSL color model mapped to two color cone.                   Learning operates by selection of the winning neuron which
                                                                        the weights are similar to the input vector. It can be represented
  Color model HSL is understood as a cone in which the color
                                                                        by
wheel is the base of the cone (see Fig. 1). Each color can be
                                                                                         d(x, wn ) = min (d(x, wi )).                  (6)
represented as a three-element vector of the following form                                          i=1,2,,n

                           [h, s, l] ,                       (1)           Using the selected metric, the size of the neighborhood
                                                                        is chosen. The radius of the neighborhood is reduced with
where all values describe one component of the cone.                    successive epochs. In the next step, the weight of the selected
   The hue h is understood as the angle on the color wheel              neurons are updated by the following equation
which takes a value between h0◦ , 360◦ i. The color wheel
begins with the red color and subsequently at 120◦ moves to                     wi (t) = wi (t − 1) + ηf (i, x)(x − wi (t − 1)),      (7)
a different color (120◦ is green and 240◦ is blue). Formally,           where η is a learning parameter, t is the number of epoch and
the hue is a property that the human eye can classify as one of         f (i, x) is a function of the neighborhood defined as a Gaussian
three primary colors (red, green, blue). Determination of the           function as follows
hue occurs according to                                                                                   −(d(i, w))2
                                     
                   ◦ G−B                                                                                     2λ2
               
               
                60            (mod6) if δ = R                                               g(i, x) = e              ,              (8)
               
                       δ−η
               
               
                     B−R                                                where λ is a parameter. Calibration step is the last step of
          h = 60◦             +2        if δ = G ,          (2)         learning the teacher introduces the input vectors and describes
                     δ−η
               
                    R−G                                                a neurons which represents the specific class. Model of such
               60◦
               
                            +4         if δ = B                        network is presented in Fig. 2.
                      δ−η


                                                                   58
                                   Fig. 2: Kohonen self organizing map also known as Kohonen classifier.


  IV. S YSTEM TO IMPROVE THE QUALITY OF 2D IMAGES                                      other cases, individual values are calculated by
                                                                                                                                  !
                                                                                                                  5       12
   The proposed system consists of two parts – preparation of                                                1X 1 X
                                                                                                        hi =                  hijk
                                                                                                      
                                                                                                      
                                                                                                      
the vector representing the image and Kohonen classifier.                                             
                                                                                                             6 j=0 13
                                                                                                      
                                                                                                                        k=0
   The system accepts a 2D image, which is divided into four
                                                                                                      
                                                                                                                5        12
                                                                                                                                   !
                                                                                                            1X 1 X
parts. Then, the six points of (x, y) are selected at random.                                           si =                  sijk    ,        (10)
                                                                                                             6 j=0 13
Points must be within a smaller area of the image. For each
                                                                                                      
                                                                                                                        k=0
                                                                                                                                 !
                                                                                                                 5       12
                                                                                                      
image, the selected points are found. Then, the neighborhood                                                 1X 1 X
                                                                                                      
                                                                                                      
                                                                                                      
                                                                                                      li = 6                lijk
                                                                                                      
of 12 points is determined for each point. The arithmetic
                                                                                                      
                                                                                                      
                                                                                                               j=0
                                                                                                                     13
                                                                                                                        k=0
average of each value (hue, saturation, lightness) is calculated
for all areas defined by the neighborhood. As a result, four                           where i means the number of the image, j is the number
vectors are created. All of the vectors are combined in a single                       of neighborhoods and k is the total number of points in the
thirteen-element vector representing the quality of the input                          neighborhood.
image. Created vector takes the following form                                            The resulting vector can be added to the database or be
                                                                                       assessed by Kohonen classifier. The system classifies the 2D
         [h1 , h2 , h3 , h4 , s1 , s2 , s3 , s4 , l1 , l2 , l3 , l4 , c],   (9)        image in terms of its quality. In the case where any of
                                                                                       the components of the HSL model differ from the norm,
where c is the value of 1 when the image is correct, and 0 in                          this component should be improved by increasing/decreasing



                                                                                  59
Fig. 3: The model of the proposed system.




                   60
according to mathematical formulas in Sec. II. In the case of           is unable to cope with the correct classification of the images
learning, vectors stored in database are used. A model of such          in the most complex color (eg.: partially obscured), which is
system is illustrated in Fig. 3.                                        its disadvantage.
                                                                           In the future research work is planned to consider a more
                      V. E XPERIMENTS
                                                                        complex system in terms of execution time, learning time and
   In order to test the proposed system, 100 pictures were taken        more parameters than the HSL model.
– 80 pictures with a digital camera with a resolution of 15 Mpx
and 20 images capture with the camera in a mobile phone with                                     ACKNOWLEDGMENT
a resolution of 8 Mpx. Among the samples of photos taken
with a digital camera, 50 of them were made in good quality.               Author acknowledge contribution to this project of Op-
All images taken with the camera in a mobile phone were                 erational Programme: Knowledge, Education, Development
made in the best quality.                                               financed by the European Social Fund under grant application
   For each photo, the vector was created according to the              POWR.03.03.00-00-P001/15.
notation in (9). Then, the vectors were added to the database
                                                                                                      R EFERENCES
with corresponding markings c. Kohonen classifier has been
made of two layers: an input (13 neurons) and output (9 × 9              [1] H.-H. Chou, L.-Y. Hsu, and H.-T. Hu, “Turbulent-pso-based fuzzy
grid of neurons). Learning on the network is performed using                 image filter with no-reference measures for high-density impulse noise,”
                                                                             Cybernetics, IEEE Transactions on, vol. 43, no. 1, pp. 296–307, 2013.
all samples from the database to achieve 10000 epochs. In                [2] K. He, J. Sun, and X. Tang, “Guided image filtering,” Pattern Analysis
order to know the percentage of correctness of the network we                and Machine Intelligence, IEEE Transactions on, vol. 35, no. 6, pp.
check the results for all samples in the database. The obtained              1397–1409, 2013.
                                                                         [3] Q. Yang, “Recursive bilateral filtering,” in Computer Vision–ECCV 2012.
result was 71% correctly classified images.                                  Springer, 2012, pp. 399–413.
   The results of the network considered and applied the appro-          [4] M. Wozniak, C. Napoli, E. Tramontana, G. Capizzi, G. L. Sciuto, R. K.
priate corrections by increasing or decreasing eg.: saturation.              Nowicki, and J. T. Starczewski, “A multiscale image compressor with
                                                                             rbfnn and discrete wavelet decomposition,” in Neural Networks (IJCNN),
Sample images before and after improvement are shown in                      2015 International Joint Conference on. IEEE, 2015, pp. 1–7.
Fig. 4 and 5.                                                            [5] F. Hussain and J. Jeong, “Exploiting deep neural networks for digital
                                                                             image compression,” in Web Applications and Networking (WSWAN),
Algorithm 1 Kohonen Network Algorithm                                        2015 2nd World Symposium on. IEEE, 2015, pp. 1–6.
                                                                         [6] M. H. Asghari and B. Jalali, “Discrete anamorphic transform for image
 1: Start                                                                    compression,” Signal Processing Letters, IEEE, vol. 21, no. 7, pp. 829–
 2: Initiate a learning parameter η, Gaussian function param-                833, 2014.
                                                                         [7] A. Arthur and V. Saravanan, “Efficient medical image compression
      eter λ, the number of epochs                                           technique for telemedicine considering online and offline application,”
 3: Set weights at random                                                    in Computing, Communication and Applications (ICCCA), 2012 Inter-
 4: while t < epochs do                                                      national Conference on. IEEE, 2012, pp. 1–5.
                                                                         [8] M. Wozniak, D. Polap, L. Kosmider, C. Napoli, and E. Tramontana,
 5:   for each input vector x do                                             “A novel approach toward x-ray images classifier,” in Computational
 6:      for each output neuron k do                                         Intelligence, 2015 IEEE Symposium Series on. IEEE, 2015, pp. 1635–
 7:        Calculate the distance according to (5)                           1641.
                                                                         [9] M. Woźniak and Z. Marszałek, “An idea to apply firefly algorithm in
 8:        Find the winning neuron using (6)                                 2d image key-points search,” in Information and Software Technologies.
 9:        Find the neighborhood of the winning neuron                       Springer, 2014, pp. 312–323.
10:        for each neuron in the neighborhood do                       [10] C. Napoli, G. Pappalardo, E. Tramontana, Z. Marszalek, D. Polap,
                                                                             and M. Wozniak, “Simplified firefly algorithm for 2d image key-points
11:          Update the weight using (7)                                     search,” in Computational Intelligence for Human-like Intelligence
12:        end for                                                           (CIHLI), 2014 IEEE Symposium on. IEEE, 2014, pp. 1–8.
13:        Reduce the radius of the neighborhood                        [11] D. Połap, M. Woźniak, C. Napoli, E. Tramontana, and R. Damaševičius,
14:      end for                                                             “Is the colony of ants able to recognize graphic objects?” in Information
                                                                             and Software Technologies. Springer, 2015, pp. 376–387.
15:   end for                                                           [12] L. O. Hall, A. M. Bensaid, L. P. Clarke, R. P. Velthuizen, M. S. Silbiger,
16: end while                                                                and J. C. Bezdek, “A comparison of neural network and fuzzy clustering
17: Stop                                                                     techniques in segmenting magnetic resonance images of the brain,”
                                                                             Neural Networks, IEEE Transactions on, vol. 3, no. 5, pp. 672–682,
                                                                             1992.
                                                                        [13] B. F. Jones, “A reappraisal of the use of infrared thermal image analysis
                     VI. C ONCLUSIONS                                        in medicine,” Medical Imaging, IEEE Transactions on, vol. 17, no. 6,
                                                                             pp. 1019–1027, 1998.
   The presented model not only allows to determine whether a           [14] M. Astion and P. Wilding, “The application of backpropagation neural
particular 2D image is correct in terms of quality, but it shows             networks to problems in pathology and laboratory medicine.” Archives
what needs to be improved. Implementation of algorithms to                   of pathology & laboratory medicine, vol. 116, no. 10, pp. 995–1001,
                                                                             1992.
improve the quality of basic HSL attributes is performed by             [15] D. Ciresan, U. Meier, and J. Schmidhuber, “Multi-column deep neural
specific equations shown in Sec. II for each pixel of the image.             networks for image classification,” in Computer Vision and Pattern
   Result correctness of the analyzed samples were obtained                  Recognition (CVPR), 2012 IEEE Conference on. IEEE, 2012, pp. 3642–
                                                                             3649.
at the level of 71%, which is a good result due to the small            [16] K. Simonyan and A. Zisserman, “Very deep convolutional networks for
number of photos taken in the learning process. The system                   large-scale image recognition,” arXiv preprint arXiv:1409.1556, 2014.




                                                                   61
Fig. 4: Sample images made by a digital camera with a resolution of 15 Mpx before (on the left) and after (on the right) the
improvement of quality.


[17] K. Xu, J. Ba, R. Kiros, A. Courville, R. Salakhutdinov, R. Zemel, and          [19] M. R. Schmuck, “Development and application of computational tools
     Y. Bengio, “Show, attend and tell: Neural image caption generation with             for high content image analysis (hca) of neural cells,” Ph.D. dissertation,
     visual attention,” arXiv preprint arXiv:1502.03044, 2015.                           Düsseldorf, Heinrich-Heine-Universität, Diss., 2015, 2016.
[18] O. Vinyals, A. Toshev, S. Bengio, and D. Erhan, “Show and tell: A              [20] M. Woźniak, Z. Marszałek, M. Gabryel, and R. K. Nowicki, “Modified
     neural image caption generator,” in Proceedings of the IEEE Conference              merge sort algorithm for large scale data sets,” in Artificial Intelligence
     on Computer Vision and Pattern Recognition, 2015, pp. 3156–3164.                    and Soft Computing. Springer, 2013, pp. 612–622.




                                                                               62
Fig. 5: Sample images made by the camera on the mobile phone with a resolution of 8 Mpx before (on the left) and after (on
the right) the improvement of quality.




                                                           63
[21] Z. Marszałek and M. Woźniak, “On possible organizing nosql database
     systems,” Int. J. Information Science and Intelligent System, vol. 2, pp.
     51–59, 2013.
[22] R. K. Nowicki, B. A. Nowak, J. T. Starczewski, and K. Cpalka, “The
     learning of neuro-fuzzy approximator with fuzzy rough sets in case of
     missing features,” in Neural Networks (IJCNN), 2014 International Joint
     Conference on. IEEE, 2014, pp. 3759–3766.
[23] R. K. Nowicki, M. Korytkowski, B. A. Nowak, and R. Scherer, “Design
     methodology for rough neuro-fuzzy classification with missing data,” in
     Computational Intelligence, 2015 IEEE Symposium Series on. IEEE,
     2015, pp. 1650–1657.
[24] W. K. Mleczko, T. Kapuściński, and R. K. Nowicki, “Rough deep belief
     network-application to incomplete handwritten digits pattern classifica-
     tion,” in Information and Software Technologies. Springer, 2015, pp.
     400–411.
[25] B. A. Nowak, R. K. Nowicki, M. Woźniak, and C. Napoli, “Multi-class
     nearest neighbour classifier for incomplete data handling,” in Artificial
     Intelligence and Soft Computing. Springer, 2015, pp. 469–480.
[26] G. Capizzi, G. Lo Sciuto, C. Napoli, E. Tramontana, and M. Wozniak,
     “Automatic classification of fruit defects based on co-occurrence matrix
     and neural networks,” in Computer Science and Information Systems
     (FedCSIS), 2015 Federated Conference on. IEEE, 2015, pp. 861–867.
[27] G. H. Joblove and D. Greenberg, “Color spaces for computer graphics,”
     in ACM siggraph computer graphics, vol. 12, no. 3. ACM, 1978, pp.
     20–25.
[28] W. S. McCulloch and W. Pitts, “A logical calculus of the ideas immanent
     in nervous activity,” The bulletin of mathematical biophysics, vol. 5,
     no. 4, pp. 115–133, 1943.
[29] C. Von der Malsburg, “Self-organization of orientation sensitive cells in
     the striate cortex,” Kybernetik, vol. 14, no. 2, pp. 85–100, 1973.
[30] T. Kohonen, “Self-organized formation of topologically correct feature
     maps,” Biological cybernetics, vol. 43, no. 1, pp. 59–69, 1982.




                                                                                 64