ADVANTAGES AND DISADVANTAGES OF LEARNING A MULTILAYER NEURAL NETWORK USING A GENETIC ALGORITHM

. The advantages and disadvantages of learning a multilayer neural network using genetic algorithm are studied. Investigation was conducted on the basis of the developed software, which allows to detect indications of diseases by analyzing photographs of human organs` tissues. The Java programming language was used to implement the project. The software product consists of modules that implement: multilayer neural network, genetic algorithm and mechanism for reading and processing images from the file system. The genetic algorithm is used to calculate the initial values of synaptic weights, which are specified by the error propagation algorithm.


INTRODUCTION
Modern medicine depends more and more on the use of high -tech devices for diagnosis and treatment of diseases. This fact contributes to the development of software aimed at minimizing the negative impact of the human factor in this area. Therefore, it is advisable to use the capabilities of artificial neural networks to establish a diagnosis based on tissue images of diseased human organs [1, 2,3].
The purpose of this work was to compare the methods of training a multilayer neural network for the analysis of images of diseased tissues with the subsequent establishment of a diagnosis. The urgency of creating such a software product is explained by the need to increase the accuracy of diagnosing organ diseases, information about which can be provided in the form of images. The main task of this software product is the analysis of a large amount of data in order to correct the synaptic weights of the neural network and improve the quality of disease recognition. In order to achieve the best result, a comparison was made of the characteristics of the neural network, which was trained using the Back Propagation algorithm [4,5,6] and the hybrid of this method with the classical genetic algorithm (GA).

Implementation of a multilayer neural network
To build a multilayer neural network, the following classes were created: Neuron , Synapse , and MLP. The Neuron class implements the methods needed to implement neuron behavior: calculation of the activation function; establishing connections with other neurons in the network and methods for accessing private fields of a class. In this case, the sigmoidal activation function was used (Figure 1).
The Synapse class contains information about the neurons it connects. Also, the private field of the class stores the value of the synaptic weight set for the input of the neuron [7,8,9].

Figure 1 Sigmoidal activation function
The MLP class is the most complex of those listed. It implements the logic of neural network operation, that is, methods for setting initial values of synaptic weights, calculating errors at a certain stage of execution, training the network, and classifying input data based on network experience (Fig. 2).
To train the neural network, the back propagation algorithm is used, which is implemented using the back propagate method [10,11,12].

Figure 2 Class diagram
Before training begins, all weights are given random small initial values. This is necessary to prevent saturation with large values of synaptic weights, which causes a negative impact on the quality of network learning.
The learning algorithm includes the following steps: • selection of an instance of input data from the training set; • calculation of the initial value of the network; • error calculation; • correction of synaptic weights to minimize the error.
These steps are repeated until the desired error value is reached.

Implementation of a multilayer neural network using a genetic algorithm
To create a hybrid neural network with a genetic algorithm, a separate module was made that implemented the logic of the genetic algorithm.
This module includes the following classes : Chromosome and Minimum . Chromosome class realizes the work of the chromosome. It contains methods that perform crossover operations and mutations. There are also methods to access the private fields of the class.
The Minimum class implements the logic of the genetic algorithm. Its tasks are to create an initial population of the specified size; creating and filling the parent pool with individuals using the roulette method; carrying out the crossover and mutation process; integration into a neural network by calculating the initial values of synaptic weights.
Since the task of the project is the analysis of images of diseased tissues, the Image Utils class was developed . It contains methods for working with images. Since the perceptron accepts an array of values of type double as an input , it is necessary to convert the image into the corresponding array. For this, an algorithm was implemented that scales the input image to the desired size and converts it into a floating-point number array format.

An experiment with a neural network without the use of GA
Image quality degrades when zooming. This negatively affects the accuracy of neural network recognition. Therefore, it was decided to conduct a number of experiments with different extensions of the input images.
For this, a method was created inside the Main class to test the network with different input data. This method used a loop to automatically feed images of different magnifications to the input of the neural network and measure the time spent on training. The training of the network was carried out on the basis of almost four hundred images of tissues affected by various diseases. After that, the percentage of errors in image recognition was calculated (Table 1). The test results showed that the optimal size of the array of input values is 729 units, which corresponds to an image with dimensions of 27x27 pixels . At the same time, the time spent on perceptron training is 3262 ms, and the verification time is 22 ms. These values are slightly higher than the average value of the experiment. In total, about 40 iterations were performed during testing. Thus, the expansion of images from 2x2 to 40x40 pixels was covered. The testing process was stopped precisely at these values because the hybrid algorithm could not exceed this mark in 8 hours of testing. During training and testing of the algorithm, an average of 650 MB of RAM was used. The entire testing process took 133903ms or about three minutes.

An experiment with a hybrid neural network
The implementation of a hybrid algorithm requires a much larger number of operations than a neural network without GA.
In addition to the algorithm of back propagation of the error, the creation of the population of chromosomes, the process of mutation and crossover is performed. These processes are much more complex, so more computer hardware resources and time are spent on them. This is precisely what was confirmed by the testing of this algorithm.

22
As can be seen from Table 2, the time spent on training and testing the operation of the artificial neural network has increased many times. However, the percentage of recognition errors decreased. So the best value of 0.25% was achieved when expanding the image to 21x21. RAM consumption increased by only 150 MB. The only downside of this network is that it takes a lot more time. The experiment lasted about 8 hours. That is, the time spent has increased by 125 times.

CONCLUSION
During the execution of this project, a multilayer neural network was implemented with different approaches to learning, namely: learning using the algorithm of back propagation of the error and from the composition of the above-mentioned and genetic algorithm. As a result, the created software product made it possible to compare the efficiency of neural networks with different methods of determining weight coefficients.
The implemented software tool made it possible to use a neural network for the diagnosis of diseases based on the analysis of images of affected tissues. This approach to establishing a disease makes it possible to create a system that will be able to successfully and most importantly accurately diagnose a patient after analyzing a huge number of images from the training set. Such a system has an advantage over the average doctor, because it is able to accumulate the experience necessary for accurate work in a relatively short period of time.
In the testing process, the advantages and disadvantages of the simple and hybrid perceptron learning algorithm were revealed. The advantages of the back propagation algorithm include a lower consumption of computer resources and working time. But the accuracy of the network based on this algorithm is somewhat worse than that of the corresponding network with a genetic algorithm.
Regarding the composition of a neural network with a genetic algorithm, the advantages include higher recognition accuracy. However, with a relatively small number of images (about 400), the network with the genetic algorithm works much longer than the other option considered.
So, based on the data obtained in the research process, it can be concluded that it is better to use a hybrid network to solve the problem of diagnosing diseases, because it gives more accurate results.